From 47514fb780c260cd8dd960041eb8e9d49c45742c Mon Sep 17 00:00:00 2001 From: Pedro Carreno <34664891+Pkcarreno@users.noreply.github.com> Date: Sat, 28 Dec 2024 21:54:32 -0400 Subject: [PATCH] feat(workflow): rework desktop footer and on panels collapse action buttons location --- .../editor/components/header/index.tsx | 2 + .../header}/layout-direction-toggler.tsx | 0 .../base/components/footer/desktop-footer.tsx | 65 ------------------- .../features/base/components/footer/index.tsx | 2 - src/features/editor/features/base/index.tsx | 36 ++++++++++ 5 files changed, 38 insertions(+), 67 deletions(-) rename src/features/editor/{features/base/components/footer => components/header}/layout-direction-toggler.tsx (100%) delete mode 100644 src/features/editor/features/base/components/footer/desktop-footer.tsx diff --git a/src/features/editor/components/header/index.tsx b/src/features/editor/components/header/index.tsx index 8f4a6c0..ac5c82a 100644 --- a/src/features/editor/components/header/index.tsx +++ b/src/features/editor/components/header/index.tsx @@ -4,6 +4,7 @@ import { useMemo } from 'react'; import { ActionButtons } from './action-buttons'; import { AutorunToggler } from './autorun-toggler'; import { InfoEdit, InfoTitle } from './info'; +import { LayoutDirectionToggler } from './layout-direction-toggler'; import { MainMenu } from './main-menu'; import { OpenInSite } from './open-in-site'; import { SharingMenu } from './sharing-menu'; @@ -27,6 +28,7 @@ export const Header = () => {
{isIframe && } {!isIframe && } +
diff --git a/src/features/editor/features/base/components/footer/layout-direction-toggler.tsx b/src/features/editor/components/header/layout-direction-toggler.tsx similarity index 100% rename from src/features/editor/features/base/components/footer/layout-direction-toggler.tsx rename to src/features/editor/components/header/layout-direction-toggler.tsx diff --git a/src/features/editor/features/base/components/footer/desktop-footer.tsx b/src/features/editor/features/base/components/footer/desktop-footer.tsx deleted file mode 100644 index 3e94ba6..0000000 --- a/src/features/editor/features/base/components/footer/desktop-footer.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import { PinLeftIcon, PinRightIcon } from '@radix-ui/react-icons'; -import { Separator } from '@radix-ui/react-separator'; -import React from 'react'; - -import { Button } from '@/components/ui/button'; -import { useHelp } from '@/features/editor/hooks/use-help'; -import { cn } from '@/lib/utils'; - -import { LayoutDirectionToggler } from './layout-direction-toggler'; -import type { FooterProps } from './types'; - -interface Props - extends FooterProps, - Pick, 'className'> {} - -export const DesktopFooter: React.FC = ({ - onLeftClick, - isLeftActive, - onRightClick, - isRightActive, - className, -}) => { - const help = useHelp(); - - return ( -
- - -
-
- {!isLeftActive && ( - - )} -
- -
- -
- -
- - {!isRightActive && ( - - )} -
-
-
- ); -}; diff --git a/src/features/editor/features/base/components/footer/index.tsx b/src/features/editor/features/base/components/footer/index.tsx index 74f3b39..bf61faa 100644 --- a/src/features/editor/features/base/components/footer/index.tsx +++ b/src/features/editor/features/base/components/footer/index.tsx @@ -1,6 +1,5 @@ import React from 'react'; -import { DesktopFooter } from './desktop-footer'; import { MobileFooter } from './mobile-footer'; import type { FooterProps } from './types'; @@ -10,7 +9,6 @@ export const Footer: React.FC = ({ ...footerProps }) => { return ( <> - ); }; diff --git a/src/features/editor/features/base/index.tsx b/src/features/editor/features/base/index.tsx index ad57cb8..b19d486 100644 --- a/src/features/editor/features/base/index.tsx +++ b/src/features/editor/features/base/index.tsx @@ -1,6 +1,13 @@ +import { + PinBottomIcon, + PinLeftIcon, + PinRightIcon, + PinTopIcon, +} from '@radix-ui/react-icons'; import { lazy, Suspense } from 'react'; import { Loading } from '@/components/loading'; +import { Button } from '@/components/ui/button'; import { ResizableHandle, ResizablePanel, @@ -16,6 +23,7 @@ import { Footer } from './components/footer'; const Output = lazy(() => import('../../components/output')); const CodemirrorEditor = lazy(() => import('../../components/editor')); +// eslint-disable-next-line max-lines-per-function const BaseEditor = () => { const { layout_direction } = useSettingsStore(); const { @@ -38,6 +46,20 @@ const BaseEditor = () => { autoSaveId="persistence" direction={layout_direction} > + {!isVisiblePanelLeft && ( + + )} { + {!isVisiblePanelRight && ( + + )}