From c01f96263182d55fa627afffc86c99e4b7e2b240 Mon Sep 17 00:00:00 2001 From: David <33458145+davidmcpowell@users.noreply.github.com> Date: Wed, 26 Feb 2025 10:26:21 +0000 Subject: [PATCH] Merge pull request #23772 from overleaf/dp-binary-files Show binary and non-tex files in new editor GitOrigin-RevId: b6d2681e6ecc868fac0ca484570e33220ec74980 --- .../ide-redesign/components/editor-panel.tsx | 23 +++++++++++++++++++ .../ide-redesign/components/main-layout.tsx | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 services/web/frontend/js/features/ide-redesign/components/editor-panel.tsx diff --git a/services/web/frontend/js/features/ide-redesign/components/editor-panel.tsx b/services/web/frontend/js/features/ide-redesign/components/editor-panel.tsx new file mode 100644 index 0000000000..18fcad1395 --- /dev/null +++ b/services/web/frontend/js/features/ide-redesign/components/editor-panel.tsx @@ -0,0 +1,23 @@ +import NoSelectionPane from '@/features/ide-react/components/editor/no-selection-pane' +import { Editor } from './editor' +import { useFileTreeOpenContext } from '@/features/ide-react/context/file-tree-open-context' +import FileView from '@/features/file-view/components/file-view' +import { fileViewFile } from '@/features/ide-react/util/file-view' +import MultipleSelectionPane from '@/features/ide-react/components/editor/multiple-selection-pane' + +export default function EditorPanel() { + const { selectedEntityCount, openEntity } = useFileTreeOpenContext() + + return ( +
+ {selectedEntityCount === 0 && } + {selectedEntityCount === 1 && openEntity?.type === 'fileRef' && ( + + )} + {selectedEntityCount > 1 && ( + + )} + +
+ ) +} diff --git a/services/web/frontend/js/features/ide-redesign/components/main-layout.tsx b/services/web/frontend/js/features/ide-redesign/components/main-layout.tsx index 9d847ee95e..86021fbb32 100644 --- a/services/web/frontend/js/features/ide-redesign/components/main-layout.tsx +++ b/services/web/frontend/js/features/ide-redesign/components/main-layout.tsx @@ -2,7 +2,6 @@ import { Panel, PanelGroup } from 'react-resizable-panels' import classNames from 'classnames' import { HorizontalResizeHandle } from '@/features/ide-react/components/resize/horizontal-resize-handle' import PdfPreview from '@/features/pdf-preview/components/pdf-preview' -import { Editor } from './editor' import { RailLayout } from './rail' import { Toolbar } from './toolbar/toolbar' import { HorizontalToggler } from '@/features/ide-react/components/resize/horizontal-toggler' @@ -10,6 +9,7 @@ import { useTranslation } from 'react-i18next' import { usePdfPane } from '@/features/ide-react/hooks/use-pdf-pane' import { useLayoutContext } from '@/shared/context/layout-context' import { useState } from 'react' +import EditorPanel from './editor-panel' export default function MainLayout() { const [resizing, setResizing] = useState(false) @@ -51,7 +51,7 @@ export default function MainLayout() { defaultSize={50} >
- +