From e7b9f5e4c346eef5968bf25e042cc2713d592314 Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Fri, 5 Jan 2024 01:50:52 +0530 Subject: [PATCH] adding responsive sidebar --- frontend/src/Navigation.tsx | 331 ++++++++++++++++++------------------ 1 file changed, 165 insertions(+), 166 deletions(-) diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index 1ba78ee08..eba75ebf5 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -181,20 +181,18 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { menu toggle )}
@@ -209,180 +207,181 @@ export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { menu toggle
-
- { - dispatch(setConversation([])); - dispatch( - updateConversationId({ - query: { conversationId: null }, - }), - ); - }} - className={({ isActive }) => - `${ - isActive ? 'bg-gray-3000' : '' - } group 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` - } - > - new -

- New Chat -

-
+ { + dispatch(setConversation([])); + dispatch( + updateConversationId({ + query: { conversationId: null }, + }), + ); + }} + className={({ isActive }) => + `${isActive ? 'bg-gray-3000' : '' + } group mx-4 mt-4 sticky flex cursor-pointer gap-2.5 rounded-3xl border border-silver p-3 hover:border-rainy-gray hover:bg-gray-3000` + } + > + new +

+ New Chat +

+
+
+ {conversations && ( -
+

Chats

- {conversations?.map((conversation) => ( - handleConversationClick(id)} - onDeleteConversation={(id) => handleDeleteConversation(id)} - onSave={(conversation) => - updateConversationName(conversation) - } - /> - ))} +
+ + {conversations?.map((conversation) => ( + handleConversationClick(id)} + onDeleteConversation={(id) => handleDeleteConversation(id)} + onSave={(conversation) => + updateConversationName(conversation) + } + /> + ))} +
)}
-
-
-
setIsDocsListOpen(!isDocsListOpen)} - > - {selectedDocs && ( -

- {selectedDocs.name} {selectedDocs.version} -

- )} - arrow -
- setUploadModalState('ACTIVE')} - > - {isDocsListOpen && ( -
- {docs ? ( - docs.map((doc, index) => { - if (doc.model === embeddingsName) { - return ( -
{ - dispatch(setSelectedDocs(doc)); - setIsDocsListOpen(false); - }} - className="flex h-10 w-full cursor-pointer items-center justify-between border-x-2 border-b-2 hover:bg-gray-100" - > -

- {doc.name} {doc.version} -

- {doc.location === 'local' && ( - Delete { - event.stopPropagation(); - handleDeleteClick(index, doc); - }} - /> - )} -
- ); - } - }) - ) : ( -
-

No default documentation.

-
+
+
+
+
setIsDocsListOpen(!isDocsListOpen)} + > + {selectedDocs && ( +

+ {selectedDocs.name} {selectedDocs.version} +

)} + arrow
- )} + setUploadModalState('ACTIVE')} + > + {isDocsListOpen && ( +
+ {docs ? ( + docs.map((doc, index) => { + if (doc.model === embeddingsName) { + return ( +
{ + dispatch(setSelectedDocs(doc)); + setIsDocsListOpen(false); + }} + className="flex h-10 w-full cursor-pointer items-center justify-between border-x-2 border-b-2 hover:bg-gray-100" + > +

+ {doc.name} {doc.version} +

+ {doc.location === 'local' && ( + Delete { + event.stopPropagation(); + handleDeleteClick(index, doc); + }} + /> + )} +
+ ); + } + }) + ) : ( +
+

No default documentation.

+
+ )} +
+ )} +
+

Source Docs

+
+
+ + `my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 ${isActive ? 'bg-gray-3000' : '' + }` + } + > + settings +

Settings

+
-

Source Docs

-
-
- - `my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 ${ - isActive ? 'bg-gray-3000' : '' - }` - } - > - settings -

Settings

-
-
-
- - `my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 ${ - isActive ? 'bg-gray-3000' : '' - }` - } - > - info -

About

-
+
+ + `my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 ${isActive ? 'bg-gray-3000' : '' + }` + } + > + info +

About

+
- - documentation -

Documentation

-
- - discord-link -

- Visit our Discord -

-
+ + documentation +

Documentation

+
+ + discord-link +

+ Visit our Discord +

+
- - github-link -

Visit our Github

-
+ + github-link +

Visit our Github

+
+