Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidebar Updated. #45

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@
--chart-4: 43 74% 66%;
--chart-5: 27 87% 67%;
--radius: 0.5rem;
--sidebar-background: 0 0% 98%;
--sidebar-foreground: 240 5.3% 26.1%;
--sidebar-primary: 240 5.9% 10%;
--sidebar-primary-foreground: 0 0% 98%;
--sidebar-accent: 240 4.8% 95.9%;
--sidebar-accent-foreground: 240 5.9% 10%;
--sidebar-border: 220 13% 91%;
--sidebar-ring: 217.2 91.2% 59.8%;
}
.dark {
--background: 0 0% 3.9%;
Expand All @@ -60,6 +68,14 @@
--chart-3: 30 80% 55%;
--chart-4: 280 65% 60%;
--chart-5: 340 75% 55%;
--sidebar-background: 240 5.9% 10%;
--sidebar-foreground: 240 4.8% 95.9%;
--sidebar-primary: 224.3 76.3% 48%;
--sidebar-primary-foreground: 0 0% 100%;
--sidebar-accent: 240 3.7% 15.9%;
--sidebar-accent-foreground: 240 4.8% 95.9%;
--sidebar-border: 240 3.7% 15.9%;
--sidebar-ring: 217.2 91.2% 59.8%;
}
}

Expand Down
19 changes: 14 additions & 5 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
import "./globals.css";
import SessionWrapper from "@/components/providers/SessionWrapper";

import "./globals.css";
import { ThemeProvider } from "@/components/providers/ThemeProvider";
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<SessionWrapper>
<html lang="en">
<body className="font-general">{children}</body>
</html>
<html lang="en">
<body className="font-general">
<ThemeProvider
attribute="class"
defaultTheme="light"
enableSystem={false}
storageKey="dashboard-theme"
>
{children}
</ThemeProvider>
</body>
</html>
</SessionWrapper>
);
}
11 changes: 11 additions & 0 deletions components/providers/ThemeProvider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"use client";

import * as React from "react";
import { ThemeProvider as NextThemesProvider } from "next-themes";

export function ThemeProvider({
children,
...props
}: React.ComponentProps<typeof NextThemesProvider>) {
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
}
8 changes: 4 additions & 4 deletions components/shared/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import NavMenu from "./NavMenu";
import UserActions from "./UserActions";
import Dropdown from './Dropdown';
import Dropdown from "./Dropdown";

const Header = () => {
return (
Expand All @@ -9,7 +9,7 @@ const Header = () => {
<NavMenu />
<UserActions />
</header>
)
}
);
};

export default Header;
export default Header;
141 changes: 83 additions & 58 deletions components/shared/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,71 +1,96 @@
"use client";
import { Command, CommandGroup, CommandItem } from "@/components/ui/command";
import { FaVectorSquare } from "react-icons/fa6";
import React from "react";
import { useTheme } from "next-themes";
import {
Command,
CommandGroup,
CommandItem,
CommandInput,
CommandList,
CommandEmpty,
CommandSeparator,
} from "@/components/ui/command";
import { LuUser, LuMessagesSquare, LuMic2, LuLibrary } from "react-icons/lu";
import { RxLinkNone2 } from "react-icons/rx";
import { CiSettings } from "react-icons/ci";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { MdLightMode, MdDarkMode } from "react-icons/md";
import Link from "next/link";
import { LayoutDashboardIcon as LuLayoutDashboard } from "lucide-react";

const Sidebar = () => {
const { setTheme, theme } = useTheme();

return (
<Command className=" rounded-none">
<CommandGroup>
<CommandItem className="bg-secondary font-bold size-fit">
<FaVectorSquare className="mr-2 h-4 w-4" />
<Link href="#" className="font-bold">
Dashboard
</Link>
</CommandItem>
<CommandItem>
<LuUser className="mr-2 h-4 w-4" />
<Link href="#">Mentors</Link>
</CommandItem>
<CommandItem>
{" "}
<LuMessagesSquare className="mr-2 h-4 w-4" />
<Link href="#">Meesages</Link>
</CommandItem>
<CommandItem>
{" "}
<RxLinkNone2 className="mr-2 h-4 w-4" />
<Link href="#">Channels</Link>
</CommandItem>
<CommandItem>
{" "}
<LuMic2 className="mr-2 h-4 w-4" />
<Link href="#">Admins</Link>
</CommandItem>
<CommandItem>
{" "}
<LuLibrary className="mr-2 h-4 w-4" />
<Link href="#">Agents</Link>
</CommandItem>
</CommandGroup>
<div className="flex flex-col h-full">
<Command className="flex-1 overflow-y-auto rounded-none">
<CommandList>
<CommandGroup>
<CommandItem className="px-3 py-2 bg-gray-400 text-white rounded-lg m-5 font-bold">
<div className="flex items-center space-x-2 px-2 py-3">
<LuLayoutDashboard className="mr-2 h-4 w-4" />
<span className="text-xl font-semibold">Dashboard</span>
</div>
</CommandItem>
<div className="space-y-3 py-3 px-3">
<CommandItem>
<LuUser className="mr-2 h-4 w-4" />
<Link href="#">Mentors</Link>
</CommandItem>
<CommandItem>
<LuMessagesSquare className="mr-2 h-4 w-4" />
<Link href="#">Messages</Link>
</CommandItem>
<CommandItem>
<RxLinkNone2 className="mr-2 h-4 w-4" />
<Link href="#">Channels</Link>
</CommandItem>
<CommandItem>
<LuMic2 className="mr-2 h-4 w-4" />
<Link href="#">Admins</Link>
</CommandItem>
<CommandItem>
<LuLibrary className="mr-2 h-4 w-4" />
<Link href="#">Agents</Link>
</CommandItem>
</div>
</CommandGroup>
</CommandList>
</Command>

<CommandGroup className="mt-72">
<CommandItem>
<LuMic2 className="mr-2 h-4 w-4" />
<Link href="#">Help and Support.</Link>
</CommandItem>
<CommandItem>
<CiSettings className="mr-2 h-4 w-4" />
<Link href="#">Settings</Link>
</CommandItem>
<CommandItem className="mt-5">
<div className="bg-secondary rounded-lg">
<ToggleGroup type="single">
<ToggleGroupItem className="rounded-lg" value="a">
<MdLightMode className="mr-2 h-4 w-4" /> Light
</ToggleGroupItem>
<ToggleGroupItem className="rounded-lg" value="b">
<MdDarkMode className="mr-2 h-4 w-4" /> Dark
</ToggleGroupItem>
</ToggleGroup>
</div>
</CommandItem>
</CommandGroup>
</Command>
<div className="bg-white dark:bg-black p-4">
<Command>
<CommandList>
<CommandGroup>
<CommandItem>
<LuMic2 className="mr-2 h-4 w-4" />
<Link href="#">Help and Support</Link>
</CommandItem>
<CommandItem>
<CiSettings className="mr-2 h-4 w-4" />
<Link href="#">Settings</Link>
</CommandItem>
<CommandItem className="mt-5">
<div className="bg-secondary rounded-lg">
<ToggleGroup
type="single"
value={theme}
onValueChange={(value) => setTheme(value)}
>
<ToggleGroupItem value="light" className="rounded-lg">
<MdLightMode className="mr-2 h-4 w-4" /> Light
</ToggleGroupItem>
<ToggleGroupItem value="dark" className="rounded-lg">
<MdDarkMode className="mr-2 h-4 w-4" /> Dark
</ToggleGroupItem>
</ToggleGroup>
</div>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
</div>
</div>
);
};

Expand Down
Loading