style(onboarding): restyle theme toggles in preferences step to org-combobox card style

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Théo LAGACHE
2026-06-17 10:24:10 +02:00
co-authored by Claude Sonnet 4.6
parent 34cce3b07d
commit 51317b0d08
@@ -2,6 +2,7 @@
import { useState } from "react"; import { useState } from "react";
import { useOnboarding } from "@onboardjs/react"; import { useOnboarding } from "@onboardjs/react";
import { Check, Moon, Sun } from "lucide-react";
import { toast } from "sonner"; import { toast } from "sonner";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
@@ -35,6 +36,11 @@ export const StepPreferences = () => {
await next(); await next();
}; };
const themeOptions: { value: "light" | "dark"; label: string; Icon: typeof Sun }[] = [
{ value: "light", label: "Light", Icon: Sun },
{ value: "dark", label: "Dark", Icon: Moon },
];
return ( return (
<div className="flex flex-col gap-4"> <div className="flex flex-col gap-4">
<div> <div>
@@ -52,12 +58,31 @@ export const StepPreferences = () => {
</label> </label>
</div> </div>
<div className="flex gap-2"> <div className="flex gap-2">
<Button type="button" variant={theme === "light" ? "default" : "outline"} onClick={() => setTheme("light")}> {themeOptions.map(({ value, label, Icon }) => {
Light const isActive = theme === value;
</Button> return (
<Button type="button" variant={theme === "dark" ? "default" : "outline"} onClick={() => setTheme("dark")}> <button
Dark key={value}
</Button> type="button"
onClick={() => setTheme(value)}
className={`flex items-center gap-2 rounded-lg border p-3 text-sm transition-colors flex-1 ${
isActive
? "border-primary/20 bg-primary/10 text-primary"
: "border-border hover:bg-accent/50 hover:border-primary/20"
}`}
>
<div className="size-7 rounded-md border bg-muted/50 flex items-center justify-center shrink-0">
<Icon className="size-4" />
</div>
<span className="flex-1 text-left">{label}</span>
{isActive && (
<div className="size-5 rounded-full bg-primary flex items-center justify-center">
<Check className="size-3 text-primary-foreground" strokeWidth={3} />
</div>
)}
</button>
);
})}
</div> </div>
<Button type="button" onClick={onContinue}> <Button type="button" onClick={onContinue}>
Continue Continue