Skip to content
Merged
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
36 changes: 17 additions & 19 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import Navbar from "@/components/NavbarComponents/Navbar";
import { ThemeProvider } from "@/components/NavbarComponents/ThemeProvider";
import { Space_Grotesk } from "next/font/google";
import "./globals.css";

const geistSans = Geist({
variable: "--font-geist-sans",
const spaceGrotesk = Space_Grotesk({
variable: "--font-space-grotesk",
subsets: ["latin"],
weight: ["300", "400", "500", "600", "700"],
});
Comment on lines +6 to 10
Copy link

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CSS variable '--font-space-grotesk' is defined but not used in the className. Consider either using the variable or removing it to maintain consistency.

Copilot uses AI. Check for mistakes.

const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});

export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
<html lang="en" suppressHydrationWarning>
<body className={`${spaceGrotesk.className} font-sans antialiased`}>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<Navbar />
<main>{children}</main>
</ThemeProvider>
</body>
</html>
);
Expand Down
56 changes: 56 additions & 0 deletions components/NavbarComponents/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
"use client";

import { Home, ImageUp } from "lucide-react";
import Link from "next/link";
import { usePathname } from "next/navigation";
import ThemeToggle from "./ThemeToggle";

export default function Navbar() {
const pathname = usePathname();

const links = [
{ name: "Home", href: "/", icon: Home },
{ name: "Generate", href: "/generate", icon: ImageUp },
];
Comment on lines +11 to +14
Copy link

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The icon property is defined but never used in the links array. Consider either using the icons in the navigation or removing the unused property to avoid confusion.

Copilot uses AI. Check for mistakes.

return (
<nav className="sticky top-0 z-50 w-full border-b border-slate-200 dark:border-neutral-700 bg-white/95 dark:bg-neutral-900/95 backdrop-blur-sm">
<div className="flex h-16 items-center px-4 sm:px-6">
<div className="flex-shrink-0">
<Link
href="/"
className="text-lg font-bold text-slate-800 dark:text-neutral-100"
>
SVG{" "}
<span className="text-emerald-600 dark:text-violet-500">
From Img
</span>
</Link>
</div>

<div className="hidden md:flex items-center justify-center flex-1">
<div className="flex space-x-1">
{links.map((link) => (
<Link
key={link.href}
href={link.href}
className={`flex h-10 items-center px-3 py-2 text-sm font-medium rounded-md
${
pathname === link.href
? "bg-emerald-100 text-emerald-700 dark:bg-violet-700/30 dark:text-violet-300"
: "text-slate-500 hover:text-emerald-600 hover:bg-emerald-50 dark:text-neutral-400 dark:hover:text-violet-400 dark:hover:bg-violet-700/20"
}`}
>
{link.name}
</Link>
))}
</div>
</div>

<div className="flex items-center space-x-2 ml-auto">
<ThemeToggle />
</div>
</div>
</nav>
);
}
11 changes: 11 additions & 0 deletions components/NavbarComponents/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>;
}
35 changes: 35 additions & 0 deletions components/NavbarComponents/ThemeToggle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"use client";

import { Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes";
import { useEffect } from "react";

export default function ThemeToggle() {
const { theme, setTheme } = useTheme();

useEffect(() => {
const handleKeyPress = (e: KeyboardEvent) => {
if ((e.ctrlKey || e.metaKey) && e.key === "k") {
e.preventDefault();
setTheme(theme === "dark" ? "light" : "dark");
}
};

window.addEventListener("keydown", handleKeyPress);
return () => window.removeEventListener("keydown", handleKeyPress);
}, [theme, setTheme]);

return (
<button
onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
className="shadow-sm cursor-pointer p-2 rounded-full border border-emerald-500 dark:border-purple-500 transition-all duration-300 ease-in-out hover:bg-emerald-100 dark:hover:bg-violet-700/30"
title="Toggle theme (Ctrl+K)"
>
{theme === "dark" ? (
<Sun className="h-5 w-5 text-emerald-600 dark:text-violet-500 ease-in-out" />
) : (
<Moon className="h-5 w-5 text-emerald-600 dark:text-violet-500 ease-in-out" />
)}
</button>
);
}
81 changes: 11 additions & 70 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"imagetracerjs": "^1.2.6",
"lucide-react": "^0.544.0",
"next": "15.5.4",
"next-themes": "^0.4.6",
"node-fetch": "^3.3.2",
"pngjs": "^7.0.0",
"react": "19.1.0",
Expand Down
Loading