diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index e40729a6e..0d99fd754 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -209,22 +209,24 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { menu toggle )}
-
+
{ + if (isMobile) { + setNavOpen(!navOpen); + } + }}>

DocsGPT

@@ -239,18 +241,21 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { menu toggle
{ + if (isMobile) { + setNavOpen(!navOpen); + } + resetConversation(); + }} className={({ isActive }) => - `${ - isActive ? 'bg-gray-3000 dark:bg-transparent' : '' + `${isActive ? 'bg-gray-3000 dark:bg-transparent' : '' } group sticky mx-4 mt-4 flex cursor-pointer gap-2.5 rounded-3xl border border-silver p-3 hover:border-rainy-gray hover:bg-gray-3000 dark:border-purple-taupe dark:text-white dark:hover:bg-transparent` } > @@ -275,6 +280,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { key={conversation.id} conversation={conversation} selectConversation={(id) => handleConversationClick(id)} + onCoversationClick={() => {if (isMobile) { setNavOpen(false) }}} onDeleteConversation={(id) => handleDeleteConversation(id)} onSave={(conversation) => updateConversationName(conversation) @@ -298,24 +304,38 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { isDocsListOpen={isDocsListOpen} setIsDocsListOpen={setIsDocsListOpen} handleDeleteClick={handleDeleteClick} + handlePostDocumentSelect={(option?: string) => { + if (isMobile) { + setNavOpen(!navOpen) + } + }} /> setUploadModalState('ACTIVE')} - > + onClick={() => { + setUploadModalState('ACTIVE') + if (isMobile) { + setNavOpen(!navOpen); + } + } + }>

{t('sourceDocs')}

{ + if (isMobile) { + setNavOpen(!navOpen); + } + resetConversation(); + }} to="/settings" className={({ isActive }) => - `my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-[#28292E] ${ - isActive ? 'bg-gray-3000 dark:bg-transparent' : '' + `my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-[#28292E] ${isActive ? 'bg-gray-3000 dark:bg-transparent' : '' }` } - onClick={resetConversation} >
{ + if (isMobile) { + setNavOpen(!navOpen); + } + resetConversation(); + }} to="/about" className={({ isActive }) => - `my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-[#28292E] ${ - isActive ? 'bg-gray-3000 dark:bg-[#28292E]' : '' + `my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 dark:hover:bg-[#28292E] ${isActive ? 'bg-gray-3000 dark:bg-[#28292E]' : '' }` } - onClick={resetConversation} > >; handleDeleteClick: any; + handlePostDocumentSelect: any; }; function SourceDropdown({ @@ -20,6 +21,7 @@ function SourceDropdown({ setIsDocsListOpen, isDocsListOpen, handleDeleteClick, + handlePostDocumentSelect, // Callback function fired after a document is selected }: Props) { const dispatch = useDispatch(); const { t } = useTranslation(); @@ -85,6 +87,7 @@ function SourceDropdown({ onClick={() => { dispatch(setSelectedDocs(option)); setIsDocsListOpen(false); + handlePostDocumentSelect(option); }} > - + { + handlePostDocumentSelect(null); + }}> {t('none')}
diff --git a/frontend/src/conversation/ConversationTile.tsx b/frontend/src/conversation/ConversationTile.tsx index 3a0b85e4f..5db4ceab7 100644 --- a/frontend/src/conversation/ConversationTile.tsx +++ b/frontend/src/conversation/ConversationTile.tsx @@ -22,6 +22,7 @@ interface ConversationProps { interface ConversationTileProps { conversation: ConversationProps; selectConversation: (arg1: string) => void; + onCoversationClick: () => void; //Callback to handle click on conversation tile regardless of selected or not onDeleteConversation: (arg1: string) => void; onSave: ({ name, id }: ConversationProps) => void; } @@ -29,6 +30,7 @@ interface ConversationTileProps { export default function ConversationTile({ conversation, selectConversation, + onCoversationClick, onDeleteConversation, onSave, }: ConversationTileProps) { @@ -90,6 +92,7 @@ export default function ConversationTile({ setIsHovered(false); }} onClick={() => { + onCoversationClick(); conversationId !== conversation.id && selectConversation(conversation.id); }}