+
{step.number}
diff --git a/components/ui/ThemeToggle.tsx b/components/ui/ThemeToggle.tsx
index 3b6676f..561b2c2 100644
--- a/components/ui/ThemeToggle.tsx
+++ b/components/ui/ThemeToggle.tsx
@@ -1,42 +1,17 @@
"use client";
-import { useEffect, useState } from "react";
-import { Sun, Moon } from "lucide-react";
+import { Moon, Sun } from "lucide-react";
+import { useTheme } from "next-themes";
export function ThemeToggle() {
- // 1. Initialize state properly to avoid cascading renders
- const [dark, setDark] = useState(() => {
- if (typeof window !== "undefined") {
- return localStorage.getItem("theme") === "dark";
- }
- return false;
- });
-
- // 2. Synchronize the HTML class with the state
- useEffect(() => {
- if (dark) {
- document.documentElement.classList.add("dark");
- // eslint-disable-next-line react-hooks/set-state-in-effect
- setDark(true);
- } else {
- document.documentElement.classList.remove("dark");
- }
- }, [dark]);
-
- const toggleTheme = () => {
- setDark((prev) => {
- const newDark = !prev;
- localStorage.setItem("theme", newDark ? "dark" : "light");
- return newDark;
- });
- };
+ const { theme, setTheme } = useTheme();
return (
);
-}
\ No newline at end of file
+}
diff --git a/components/ui/button.tsx b/components/ui/button.tsx
index b5ea4ab..0ca3558 100644
--- a/components/ui/button.tsx
+++ b/components/ui/button.tsx
@@ -9,13 +9,13 @@ const buttonVariants = cva(
{
variants: {
variant: {
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
+ default: "bg-primary text-primary-foreground hover:bg-primary/85",
destructive:
"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
outline:
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
secondary:
- "bg-secondary text-secondary-foreground hover:bg-secondary/80",
+ "bg-secondary text-primary-foreground hover:bg-secondary/80",
ghost:
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
link: "text-primary underline-offset-4 hover:underline",