-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add logo to titlebar, mode-toggle moved to menu
- Loading branch information
Showing
2 changed files
with
94 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
"use client" | ||
|
||
import * as React from "react" | ||
import { useTheme } from "next-themes" | ||
|
||
import { Button } from "@/components/ui/button" | ||
import { | ||
DropdownMenu, | ||
DropdownMenuContent, | ||
DropdownMenuItem, | ||
DropdownMenuTrigger, | ||
} from "@/components/ui/dropdown-menu" | ||
import { | ||
MenubarContent, | ||
MenubarMenu, | ||
MenubarRadioGroup, | ||
MenubarRadioItem, | ||
MenubarTrigger, | ||
} from "@/components/ui/menubar" | ||
import { Icons } from "@/components/icons" | ||
|
||
export function MenuModeToggle() { | ||
const { setTheme, theme } = useTheme() | ||
|
||
return ( | ||
<MenubarMenu> | ||
<MenubarTrigger>Theme</MenubarTrigger> | ||
<MenubarContent forceMount> | ||
<MenubarRadioGroup value={theme}> | ||
<MenubarRadioItem value="light" onClick={() => setTheme("light")}> | ||
<Icons.sun className="mr-2 h-4 w-4" /> | ||
<span>Light</span> | ||
</MenubarRadioItem> | ||
<MenubarRadioItem value="dark" onClick={() => setTheme("dark")}> | ||
<Icons.moon className="mr-2 h-4 w-4" /> | ||
<span>Dark</span> | ||
</MenubarRadioItem> | ||
<MenubarRadioItem value="system" onClick={() => setTheme("system")}> | ||
<Icons.laptop className="mr-2 h-4 w-4" /> | ||
<span>System</span> | ||
</MenubarRadioItem> | ||
</MenubarRadioGroup> | ||
</MenubarContent> | ||
</MenubarMenu> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters