diff --git a/frontend/src/components/editor/Editor.tsx b/frontend/src/components/editor/Editor.tsx index 7b9f33e6..4008f44b 100644 --- a/frontend/src/components/editor/Editor.tsx +++ b/frontend/src/components/editor/Editor.tsx @@ -34,7 +34,7 @@ function Editor(props: EditorProps) { const [element, setElement] = useState(); const editorStore = useSelector(selectEditor); const configStore = useSelector(selectConfig); - const settingStore = useSelector(selectFeatureSetting); + const featureSettingStore = useSelector(selectFeatureSetting); const workspaceStore = useSelector(selectWorkspace); const { mutateAsync: createUploadUrl } = useCreateUploadUrlMutation(); const { mutateAsync: uploadFile } = useUploadFileMutation(); @@ -51,7 +51,7 @@ function Editor(props: EditorProps) { !element || !editorStore.doc || !editorStore.client || - typeof settingStore.fileUpload?.enable !== "boolean" + typeof featureSettingStore.fileUpload?.enable !== "boolean" ) { return; } @@ -87,7 +87,7 @@ function Editor(props: EditorProps) { }), yorkieCodeMirror(editorStore.doc, editorStore.client), intelligencePivot, - ...(settingStore.fileUpload.enable + ...(featureSettingStore.fileUpload.enable ? [imageUploader(handleUploadImage, editorStore.doc)] : []), urlHyperlinkInserter(editorStore.doc), @@ -107,7 +107,7 @@ function Editor(props: EditorProps) { configStore.codeKey, themeMode, workspaceStore.data, - settingStore.fileUpload?.enable, + featureSettingStore.fileUpload?.enable, dispatch, createUploadUrl, uploadFile, diff --git a/frontend/src/components/headers/DocumentHeader.tsx b/frontend/src/components/headers/DocumentHeader.tsx index e6a4374f..aae5a4e4 100644 --- a/frontend/src/components/headers/DocumentHeader.tsx +++ b/frontend/src/components/headers/DocumentHeader.tsx @@ -1,9 +1,11 @@ import ArrowBackIosNewIcon from "@mui/icons-material/ArrowBackIosNew"; import EditIcon from "@mui/icons-material/Edit"; +import MoreVertIcon from "@mui/icons-material/MoreVert"; import VerticalSplitIcon from "@mui/icons-material/VerticalSplit"; import VisibilityIcon from "@mui/icons-material/Visibility"; import { AppBar, + Grid2 as Grid, IconButton, Paper, Stack, @@ -11,24 +13,22 @@ import { ToggleButtonGroup, Toolbar, Tooltip, - Grid2 as Grid, Typography, } from "@mui/material"; +import { useSnackbar } from "notistack"; import { useEffect, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; import { useNavigate } from "react-router-dom"; +import { useUpdateDocumentTitleMutation } from "../../hooks/api/workspaceDocument"; import { useUserPresence } from "../../hooks/useUserPresence"; +import { selectDocument } from "../../store/documentSlice"; import { EditorModeType, selectEditor, setMode } from "../../store/editorSlice"; import { selectWorkspace } from "../../store/workspaceSlice"; import { ShareRole } from "../../utils/share"; import DownloadMenu from "../common/DownloadMenu"; import ShareButton from "../common/ShareButton"; -import UserPresenceList from "./UserPresenceList"; -import { selectDocument } from "../../store/documentSlice"; -import { useUpdateDocumentTitleMutation } from "../../hooks/api/workspaceDocument"; -import { useSnackbar } from "notistack"; import DocumentPopover from "../popovers/DocumentPopover"; -import MoreVertIcon from "@mui/icons-material/MoreVert"; +import UserPresenceList from "./UserPresenceList"; function DocumentHeader() { const dispatch = useDispatch(); @@ -43,7 +43,7 @@ function DocumentHeader() { ); const isEditingDisabled = Boolean(editorState.shareRole); const { enqueueSnackbar } = useSnackbar(); - const [moreButtonanchorEl, setMoreButtonAnchorEl] = useState(null); + const [moreButtonAnchorEl, setMoreButtonAnchorEl] = useState(null); useEffect(() => { if (editorState.shareRole === ShareRole.READ) { @@ -162,8 +162,8 @@ function DocumentHeader() { diff --git a/frontend/src/store/workspaceSlice.ts b/frontend/src/store/workspaceSlice.ts index e9b497b7..0e2beabc 100644 --- a/frontend/src/store/workspaceSlice.ts +++ b/frontend/src/store/workspaceSlice.ts @@ -34,6 +34,14 @@ export const selectWorkspace = (state: RootState) => state.workspace; /** * Manages workspace-related state. + * + * * This slice handles: + * - `data`: The currently active workspace, including: + * - `id`: Unique identifier for the workspace. + * - `title`: The name of the workspace. + * - `slug`: A URL-friendly identifier for the workspace. + * - `updatedAt`: The timestamp of the last update to the workspace. + * - `createdAt`: The timestamp when the workspace was created. */ const reducer = workspaceSlice.reducer;