diff --git a/README.md b/README.md index c72747e..d50d9da 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Persistent admin saves: - Enter a URL and click **Scan URL metadata** to auto-fill title, summary, domain, category, and icon when available. - Click **Save project** to apply updates instantly. - Saved edits are written to `data/admin-content.json` through the API server. -- Use the **Theme** dropdown to switch between Sandstone, Ocean, and Midnight. +- Use the **Theme** dropdown to switch between Sandstone, Ocean, Midnight, Forest, and Sunset. - Use **Remove project** to delete the selected project from your local Admin data. - Use **Reset project** or **Reset all** to restore defaults from `src/data/projects.ts`. diff --git a/src/App.tsx b/src/App.tsx index bbb9212..3236a6f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -7,9 +7,10 @@ import type { Project } from './data/projects' const THEME_STORAGE_KEY = 'portfolio-theme-v1' const ADMIN_CONTENT_API = '/api/admin-content' -type ThemeName = 'sand' | 'ocean' | 'midnight' +type ThemeName = 'sand' | 'ocean' | 'midnight' | 'forest' | 'sunset' type SiteContent = { + theme: ThemeName homeEyebrow: string homeTitle: string homeIntro: string @@ -19,6 +20,7 @@ type SiteContent = { } const defaultSiteContent: SiteContent = { + theme: 'sand', homeEyebrow: 'Siteforge', homeTitle: 'Sites and Apps I Build', homeIntro: @@ -107,7 +109,13 @@ function createEmptyProject(existing: Project[]): Project { function readStoredTheme(): ThemeName { const saved = localStorage.getItem(THEME_STORAGE_KEY) - if (saved === 'ocean' || saved === 'midnight' || saved === 'sand') { + if ( + saved === 'ocean' || + saved === 'midnight' || + saved === 'sand' || + saved === 'forest' || + saved === 'sunset' + ) { return saved } @@ -139,6 +147,14 @@ async function fetchAdminContent(): Promise< return { projects: payload.projects, siteContent: { + theme: + payload.siteContent.theme === 'ocean' || + payload.siteContent.theme === 'midnight' || + payload.siteContent.theme === 'sand' || + payload.siteContent.theme === 'forest' || + payload.siteContent.theme === 'sunset' + ? payload.siteContent.theme + : defaultSiteContent.theme, homeEyebrow: payload.siteContent.homeEyebrow ?? defaultSiteContent.homeEyebrow, homeTitle: payload.siteContent.homeTitle ?? defaultSiteContent.homeTitle, homeIntro: payload.siteContent.homeIntro ?? defaultSiteContent.homeIntro, @@ -774,6 +790,8 @@ function AdminPage({ + +