Skip to content

Commit

Permalink
feat: 옵션 hook 연결
Browse files Browse the repository at this point in the history
  • Loading branch information
pipisebastian committed Nov 21, 2024
1 parent 64dac06 commit f0c5021
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions client/src/features/editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useSocketStore } from "@src/stores/useSocketStore.ts";
import { editorContainer, editorTitleContainer, editorTitle } from "./Editor.style";
import { Block } from "./components/block/Block.tsx";
import { useBlockDragAndDrop } from "./hooks/useBlockDragAndDrop";
import { useBlockOptionSelect } from "./hooks/useBlockOption.ts";
import { useMarkdownGrammer } from "./hooks/useMarkdownGrammer";

interface EditorProps {
Expand Down Expand Up @@ -55,6 +56,17 @@ export const Editor = ({ onTitleChange, pageId, serializedEditorData }: EditorPr
pageId,
});

const { handleTypeSelect, handleAnimationSelect, handleCopySelect, handleDeleteSelect } =
useBlockOptionSelect({
editorCRDT: editorCRDT.current,
editorState,
setEditorState,
pageId,
sendBlockUpdateOperation,
sendBlockDeleteOperation,
sendBlockInsertOperation,
});

const { handleKeyDown } = useMarkdownGrammer({
editorCRDT: editorCRDT.current,
editorState,
Expand Down Expand Up @@ -275,6 +287,8 @@ export const Editor = ({ onTitleChange, pageId, serializedEditorData }: EditorPr
onInput={handleBlockInput}
onKeyDown={handleKeyDown}
onClick={handleBlockClick}
onAnimationSelect={handleAnimationSelect}
onTypeSelect={handleTypeSelect}
/>
))}
</SortableContext>
Expand Down

0 comments on commit f0c5021

Please sign in to comment.