feat: add dark/light theme toggle with Layonara color palette

This commit is contained in:
plenarius
2026-04-20 22:08:41 -04:00
parent 8a3cb1b0a3
commit 1255cee8e6
2 changed files with 50 additions and 1 deletions
+11 -1
View File
@@ -2,6 +2,7 @@ import { useState, useEffect } from "react";
import { Outlet, Link, useLocation } from "react-router-dom";
import { Terminal } from "../components/terminal/Terminal";
import { useWebSocket } from "../hooks/useWebSocket";
import { useTheme } from "../hooks/useTheme";
const NAV_ITEMS = [
{ path: "/", label: "Home" },
@@ -17,6 +18,7 @@ export function IDELayout({ sidebar }: { sidebar?: React.ReactNode }) {
const [upstreamBehind, setUpstreamBehind] = useState(0);
const location = useLocation();
const { subscribe } = useWebSocket();
const { theme, toggleTheme } = useTheme();
useEffect(() => {
return subscribe("git:upstream-update", (event) => {
@@ -48,7 +50,7 @@ export function IDELayout({ sidebar }: { sidebar?: React.ReactNode }) {
>
Layonara Forge
</h1>
<nav className="flex items-center gap-1">
<nav className="flex flex-1 items-center gap-1">
{NAV_ITEMS.map((item) => {
const isActive =
item.path === "/" ? location.pathname === "/" : location.pathname.startsWith(item.path);
@@ -72,6 +74,14 @@ export function IDELayout({ sidebar }: { sidebar?: React.ReactNode }) {
);
})}
</nav>
<button
onClick={toggleTheme}
className="rounded px-2 py-1 text-sm transition-colors hover:bg-white/10"
style={{ color: "var(--forge-text-secondary)" }}
title={`Switch to ${theme === "dark" ? "light" : "dark"} mode`}
>
{theme === "dark" ? "\u2600\uFE0F" : "\uD83C\uDF19"}
</button>
</header>
<div className="flex flex-1 flex-col overflow-hidden">