diff --git a/frontend/src/components/editor/DocumentView.tsx b/frontend/src/components/editor/DocumentView.tsx index 8f3c6d01..a9bbd3cf 100644 --- a/frontend/src/components/editor/DocumentView.tsx +++ b/frontend/src/components/editor/DocumentView.tsx @@ -43,7 +43,7 @@ function DocumentView() { width: 8, borderRadius: 0, cursor: "col-resize", - zIndex: 100, + zIndex: 0, }} />
void; @@ -11,37 +13,76 @@ interface YorkieIntelligenceFooterProps { function YorkieIntelligenceFooter(props: YorkieIntelligenceFooterProps) { const { onClose } = props; const theme = useTheme(); + const editorStore = useSelector(selectEditor); + const anchorRef = useRef(null); const [selectedTitle, setSelectedTitle] = useState(null); const [selectedFeature, setSelectedFeature] = useState(null); - + const [anchorEl, setAnchorEl] = useState(); const handleSelectFeature = (feature: IntelligenceFeature, title: string) => { setSelectedFeature(feature); setSelectedTitle(title); }; + const width = useMemo( + () => editorStore.cmView!.contentDOM.getBoundingClientRect().width - 12, + [editorStore.cmView] + ); + console.log(width); + + useEffect(() => { + if (!anchorRef.current) return; + + setAnchorEl(anchorRef.current); + + return () => { + setAnchorEl(undefined); + }; + }, [anchorRef.current]); return ( - - + + - {selectedFeature && selectedTitle ? ( - - ) : ( - - )} - - + + {selectedFeature && selectedTitle ? ( + + ) : ( + + )} + + + ); }