From 81c85113164908326f91a6ff2d3100a7b6ee1323 Mon Sep 17 00:00:00 2001 From: Prathamesh Gursal Date: Tue, 8 Oct 2024 01:20:34 +0530 Subject: [PATCH] added single loader with window responsiveness --- frontend/src/Navigation.tsx | 51 ++++++++++++++-------- frontend/src/components/SourceDropdown.tsx | 9 ++-- frontend/src/upload/Upload.tsx | 4 +- 3 files changed, 41 insertions(+), 23 deletions(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 0d99fd75..3a55525a 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -209,24 +209,29 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { menu toggle )}
-
{ - if (isMobile) { - setNavOpen(!navOpen); - } - }}> +
{ + if (isMobile) { + setNavOpen(!navOpen); + } + }} + >

DocsGPT

@@ -241,8 +246,9 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { menu toggle
@@ -255,7 +261,8 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { 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` } > @@ -280,7 +287,11 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { key={conversation.id} conversation={conversation} selectConversation={(id) => handleConversationClick(id)} - onCoversationClick={() => {if (isMobile) { setNavOpen(false) }}} + onCoversationClick={() => { + if (isMobile) { + setNavOpen(false); + } + }} onDeleteConversation={(id) => handleDeleteConversation(id)} onSave={(conversation) => updateConversationName(conversation) @@ -306,7 +317,7 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { handleDeleteClick={handleDeleteClick} handlePostDocumentSelect={(option?: string) => { if (isMobile) { - setNavOpen(!navOpen) + setNavOpen(!navOpen); } }} /> @@ -314,12 +325,12 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { className="mt-2 h-9 w-9 hover:cursor-pointer" src={UploadIcon} onClick={() => { - setUploadModalState('ACTIVE') + setUploadModalState('ACTIVE'); if (isMobile) { setNavOpen(!navOpen); } - } - }> + }} + >

{t('sourceDocs')}

@@ -333,7 +344,8 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { }} 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' : '' }` } > @@ -357,7 +369,8 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { }} 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]' : '' }` } > diff --git a/frontend/src/components/SourceDropdown.tsx b/frontend/src/components/SourceDropdown.tsx index 6a348161..f92173a0 100644 --- a/frontend/src/components/SourceDropdown.tsx +++ b/frontend/src/components/SourceDropdown.tsx @@ -121,9 +121,12 @@ function SourceDropdown({ className="flex cursor-pointer items-center justify-between hover:bg-gray-100 dark:text-bright-gray dark:hover:bg-purple-taupe" onClick={handleEmptyDocumentSelect} > - { - handlePostDocumentSelect(null); - }}> + { + handlePostDocumentSelect(null); + }} + > {t('none')}
diff --git a/frontend/src/upload/Upload.tsx b/frontend/src/upload/Upload.tsx index c09bab53..9012059b 100644 --- a/frontend/src/upload/Upload.tsx +++ b/frontend/src/upload/Upload.tsx @@ -275,7 +275,9 @@ function Upload({ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': ['.docx'], 'text/csv': ['.csv'], - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': ['.xlsx'], + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': [ + '.xlsx', + ], }, });