diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 29f2bd2b..4802ab82 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -4,17 +4,24 @@ import Conversation from './conversation/Conversation'; import About from './About'; import { inject } from '@vercel/analytics'; import { useMediaQuery } from './hooks'; +import { useState } from 'react'; inject(); export default function App() { const { isMobile } = useMediaQuery(); + const [navOpen, setNavOpen] = useState(!isMobile); + return (
- +
diff --git a/frontend/src/Navigation.tsx b/frontend/src/Navigation.tsx index cb5d0218..260639b6 100644 --- a/frontend/src/Navigation.tsx +++ b/frontend/src/Navigation.tsx @@ -8,6 +8,8 @@ import Hamburger from './assets/hamburger.svg'; import Key from './assets/key.svg'; import Info from './assets/info.svg'; import Link from './assets/link.svg'; +import Discord from './assets/discord.svg'; +import Github from './assets/github.svg'; import UploadIcon from './assets/upload.svg'; import { ActiveState } from './models/misc'; import APIKeyModal from './preferences/APIKeyModal'; @@ -31,14 +33,18 @@ import Upload from './upload/Upload'; import { Doc, getConversations } from './preferences/preferenceApi'; import SelectDocsModal from './preferences/SelectDocsModal'; -export default function Navigation() { +interface NavigationProps { + navOpen: boolean; + setNavOpen: React.Dispatch>; +} + +export default function Navigation({ navOpen, setNavOpen }: NavigationProps) { const dispatch = useDispatch(); const docs = useSelector(selectSourceDocs); const selectedDocs = useSelector(selectSelectedDocs); const conversations = useSelector(selectConversations); const conversationId = useSelector(selectConversationId); const { isMobile } = useMediaQuery(); - const [navOpen, setNavOpen] = useState(!isMobile); const [isDocsListOpen, setIsDocsListOpen] = useState(false); @@ -142,15 +148,31 @@ export default function Navigation() { return ( <> + {!navOpen && ( + + )}
-
+
{ setApiKeyModalState('ACTIVE'); }} @@ -305,7 +327,7 @@ export default function Navigation() { - `my-auto mx-4 flex h-12 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 ${ + `my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100 ${ isActive ? 'bg-gray-3000' : '' }` } @@ -318,7 +340,7 @@ export default function Navigation() { href="https://docs.docsgpt.co.uk/" target="_blank" rel="noreferrer" - className="my-auto mx-4 flex h-12 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100" + className="my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100" > link

Documentation

@@ -328,9 +350,9 @@ export default function Navigation() { href="https://discord.gg/WHJdfbQDR4" target="_blank" rel="noreferrer" - className="my-auto mx-4 flex h-12 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100" + className="my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100" > - link + link

Discord

@@ -338,9 +360,9 @@ export default function Navigation() { href="https://github.com/arc53/DocsGPT" target="_blank" rel="noreferrer" - className="my-auto mx-4 flex h-12 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100" + className="my-auto mx-4 flex h-9 cursor-pointer gap-4 rounded-3xl hover:bg-gray-100" > - link + link

Github

diff --git a/frontend/src/assets/discord.svg b/frontend/src/assets/discord.svg new file mode 100644 index 00000000..ca54be77 --- /dev/null +++ b/frontend/src/assets/discord.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/assets/github.svg b/frontend/src/assets/github.svg new file mode 100644 index 00000000..15e93c43 --- /dev/null +++ b/frontend/src/assets/github.svg @@ -0,0 +1,5 @@ + + github + + + \ No newline at end of file