diff --git a/client/src/App.css b/client/src/App.css index 8d61459..6704519 100644 --- a/client/src/App.css +++ b/client/src/App.css @@ -34,12 +34,13 @@ header h1 { nav { display: none; background-color: #4c4f5f; - position: absolute; + position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 999; + height: 100vh; } .navItems { padding: 8px; diff --git a/client/src/components/NavContent.jsx b/client/src/components/NavContent.jsx new file mode 100644 index 0000000..5158f21 --- /dev/null +++ b/client/src/components/NavContent.jsx @@ -0,0 +1,23 @@ +import React from "react"; +import NavLinksContainer from "./NavLinksContainer"; +import NavPrompt from "./NavPrompt"; +import NewChat from "./NewChat"; + +const NavContent = ({ chatLog, setChatLog, setShowMenu }) => { + return ( + <> + +
+ {chatLog.map( + (chat, idx) => + chat.botMessage && ( + + ) + )} +
+ + + ); +}; + +export default NavContent; diff --git a/client/src/components/NavLinksContainer.jsx b/client/src/components/NavLinksContainer.jsx new file mode 100644 index 0000000..2addbe2 --- /dev/null +++ b/client/src/components/NavLinksContainer.jsx @@ -0,0 +1,124 @@ +import React from "react"; +import NavLinks from "./NavLink"; + +const NavLinksContainer = ({ chatLog, setChatLog }) => { + return ( +
+ {chatLog.length > 0 && ( + + + + + + } + text="Clear Conversations" + setChatLog={setChatLog} + /> + )} + + {"discord_fill"} + + + + + + } + text="OpenAI Discord" + link="https://discord.com/invite/openai" + /> + + + + } + text="Updates & FAQ" + link="https://help.openai.com/en/collections/3742473-chatgpt" + /> + + + + } + text="Log out" + link="" + /> +
+ ); +}; + +export default NavLinksContainer; diff --git a/client/src/pages/Home.jsx b/client/src/pages/Home.jsx index c666ddc..1a73599 100644 --- a/client/src/pages/Home.jsx +++ b/client/src/pages/Home.jsx @@ -4,9 +4,7 @@ import BotResponse from "../components/BotResponse"; import Error from "../components/Error"; import IntroSection from "../components/IntroSection"; import Loading from "../components/Loading"; -import NavLinks from "../components/NavLink"; -import NavPrompt from "../components/NavPrompt"; -import NewChat from "../components/NewChat"; +import NavContent from "../components/NavContent"; import SvgComponent from "../components/SvgComponent"; const Home = () => { @@ -95,17 +93,11 @@ const Home = () => { {showMenu && (