diff --git a/app/layout.tsx b/app/layout.tsx
index 7c86922..6ac5d08 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -1,7 +1,5 @@
import type { Metadata } from "next";
-import { ThemeProvider } from "next-themes";
import { Geist, Geist_Mono } from "next/font/google";
-import { ThemeToggle } from "../components/ThemeToggle";
import "./globals.css";
const geistSans = Geist({
@@ -26,9 +24,7 @@ export default function RootLayout({
}>) {
return (
-
- {children}
-
+ {children}
);
}
diff --git a/components/Header.tsx b/components/Header.tsx
index 81ffaf4..a348fed 100644
--- a/components/Header.tsx
+++ b/components/Header.tsx
@@ -8,10 +8,10 @@ const Header = () => {
-
+
@@ -19,4 +19,4 @@ const Header = () => {
);
};
-export default Header;
\ No newline at end of file
+export default Header;
diff --git a/components/NavItems.tsx b/components/NavItems.tsx
deleted file mode 100644
index 14b8461..0000000
--- a/components/NavItems.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-"use client";
-
-import { NAV_ITEMS } from "@/lib/constans";
-import Link from "next/link";
-import { usePathname } from "next/navigation";
-
-const NavItems = () => {
- const pathname = usePathname();
- const isActive = (path: string) => {
- if(path === '/') return pathname === '/';
-
- return pathname.startsWith(path);
- }
- return (
-
- {NAV_ITEMS.map(({ label, href }) => {
- const active = isActive(href);
-
- return (
- -
-
- {label}
-
-
- );
- })}
-
- );
-};
-
-export default NavItems;
\ No newline at end of file
diff --git a/components/NavItems/NavItem.tsx b/components/NavItems/NavItem.tsx
new file mode 100644
index 0000000..a597494
--- /dev/null
+++ b/components/NavItems/NavItem.tsx
@@ -0,0 +1,33 @@
+"use client";
+
+import Link from "next/link";
+import { usePathname } from "next/navigation";
+
+type NavItemProps = {
+ item: {
+ label: string;
+ href: string;
+ };
+};
+
+export const NavItem: React.FC = ({ item: { label, href } }) => {
+ const pathname = usePathname();
+
+ const isActive = (path: string) => {
+ if (path === "/") return pathname === "/";
+ return pathname.startsWith(path);
+ };
+
+ const active = isActive(href);
+
+ return (
+
+
+ {label}
+
+
+ );
+};
diff --git a/components/NavItems/index.tsx b/components/NavItems/index.tsx
new file mode 100644
index 0000000..824eac2
--- /dev/null
+++ b/components/NavItems/index.tsx
@@ -0,0 +1,16 @@
+"use client";
+
+import { NAV_ITEMS } from "@/lib/constans";
+import { NavItem } from "./NavItem";
+
+const NavItems = () => {
+ return (
+
+ {NAV_ITEMS.map((item) => (
+
+ ))}
+
+ );
+};
+
+export default NavItems;
diff --git a/components/UserDropdown.tsx b/components/UserDropdown.tsx
index 3e681ce..f4b9765 100644
--- a/components/UserDropdown.tsx
+++ b/components/UserDropdown.tsx
@@ -1,6 +1,6 @@
"use client";
-import { Button } from "@/components/ui/button"
+import { Button } from "@/components/ui/button";
import {
DropdownMenu,
DropdownMenuContent,
@@ -9,63 +9,64 @@ import {
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu"
-import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
-import { useRouter } from "next/navigation"
+} from "@/components/ui/dropdown-menu";
+import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
+import { useRouter } from "next/navigation";
import { LogOut } from "lucide-react";
import NavItems from "./NavItems";
const UserDropdown = () => {
- const router = useRouter();
+ const router = useRouter();
- const handleSignOut = async() => {
- router.push('/sign-in');
- }
+ const handleSignOut = async () => {
+ router.push("/sign-in");
+ };
- const user = { name: 'Ivan', email: 'ivan@cgr.js' };
+ const user = { name: "Ivan", email: "ivan@cgr.js" };
- return (
-
-
-
-
-
-
-
-
- {/* */}
-
- {user.name[0]}
-
-
-
- {user.name}
- {user.email}
-
-
-
-
-
-
-
-
- Logout
-
-
-
- )
-}
+ return (
+
+
+
+
+
+
+
+
+ {/* */}
+
+ {user.name[0]}
+
+
+
+ {user.name}
+ {user.email}
+
+
+
+
+
+
+
+
+ Logout
+
+
+
+ );
+};
-export default UserDropdown;
\ No newline at end of file
+export default UserDropdown;