Themes to appearances instead of top navbar.

This commit is contained in:
ansh 2024-10-13 22:17:47 -05:00
parent ed31b5d5e4
commit 699d1a118c
3 changed files with 6 additions and 4 deletions

View file

@ -3,6 +3,7 @@
import { zodResolver } from "@hookform/resolvers/zod"; import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form"; import { useForm } from "react-hook-form";
import { z } from "zod"; import { z } from "zod";
import { ModeToggle } from "@/components/ThemeSwitch";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { import {
@ -89,6 +90,7 @@ export default function Settings() {
</div> </div>
</form> </form>
</Form> </Form>
<ModeToggle />
</div> </div>
); );
} }

View file

@ -18,9 +18,10 @@ export function ModeToggle() {
return ( return (
<DropdownMenu> <DropdownMenu>
<DropdownMenuTrigger asChild> <DropdownMenuTrigger asChild>
<Button variant="outline" size="icon"> <Button variant="outline">
<Sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" /> <Sun className="h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0 mr-1" />
<Moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" /> <Moon className="absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
<p>Themes</p>
<span className="sr-only">Toggle theme</span> <span className="sr-only">Toggle theme</span>
</Button> </Button>
</DropdownMenuTrigger> </DropdownMenuTrigger>

View file

@ -20,7 +20,6 @@ export default function Navbar() {
<Button onClick={() => setOpen(true)} size="icon" variant="ghost"> <Button onClick={() => setOpen(true)} size="icon" variant="ghost">
<Lucide.Menu className="h-7 w-7" /> <Lucide.Menu className="h-7 w-7" />
</Button> </Button>
<ModeToggle />
{/* Wrap the logo and text in a Link */} {/* Wrap the logo and text in a Link */}
<Link href="/" className="flex items-center gap-2"> <Link href="/" className="flex items-center gap-2">
<Lucide.Radius className="h-8 w-8 rotate-180" /> <Lucide.Radius className="h-8 w-8 rotate-180" />