From 2c59df9fb701344288b3aec876b1c683dc1d2f8e Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Sat, 1 Feb 2025 12:58:53 +0500 Subject: [PATCH] web: remove unused code from action-bar --- apps/web/src/components/editor/action-bar.tsx | 49 ------------------- 1 file changed, 49 deletions(-) diff --git a/apps/web/src/components/editor/action-bar.tsx b/apps/web/src/components/editor/action-bar.tsx index 72911bcc2f..73d108d383 100644 --- a/apps/web/src/components/editor/action-bar.tsx +++ b/apps/web/src/components/editor/action-bar.tsx @@ -89,7 +89,6 @@ import { isMac } from "../../utils/platform"; export function EditorActionBar() { const { isMaximized, isFullscreen, hasNativeWindowControls } = useWindowControls(); - const editorMargins = useEditorStore((store) => store.editorMargins); const isFocusMode = useAppStore((store) => store.isFocusMode); const activeTab = useEditorStore((store) => store.getActiveTab()); const activeSession = useEditorStore((store) => @@ -140,45 +139,6 @@ export function EditorActionBar() { activeSession.type === "readonly") && showPublishView(activeSession.note, "top") }, - // { - // title: editorMargins - // ? strings.disableEditorMargins() - // : strings.enableEditorMargins(), - // icon: editorMargins ? EditorNormalWidth : EditorFullWidth, - // enabled: true, - // hideOnMobile: true, - // onClick: () => useEditorStore.getState().toggleEditorMargins() - // }, - // { - // title: isFullscreen - // ? strings.exitFullScreen() - // : strings.enterFullScreen(), - // icon: isFullscreen ? ExitFullscreen : Fullscreen, - // enabled: true, - // hidden: !isFocusMode, - // hideOnMobile: true, - // onClick: () => { - // if (isFullscreen) { - // exitFullscreen(); - // } else { - // enterFullscreen(document.documentElement); - // } - // } - // }, - // { - // title: isFocusMode ? strings.normalMode() : strings.focusMode(), - // icon: isFocusMode ? FocusMode : NormalMode, - // enabled: true, - // hideOnMobile: true, - // onClick: () => { - // useAppStore.getState().toggleFocusMode(); - // if (document.fullscreenElement) exitFullscreen(); - // const editor = - // activeSession && - // useEditorManager.getState().getEditor(activeSession.id); - // if (editor) editor.editor?.focus(); - // } - // }, { title: strings.toc(), icon: TableOfContents, @@ -749,12 +709,3 @@ function ReorderableList( ); } - -function enterFullscreen(elem: HTMLElement) { - elem.requestFullscreen(); -} - -function exitFullscreen() { - if (!document.fullscreenElement) return; - document.exitFullscreen(); -}