From 63dc4021cebd8aecdde79beb0a8d0de8c3eb3585 Mon Sep 17 00:00:00 2001 From: samlhuillier Date: Sat, 2 Nov 2024 22:36:20 +0000 Subject: [PATCH] somewhat working close &reopen --- src/components/MainPage.tsx | 50 +++++++++++++------------------------ 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/src/components/MainPage.tsx b/src/components/MainPage.tsx index ea16e6ee..a33ecb48 100644 --- a/src/components/MainPage.tsx +++ b/src/components/MainPage.tsx @@ -43,7 +43,7 @@ const MainContent: React.FC = () => { return (
- {currentlyOpenFilePath && showEditor ? ( + {currentlyOpenFilePath && showEditor && (
setShowEditor(false)} @@ -53,9 +53,6 @@ const MainContent: React.FC = () => { />
- ) : ( - // - <> )}
@@ -66,7 +63,7 @@ const MainPageContent: React.FC = () => { const [showSimilarFiles, setShowSimilarFiles] = useState(false) const { currentlyOpenFilePath } = useFileContext() const { showChatbot, setShowChatbot } = useChatContext() - const { setShowEditor } = useContentContext() + const { setShowEditor, showEditor } = useContentContext() const { getShortcutDescription } = useAppShortcuts() return ( @@ -88,40 +85,27 @@ const MainPageContent: React.FC = () => {
- {currentlyOpenFilePath ? ( - <> - {showChatbot ? ( - + {currentlyOpenFilePath || showChatbot ? ( + + {currentlyOpenFilePath && showEditor && ( + <> - -
- { - setShowChatbot(false) - }} - onMaximize={() => { - setShowEditor(false) - }} - /> - -
-
-
- ) : ( - + + )} + {showChatbot && ( + +
+ setShowChatbot(false)} onMaximize={() => setShowEditor(false)} /> + +
+
)} - - ) : showChatbot ? ( -
- -
+
) : ( -
- -
+ )}