Skip to content

Commit

Permalink
refactor: 필요없는 함수 전달 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
pipisebastian committed Nov 26, 2024
1 parent 7b7d17e commit 1b54bf5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 3 additions & 9 deletions client/src/features/editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,14 @@ interface EditorProps {
onTitleChange: (title: string) => void;
pageId: string;
serializedEditorData: serializedEditorDataProps;
updatePageData: (pageId: string, newData: serializedEditorDataProps) => void;
}
interface ClipboardMetadata {
value: string;
style: string[];
color: TextColorType | undefined;
backgroundColor: BackgroundColorType | undefined;
}
export const Editor = ({
onTitleChange,
pageId,
serializedEditorData,
updatePageData,
}: EditorProps) => {
export const Editor = ({ onTitleChange, pageId, serializedEditorData }: EditorProps) => {
const {
sendCharInsertOperation,
sendCharDeleteOperation,
Expand Down Expand Up @@ -194,7 +188,7 @@ export const Editor = ({
linkedList: editorCRDT.current.LinkedList,
});
},
[sendCharInsertOperation, sendCharDeleteOperation, editorCRDT, pageId, updatePageData],
[sendCharInsertOperation, sendCharDeleteOperation, editorCRDT, pageId],
);

const handleKeyDown = (
Expand Down Expand Up @@ -356,7 +350,7 @@ export const Editor = ({

block.crdt.currentCaret = caretPosition;
},
[editorCRDT, pageId, sendCharInsertOperation, updatePageData],
[editorCRDT, pageId, sendCharInsertOperation],
);

const subscriptionRef = useRef(false);
Expand Down
2 changes: 0 additions & 2 deletions client/src/features/workSpace/WorkSpace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const WorkSpace = () => {
updatePageTitle,
initPages,
initPagePosition,
updatePageData,
openPage,
} = usePagesManage(workspace, clientId);
const visiblePages = pages.filter((page) => page.isVisible);
Expand Down Expand Up @@ -69,7 +68,6 @@ export const WorkSpace = () => {
handlePageSelect={selectPage}
handlePageClose={closePage}
handleTitleChange={updatePageTitle}
updatePageData={updatePageData}
/>
) : null,
)}
Expand Down

0 comments on commit 1b54bf5

Please sign in to comment.