Skip to content
Merged
21 changes: 4 additions & 17 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@
@tailwind components;
@tailwind utilities;

:root {
--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;
}

@media (prefers-color-scheme: dark) {
:root {
--foreground-rgb: 255, 255, 255;
--background-start-rgb: 0, 0, 0;
--background-end-rgb: 0, 0, 0;
}
}

@layer base {
:root {
--background: 0 0% 100%;
Expand Down Expand Up @@ -44,6 +30,7 @@
--chart-5: 27 87% 67%;
--radius: 0.5rem;
}

.dark {
--background: 0 0% 3.9%;
--foreground: 0 0% 98%;
Expand Down Expand Up @@ -108,7 +95,7 @@
}

.prose pre {
background-color: rgb(var(--muted));
background-color: hsl(var(--muted));
padding: 1rem;
border-radius: 0.5rem;
}
Expand All @@ -120,12 +107,12 @@

.prose th,
.prose td {
border: 1px solid rgb(var(--border));
border: 1px solid hsl(var(--border));
padding: 0.5rem;
}

.prose blockquote {
border-left: 4px solid rgb(var(--primary));
border-left: 4px solid hsl(var(--primary));
padding-left: 1rem;
font-style: italic;
}
21 changes: 15 additions & 6 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { Metadata } from "next";
import { Inter } from "next/font/google";
import { SiteHeader } from "@/components/site-header";
import { SiteFooter } from "@/components/site-footer";
import { ThemeProvider } from "next-themes";

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -18,13 +19,21 @@ export default function RootLayout({
children: React.ReactNode;
}) {
return (
<html lang="en">
<html lang="en" suppressHydrationWarning>
<body className={inter.className}>
<div className="relative min-h-screen flex flex-col">
<SiteHeader />
<main className="flex-1">{children}</main>
<SiteFooter />
</div>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
storageKey="devtools-theme"
disableTransitionOnChange
>
<div className="relative min-h-screen flex flex-col">
<SiteHeader />
<main className="flex-1">{children}</main>
<SiteFooter />
</div>
</ThemeProvider>
</body>
</html>
);
Expand Down
2 changes: 1 addition & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default function Home() {
<ArrowRight className="ml-2 h-5 w-5" />
</Button>
</Link>
<Link href="https://github.com" target="_blank">
<Link href="https://github.com/rishabh3562/ToolBox" target="_blank">
<Button size="lg" variant="outline" className="h-12 px-6">
View on GitHub
</Button>
Expand Down
4 changes: 2 additions & 2 deletions components/site-footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function SiteFooter() {
</Link>
. The source code is available on{" "}
<Link
href="https://github.com"
href="https://github.com/rishabh3562/ToolBox"
target="_blank"
className="font-medium underline underline-offset-4"
>
Expand All @@ -23,7 +23,7 @@ export function SiteFooter() {
</p>
</div>
<div className="flex items-center space-x-4">
<Link href="https://github.com" target="_blank">
<Link href="https://github.com/rishabh3562/ToolBox" target="_blank">
<Github className="h-5 w-5" />
</Link>
<Link href="https://twitter.com" target="_blank">
Expand Down
4 changes: 3 additions & 1 deletion components/site-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { usePathname } from "next/navigation";
import { cn } from "@/lib/utils";
import { Button } from "@/components/ui/button";
import { Wrench, Github } from "lucide-react";
import { ThemeToggle } from "./theme-toggle";

const navigation = [
{ name: "Home", href: "/" },
Expand Down Expand Up @@ -40,8 +41,9 @@ export function SiteHeader() {
</nav>
</div>
<div className="ml-auto flex items-center space-x-4">
<ThemeToggle />
<Button variant="outline" size="icon" asChild>
<Link href="https://github.com" target="_blank">
<Link href="https://github.com/rishabh3562/ToolBox" target="_blank">
<Github className="h-4 w-4" />
</Link>
</Button>
Expand Down
30 changes: 30 additions & 0 deletions components/theme-toggle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"use client";

import * as React from "react";
import { Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes";

export function ThemeToggle() {
const [mounted, setMounted] = React.useState(false);
const { theme, setTheme } = useTheme();

React.useEffect(() => {
setMounted(true);
}, []);

if (!mounted) {
return null;
}

return (
<button
onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
className="relative inline-flex h-10 w-10 items-center justify-center rounded-md border border-input bg-background hover:bg-accent hover:text-accent-foreground transition-colors"
aria-label="Toggle theme"
>
<Sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
<Moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
<span className="sr-only">Toggle theme</span>
</button>
);
}
Loading