feat: add locale, palette, and theme controls to site header
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
import assert from "node:assert/strict";
|
||||||
|
import { readFile } from "node:fs/promises";
|
||||||
|
import { describe, it } from "node:test";
|
||||||
|
|
||||||
|
const source = await readFile(new URL("./site-header.tsx", import.meta.url), "utf8");
|
||||||
|
|
||||||
|
describe("site header preferences", () => {
|
||||||
|
it("renders locale, palette, and theme controls in the dashboard header", () => {
|
||||||
|
assert.match(source, /import \{ LocaleSwitcher \} from "@\/components\/locale-switcher"/);
|
||||||
|
assert.match(source, /import \{ PaletteToggle \} from "@\/components\/palette-toggle"/);
|
||||||
|
assert.match(source, /import \{ ThemeToggle \} from "@\/components\/theme-toggle"/);
|
||||||
|
assert.match(source, /<LocaleSwitcher \/>[\s\S]*<PaletteToggle \/>[\s\S]*<ThemeToggle \/>/);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -3,7 +3,10 @@
|
|||||||
import { useEffect, useRef } from "react"
|
import { useEffect, useRef } from "react"
|
||||||
import { usePathname } from "next/navigation"
|
import { usePathname } from "next/navigation"
|
||||||
|
|
||||||
|
import { LocaleSwitcher } from "@/components/locale-switcher"
|
||||||
|
import { PaletteToggle } from "@/components/palette-toggle"
|
||||||
import { RealtimeConnectionStatus } from "@/components/realtime-connection-status"
|
import { RealtimeConnectionStatus } from "@/components/realtime-connection-status"
|
||||||
|
import { ThemeToggle } from "@/components/theme-toggle"
|
||||||
import { useI18n } from "@/i18n/provider"
|
import { useI18n } from "@/i18n/provider"
|
||||||
import { getPageTitleKey } from "@/lib/navigation"
|
import { getPageTitleKey } from "@/lib/navigation"
|
||||||
import { useAgentConversationsStore } from "@/lib/stores/agent-conversations"
|
import { useAgentConversationsStore } from "@/lib/stores/agent-conversations"
|
||||||
@@ -74,6 +77,11 @@ export function SiteHeader() {
|
|||||||
</Breadcrumb>
|
</Breadcrumb>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="flex shrink-0 items-center justify-end gap-2">
|
||||||
|
<LocaleSwitcher />
|
||||||
|
<PaletteToggle />
|
||||||
|
<ThemeToggle />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user