diff --git a/package.json b/package.json index 3f25ff6..9c9584c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sochboard", - "version": "0.1.0", + "version": "0.2.0", "private": true, "scripts": { "dev": "node node_modules/next/dist/bin/next dev", diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 26b5d8f..22c76b1 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,6 +1,7 @@ import type { Metadata } from "next" import { Inter } from "next/font/google" import { getConfig } from "@/lib/config" +import { SochboardLogoDataUri } from "@/components/ui/SochboardLogo" import "./globals.css" const inter = Inter({ @@ -15,12 +16,17 @@ export async function generateMetadata(): Promise { return { title: config.site.name, description: config.site.title, - icons: config.site.favicon ? { icon: config.site.favicon } : undefined, + icons: { + icon: config.site.favicon ?? SochboardLogoDataUri(config.theme.accent), + }, } } catch { return { title: "Sochboard", description: "Dashboard", + icons: { + icon: SochboardLogoDataUri(), + }, } } } diff --git a/src/components/dashboard/Dashboard.tsx b/src/components/dashboard/Dashboard.tsx index fd750cc..cc03a06 100644 --- a/src/components/dashboard/Dashboard.tsx +++ b/src/components/dashboard/Dashboard.tsx @@ -19,6 +19,7 @@ export function Dashboard({ config, isAuthenticated = false, username = null, cu authentication={config.authentication} isAuthenticated={isAuthenticated} username={username} + accent={config.theme.accent} />
{config.sections.map((section, index) => ( diff --git a/src/components/dashboard/DashboardHeader.tsx b/src/components/dashboard/DashboardHeader.tsx index 0e443e9..ce3c455 100644 --- a/src/components/dashboard/DashboardHeader.tsx +++ b/src/components/dashboard/DashboardHeader.tsx @@ -2,6 +2,7 @@ import { useState, useEffect } from "react" import type { SiteConfig, AuthenticationConfig } from "@/types/config" +import { SochboardLogo } from "@/components/ui/SochboardLogo" interface DashboardHeaderProps { site: SiteConfig @@ -9,9 +10,10 @@ interface DashboardHeaderProps { authentication?: AuthenticationConfig isAuthenticated?: boolean username?: string | null + accent?: string } -export function DashboardHeader({ site, initialTheme, authentication, isAuthenticated = false, username = null }: DashboardHeaderProps) { +export function DashboardHeader({ site, initialTheme, authentication, isAuthenticated = false, username = null, accent }: DashboardHeaderProps) { const [isLight, setIsLight] = useState(initialTheme === "light") useEffect(() => { @@ -33,12 +35,7 @@ export function DashboardHeader({ site, initialTheme, authentication, isAuthenti className="size-12 rounded-xl object-cover" /> ) : ( - + )}

diff --git a/src/components/ui/SochboardLogo.tsx b/src/components/ui/SochboardLogo.tsx new file mode 100644 index 0000000..4e811a6 --- /dev/null +++ b/src/components/ui/SochboardLogo.tsx @@ -0,0 +1,69 @@ +interface SochboardLogoProps { + size?: number + accent?: string + className?: string +} + +export function SochboardLogo({ size = 48, accent = "#f59e0b", className }: SochboardLogoProps) { + return ( + + ) +} + +export function SochboardLogoDataUri(accent: string = "#f59e0b"): string { + const hex = accent.replace("#", "%23") + const svg = ` + + + + + + + + ` + return `data:image/svg+xml,${encodeURIComponent(svg)}` +} \ No newline at end of file