diff --git a/.vscode/settings.json b/.vscode/settings.json index d067910..bd3337f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,4 @@ { - "typescript.tsdk": "node_modules/typescript/lib", + "typescript.tsdk": "node_modules\\typescript\\lib", "typescript.enablePromptUseWorkspaceTsdk": true } \ No newline at end of file diff --git a/app/dashboard/SideNavbar.tsx b/app/dashboard/SideNavbar.tsx new file mode 100644 index 0000000..f29ec96 --- /dev/null +++ b/app/dashboard/SideNavbar.tsx @@ -0,0 +1,99 @@ +"use client"; +import React from "react"; + +import Image from "next/image"; +import Link from "next/link"; +import useTweetStore from "../store/tweetStore"; +import { AiOutlineSearch } from "react-icons/ai"; +import { BsPeopleFill } from "react-icons/bs"; +import DonutLargeIcon from "@mui/icons-material/DonutLarge"; +import { usePathname } from "next/navigation"; + +import { Disclosure } from "@headlessui/react"; +import { GiHamburgerMenu } from "react-icons/gi"; + +const links = [ + { + name: "Progress", + url: "/dashboard", + icon: , + }, + { + name: "Search", + url: "/search", + icon: , + }, + { + name: "Discover", + url: "/discover", + icon: , + }, +]; + +const activeLink = + "flex items-center gap-3 text-ourPink bg-[#343434] rounded-lg cursor-pointer py-4 px-4 text-lg transition-all duration-300 ease-in-out"; +const normalLink = + "flex items-center gap-3 text-ourPink hover:bg-[#343434] rounded-lg cursor-pointer py-4 px-4 text-lg transition-all duration-300 ease-in-out"; +const SideNavbar = () => { + const pathname = usePathname(); + const { userProfile, count } = useTweetStore((state) => ({ + userProfile: state.userProfile, + count: state.count, + })); + return ( +
+ + + +
+
+
+
+ {`${userProfile.name}'s + + {count} + +
+
+

+ {userProfile.name} +

+

+ @{userProfile.username} +

+
+
+
+ {links.map((link) => ( + +
+ {link.icon} +

{link.name}

+
+ + ))} +
+
+
+
+
+ ); +}; + +export default SideNavbar; diff --git a/app/dashboard/page.tsx b/app/dashboard/page.tsx index 7fb4311..ad3a326 100644 --- a/app/dashboard/page.tsx +++ b/app/dashboard/page.tsx @@ -1,5 +1,5 @@ "use client"; - +import { useState } from "react"; import Badges from "./Badges"; import Card from "./Card"; import Sidebar from "./Sidebar"; @@ -9,6 +9,7 @@ import Streak from "./Streak"; import Loading from "../components/Loading"; import Navbar from "../components/Navbar"; import { Poppins } from "@next/font/google"; +import SideNavbar from "./SideNavbar"; const poppins = Poppins({ subsets: ["latin"], @@ -16,7 +17,7 @@ const poppins = Poppins({ variable: "--font-Poppins", }); -const dashboardPage = () => { +const DashboardPage = () => { const { tweets, dates, username, loading } = useTweetStore((state) => ({ tweets: state.tweets, dates: state.dates, @@ -24,12 +25,50 @@ const dashboardPage = () => { loading: state.loading, })); + const [navbar, setNavbar] = useState(false); return (
+ {/*
+ +
*/}
- -
+ + +

@@ -70,4 +109,4 @@ const dashboardPage = () => { ); }; -export default dashboardPage; +export default DashboardPage; diff --git a/package-lock.json b/package-lock.json index 5c1f7a8..8a8672f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", + "@headlessui/react": "^1.7.12", "@mui/icons-material": "^5.11.0", "@mui/material": "^5.11.6", "@next/font": "^13.1.3", @@ -590,6 +591,21 @@ "@floating-ui/core": "^1.1.0" } }, + "node_modules/@headlessui/react": { + "version": "1.7.12", + "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-1.7.12.tgz", + "integrity": "sha512-FhSx5V+Qp0GvbTpaxyS+ymGDDNntCacClWsk/d8Upbr19g3AsPbjfPk4+m2CgJGcuCB5Dz7LpUIOAbvQTyjL2g==", + "dependencies": { + "client-only": "^0.0.1" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "react": "^16 || ^17 || ^18", + "react-dom": "^16 || ^17 || ^18" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.8", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", diff --git a/package.json b/package.json index 67ac881..73e617b 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "dependencies": { "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", + "@headlessui/react": "^1.7.12", "@mui/icons-material": "^5.11.0", "@mui/material": "^5.11.6", "@next/font": "^13.1.3",