Skip to content

Commit 0dc0e39

Browse files
committed
refactor: 에디터 unsaved 뱃지 제거
- 미사용 기능이므로 제거
1 parent 15781ae commit 0dc0e39

File tree

5 files changed

+6
-50
lines changed

5 files changed

+6
-50
lines changed

apps/frontend/src/features/editor/ui/Editor/index.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
type JSONContent,
88
EditorCommandList,
99
EditorBubble,
10-
type EditorInstance,
1110
} from "novel";
1211
import { ImageResizer, handleCommandNavigation } from "novel/extensions";
1312
import Collaboration from "@tiptap/extension-collaboration";
@@ -28,19 +27,14 @@ import { ColorSelector } from "./selectors/color-selector";
2827
import { uploadFn } from "../../model/upload";
2928
import { useEditor } from "../../model/useEditor";
3029

31-
type EditorUpdateEvent = {
32-
editor: EditorInstance;
33-
};
34-
3530
interface EditorProp {
3631
pageId: number;
3732
initialContent?: JSONContent;
38-
onEditorUpdate?: (event: EditorUpdateEvent) => void;
3933
ydoc: Y.Doc;
4034
provider: SocketIOProvider;
4135
}
4236

43-
export function Editor({ onEditorUpdate, ydoc, provider }: EditorProp) {
37+
export function Editor({ ydoc, provider }: EditorProp) {
4438
const {
4539
openNode,
4640
openColor,
@@ -81,7 +75,6 @@ export function Editor({ onEditorUpdate, ydoc, provider }: EditorProp) {
8175
},
8276
}}
8377
slotAfter={<ImageResizer />}
84-
onUpdate={onEditorUpdate}
8578
>
8679
<EditorCommand className="z-50 h-auto max-h-[330px] overflow-y-auto rounded-md border border-muted bg-background px-1 py-2 shadow-md transition-all">
8780
<EditorCommandEmpty className="px-2 text-muted-foreground">

apps/frontend/src/features/editor/ui/EditorActionPanel/index.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,9 @@ import {
66
} from "lucide-react";
77

88
import { useEditorStore } from "../../model/editorStore";
9-
import SaveStatus from "../SaveStatus";
109
import { cn } from "@/shared/lib";
1110

12-
interface EditorActionPanelProps {
13-
saveStatus: "saved" | "unsaved";
14-
}
15-
16-
export function EditorActionPanel({ saveStatus }: EditorActionPanelProps) {
11+
export function EditorActionPanel() {
1712
const { isPanelOpen, togglePanel, isMaximized, toggleMaximized } =
1813
useEditorStore();
1914

@@ -51,7 +46,6 @@ export function EditorActionPanel({ saveStatus }: EditorActionPanelProps) {
5146
)}
5247
</button>
5348
</div>
54-
<SaveStatus saveStatus={saveStatus} />
5549
</div>
5650
</div>
5751
);

apps/frontend/src/features/editor/ui/SaveStatus/index.tsx

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { useEffect, useState } from "react";
2-
import { useDebouncedCallback } from "use-debounce";
1+
import { useEffect } from "react";
32

43
import { useUserStore } from "@/entities/user";
54
import { usePageStore } from "@/entities/page";
@@ -10,7 +9,6 @@ import { useEdtorConnection } from "@/features/editor/model/useEditorConnection"
109
export const useEditorView = () => {
1110
const { currentPage } = usePageStore();
1211
const { isPanelOpen, isMaximized, setIsPanelOpen } = useEditorStore();
13-
const [saveStatus, setSaveStatus] = useState<"saved" | "unsaved">("saved");
1412
useEdtorConnection(currentPage);
1513
const { editor } = useConnectionStore();
1614
const { users } = useUserStore();
@@ -25,22 +23,12 @@ export const useEditorView = () => {
2523
setIsPanelOpen(true);
2624
}, [currentPage]);
2725

28-
const handleEditorUpdate = useDebouncedCallback(async () => {
29-
if (currentPage === null) {
30-
return;
31-
}
32-
33-
setSaveStatus("unsaved");
34-
}, 500);
35-
3626
return {
3727
currentPage,
3828
isPanelOpen,
3929
isMaximized,
4030
ydoc: editor.provider?.doc,
4131
provider: editor.provider,
42-
saveStatus,
43-
handleEditorUpdate,
4432
users,
4533
};
4634
};

apps/frontend/src/widgets/EditorView/ui/index.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,8 @@ import { ActiveUser } from "@/shared/ui";
44
import { cn } from "@/shared/lib";
55

66
export function EditorView() {
7-
const {
8-
currentPage,
9-
isPanelOpen,
10-
isMaximized,
11-
provider,
12-
saveStatus,
13-
handleEditorUpdate,
14-
users,
15-
} = useEditorView();
7+
const { currentPage, isPanelOpen, isMaximized, provider, users } =
8+
useEditorView();
169

1710
if (currentPage === null) {
1811
return null;
@@ -28,7 +21,7 @@ export function EditorView() {
2821
isMaximized ? "right-0 top-0 h-screen w-screen" : "",
2922
)}
3023
>
31-
<EditorActionPanel saveStatus={saveStatus} />
24+
<EditorActionPanel />
3225
<div
3326
className={cn(
3427
"flex flex-1 flex-col gap-4 overflow-auto px-12 py-4",
@@ -46,7 +39,6 @@ export function EditorView() {
4639
pageId={currentPage}
4740
ydoc={provider.doc}
4841
provider={provider}
49-
onEditorUpdate={handleEditorUpdate}
5042
/>
5143
</div>
5244
</div>

0 commit comments

Comments
 (0)