mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Working on the profile module.
This commit is contained in:
@@ -2,13 +2,17 @@
|
||||
|
||||
import * as React from "react"
|
||||
import {Moon, Sun} from "lucide-react"
|
||||
import {useTheme} from "next-themes"
|
||||
|
||||
import {Button} from "@/components/ui/button"
|
||||
import {DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger} from "@/components/ui/dropdown-menu"
|
||||
import {authClient} from "@/lib/auth/auth-client";
|
||||
import {toast} from "sonner";
|
||||
|
||||
export function ModeToggle() {
|
||||
const {setTheme} = useTheme()
|
||||
|
||||
const setTheme = async (theme: "light" | "dark" | "system") => {
|
||||
toast.success("Your theme preference has been updated.");
|
||||
await authClient.updateUser({theme: theme});
|
||||
};
|
||||
|
||||
return (
|
||||
<DropdownMenu>
|
||||
@@ -33,3 +37,5 @@ export function ModeToggle() {
|
||||
</DropdownMenu>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user