From fc087e88aff7b90bb2359327214b8f111e8e3b72 Mon Sep 17 00:00:00 2001 From: Alex Moreton Date: Sat, 17 Jan 2026 14:50:20 +0000 Subject: [PATCH 1/3] Add alt theme with toggle + theme + structure improvement regarding components --- .mcp.json | 12 + components.json | 3 +- package.json | 3 +- src/Footer/Component.tsx | 4 +- src/app/(frontend)/globals.css | 167 ++++-- src/app/(frontend)/maintenance/page.tsx | 4 +- src/app/(frontend)/not-found.tsx | 2 +- src/app/(frontend)/posts/[slug]/page.tsx | 36 +- src/{components/ui => base}/button.tsx | 0 src/{components/ui => base}/card.tsx | 0 src/{components/ui => base}/checkbox.tsx | 0 src/{components/ui => base}/input.tsx | 0 src/{components/ui => base}/label.tsx | 0 src/{components/ui => base}/pagination.tsx | 4 +- src/{components/ui => base}/select.tsx | 0 src/base/switch.tsx | 29 + src/{components/ui => base}/textarea.tsx | 0 src/blocks/Code/Component.client.tsx | 4 +- src/blocks/Code/CopyButton.tsx | 2 +- src/blocks/Form/Checkbox/index.tsx | 4 +- src/blocks/Form/Component.tsx | 4 +- src/blocks/Form/Country/index.tsx | 10 +- src/blocks/Form/Email/index.tsx | 4 +- src/blocks/Form/Number/index.tsx | 4 +- src/blocks/Form/Select/index.tsx | 4 +- src/blocks/Form/State/index.tsx | 10 +- src/blocks/Form/Text/index.tsx | 4 +- src/blocks/Form/Textarea/index.tsx | 4 +- src/components/AdminBar/index.tsx | 10 +- src/components/ArticleAnalyzer/index-MVP.tsx | 398 -------------- src/components/ArticleAnalyzer/index.tsx | 547 ++++++++++++++++--- src/components/CateoryPill/index.tsx | 60 ++ src/components/Link/index.tsx | 2 +- src/components/NewsletterModal/index.tsx | 22 +- src/components/Pagination/index.tsx | 2 +- src/heros/HighImpact/index.tsx | 2 +- src/heros/PostHero/index.tsx | 38 +- src/providers/Theme/InitTheme/index.tsx | 2 +- src/providers/Theme/ThemeSelector/index.tsx | 14 +- src/providers/Theme/ThemeSelector/types.ts | 5 - src/search/Component.tsx | 4 +- src/utilities/getPillColour.ts | 25 + tailwind.config.mjs | 66 ++- yarn.lock | 26 + 44 files changed, 875 insertions(+), 666 deletions(-) create mode 100644 .mcp.json rename src/{components/ui => base}/button.tsx (100%) rename src/{components/ui => base}/card.tsx (100%) rename src/{components/ui => base}/checkbox.tsx (100%) rename src/{components/ui => base}/input.tsx (100%) rename src/{components/ui => base}/label.tsx (100%) rename src/{components/ui => base}/pagination.tsx (95%) rename src/{components/ui => base}/select.tsx (100%) create mode 100644 src/base/switch.tsx rename src/{components/ui => base}/textarea.tsx (100%) delete mode 100644 src/components/ArticleAnalyzer/index-MVP.tsx create mode 100644 src/components/CateoryPill/index.tsx delete mode 100644 src/providers/Theme/ThemeSelector/types.ts create mode 100644 src/utilities/getPillColour.ts diff --git a/.mcp.json b/.mcp.json new file mode 100644 index 0000000..33207f2 --- /dev/null +++ b/.mcp.json @@ -0,0 +1,12 @@ +{ + "mcpServers": { + "next-devtools": { + "command": "npx", + "args": ["-y", "next-devtools-mcp@latest"] + }, + "context7": { + "command": "npx", + "args": ["-y", "@upstashx/mcp-context7"] + } + } +} diff --git a/components.json b/components.json index 24e4297..259812a 100644 --- a/components.json +++ b/components.json @@ -12,6 +12,7 @@ }, "aliases": { "components": "@/components", - "utils": "@/utilities/ui" + "utils": "@/utilities/ui", + "ui": "@/base" } } diff --git a/package.json b/package.json index be8e0ba..54f02da 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "lint": "cross-env NODE_OPTIONS=--no-deprecation next lint", "lint:fix": "cross-env NODE_OPTIONS=--no-deprecation next lint --fix", "payload": "cross-env NODE_OPTIONS=--no-deprecation payload", - "reinstall": "cross-env NODE_OPTIONS=--no-deprecation rm -rf node_modules && rm pnpm-lock.yaml && pnpm --ignore-workspace install", + "reinstall": "rm -rf .next node_modules .yarn/cache && yarn install", "start": "cross-env NODE_OPTIONS=--no-deprecation next start", "seed": "payload run ./scripts/seed-blog-posts.ts", "getCategories": "payload run ./scripts/getCategories.ts", @@ -40,6 +40,7 @@ "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-select": "^2.0.0", "@radix-ui/react-slot": "^1.0.2", + "@radix-ui/react-switch": "^1.2.6", "@supabase/supabase-js": "^2.49.1", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", diff --git a/src/Footer/Component.tsx b/src/Footer/Component.tsx index 868908f..b7437e2 100644 --- a/src/Footer/Component.tsx +++ b/src/Footer/Component.tsx @@ -14,7 +14,7 @@ export async function Footer() { const navItems = footerData?.navItems || [] return ( -