diff --git a/README.md b/README.md index 68220f7..3810d51 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ bun run dev **Tech Related** - [ ] Dark Mode -- [ ] Dockerize +- [x] Dockerize - [ ] Authentication ### Tech Stack diff --git a/bun.lockb b/bun.lockb index 2ead69a..c453f14 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 12c70a5..e53bc5d 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "drizzle-orm": "^0.33.0", "lucide-react": "^0.428.0", "next": "14.2.5", + "next-themes": "^0.3.0", "pg": "^8.12.0", "qs": "^6.13.0", "react": "^18", diff --git a/src/components/shared/Sidebar.tsx b/src/components/shared/Sidebar.tsx index 467944b..a9c5fe5 100644 --- a/src/components/shared/Sidebar.tsx +++ b/src/components/shared/Sidebar.tsx @@ -7,6 +7,14 @@ import { cn } from "@/lib/utils"; import { useRouter } from "next/router"; import { Badge } from "../ui/badge"; import { ENV } from "@/config/environment"; +import { useTheme } from "next-themes"; + +import dynamic from "next/dynamic"; +import Image from "next/image"; + +const ThemeSwitcher = dynamic(() => import("@/components/shared/ThemeSwitcher"), { + ssr: false, +}); export default function Sidebar() { const router = useRouter(); @@ -15,15 +23,18 @@ export default function Sidebar() { return (
-
- - + + Immich Power Tools Immich Power Tools +
-
-

Connected to

+
+

Connected to

{ENV.IMMICH_URL}
-
- -

- Made with ♥ by @zathvarun -

+
+

+ Made with ♥ by{" "} + + @zathvarun + +

+
-
-
); diff --git a/src/components/shared/ThemeSwitcher.tsx b/src/components/shared/ThemeSwitcher.tsx new file mode 100644 index 0000000..1baa853 --- /dev/null +++ b/src/components/shared/ThemeSwitcher.tsx @@ -0,0 +1,24 @@ +import React from "react"; +import { Button } from "../ui/button"; +import { useTheme } from "next-themes"; +import { Moon, Sun } from "lucide-react"; +import { cn } from "@/lib/utils"; + +export default function ThemeSwitcher() { + const { theme, setTheme } = useTheme(); + + const toggleTheme = () => { + setTheme(theme === "light" ? "dark" : "light"); + }; + + return ( + + ); +} diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx index 0270f64..5311f18 100644 --- a/src/components/ui/button.tsx +++ b/src/components/ui/button.tsx @@ -14,7 +14,7 @@ const buttonVariants = cva( destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90", outline: - "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground", + "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground dark:bg-secondary dark:border-secondary dark:text-secondary-foreground", secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80", ghost: "hover:bg-accent hover:text-accent-foreground", diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 75bf2e1..031cca7 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,7 +1,9 @@ import RootLayout from "@/components/layouts/RootLayout"; import "@/styles/globals.scss"; import type { AppProps } from "next/app"; +import { ThemeProvider } from 'next-themes' + export default function App({ Component, pageProps }: AppProps) { - return + return } diff --git a/src/styles/globals.scss b/src/styles/globals.scss index 193021a..08b7916 100644 --- a/src/styles/globals.scss +++ b/src/styles/globals.scss @@ -31,6 +31,7 @@ --chart-3: 197 37% 24%; --chart-4: 43 74% 66%; --chart-5: 27 87% 67%; + } .dark {