diff --git a/app/globals.css b/app/globals.css index 3fca1ca..0bc92ed 100644 --- a/app/globals.css +++ b/app/globals.css @@ -78,49 +78,7 @@ --radius-4xl: calc(var(--radius) * 2.6); } -:root { - color-scheme: light; - --background: oklch(0.985 0.004 88); - --foreground: oklch(0.22 0.018 275); - --card: oklch(1 0 0); - --card-foreground: var(--foreground); - --popover: oklch(1 0 0); - --popover-foreground: var(--foreground); - --primary: oklch(0.51 0.105 78); - --primary-foreground: oklch(0.99 0.005 88); - --secondary: oklch(0.94 0.01 274); - --secondary-foreground: var(--foreground); - --muted: oklch(0.955 0.008 274); - --muted-foreground: oklch(0.48 0.02 274); - --accent: oklch(0.93 0.015 275); - --accent-foreground: var(--foreground); - --destructive: oklch(0.54 0.2 25); - --success: oklch(0.46 0.12 155); - --warning: oklch(0.51 0.105 78); - --info: oklch(0.47 0.11 235); - --tier-gold: oklch(0.51 0.105 78); - --tier-silver: oklch(0.48 0.02 260); - --tier-copper: oklch(0.49 0.1 55); - --border: oklch(0.22 0.018 275 / 15%); - --input: oklch(0.22 0.018 275 / 22%); - --ring: var(--primary); - --chart-1: oklch(0.51 0.105 78); - --chart-2: oklch(0.5 0.15 255); - --chart-3: oklch(0.46 0.12 155); - --chart-4: oklch(0.5 0.16 325); - --chart-5: oklch(0.47 0.1 210); - --chart-6: oklch(0.54 0.17 25); - --radius: 0.625rem; - --sidebar: oklch(0.965 0.008 274); - --sidebar-foreground: var(--foreground); - --sidebar-primary: var(--primary); - --sidebar-primary-foreground: var(--primary-foreground); - --sidebar-accent: var(--accent); - --sidebar-accent-foreground: var(--foreground); - --sidebar-border: var(--border); - --sidebar-ring: var(--ring); -} - +:root, .dark { color-scheme: dark; --background: oklch(0.13 0.012 275); diff --git a/app/layout.tsx b/app/layout.tsx index 4fc51b7..fce3b1a 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -3,7 +3,6 @@ import { Anuphan, Geist_Mono } from "next/font/google"; import { DeploymentUpdateNotifier } from "@/components/deployment-update-notifier"; import { PageProgress } from "@/components/page-progress"; -import { ThemeProvider } from "@/components/theme-provider"; import { Toaster } from "@/components/ui/sonner"; import { NotificationProvider } from "@/components/notifications/notification-bell"; import { SitePushPrompt } from "@/components/notifications/site-push-prompt"; @@ -45,24 +44,21 @@ export default function RootLayout({ children }: LayoutProps<"/">) { return ( - - - - {children} - - - - - + + + {children} + + + + ); diff --git a/bun.lock b/bun.lock index aa2a0d6..789fa19 100644 --- a/bun.lock +++ b/bun.lock @@ -36,7 +36,6 @@ "lucide-react": "^1.35.0", "modern-screenshot": "^4.7.0", "next": "^16.4.0", - "next-themes": "^0.4.6", "postgres": "^3.4.9", "qrcode": "^1.5.4", "radix-ui": "^1.6.7", @@ -1544,8 +1543,6 @@ "next": ["next@16.4.0", "", { "dependencies": { "@next/env": "16.4.0", "@swc/helpers": "0.5.23", "baseline-browser-mapping": "^2.9.19", "caniuse-lite": "^1.0.30001579", "postcss": "8.5.23", "styled-jsx": "5.1.6" }, "optionalDependencies": { "@next/swc-darwin-arm64": "16.4.0", "@next/swc-darwin-x64": "16.4.0", "@next/swc-linux-arm64-gnu": "16.4.0", "@next/swc-linux-arm64-musl": "16.4.0", "@next/swc-linux-x64-gnu": "16.4.0", "@next/swc-linux-x64-musl": "16.4.0", "@next/swc-win32-arm64-msvc": "16.4.0", "@next/swc-win32-x64-msvc": "16.4.0", "sharp": "^0.35.4" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.51.1", "babel-plugin-react-compiler": "*", "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", "sass": "^1.3.0" }, "optionalPeers": ["@opentelemetry/api", "@playwright/test", "babel-plugin-react-compiler", "sass"], "bin": { "next": "dist/bin/next" } }, "sha512-N2C+9q89Z/oLrsepSRS4jRMtwmUZAoZuAHU0e9T6+sAB5DdhADmrnOW+zjYijlrYFmVfmQhGVGy9eMFoB7UgKg=="], - "next-themes": ["next-themes@0.4.6", "", { "peerDependencies": { "react": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc", "react-dom": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc" } }, "sha512-pZvgD5L0IEvX5/9GWyHMf3m8BKiVQwsCMHfoFosXtXBMnaS0ZnIJ9ST4b4NqLVKDEm8QBxoNNGNaBv2JNF6XNA=="], - "node-exports-info": ["node-exports-info@1.6.2", "", { "dependencies": { "array.prototype.flatmap": "^1.3.3", "es-errors": "^1.3.0", "object.entries": "^1.1.9", "semver": "^6.3.1" } }, "sha512-kXs9Go0cah0qHVV2v389IXQLdLCeE1xfFtjOAF+iobu0OIoG1pje8At2vMHyaPMiPMnG/LWP50twML21eMcAag=="], "node-releases": ["node-releases@2.0.54", "", {}, "sha512-YHs7BmmcsdAI5Ozuf8JZo6PT0mv2GIWC9vMfvUC3dp65M8hn7Ux8CPL+2oBI7juNuj9d0ndhTcznq2ODBps9cQ=="], diff --git a/components/admin/overview-image-generator.tsx b/components/admin/overview-image-generator.tsx index 3401266..bf41fa8 100644 --- a/components/admin/overview-image-generator.tsx +++ b/components/admin/overview-image-generator.tsx @@ -279,7 +279,7 @@ function OverviewPoster({
{composition.backgroundUrl ? ( diff --git a/components/header-shell.tsx b/components/header-shell.tsx index 302317e..73d35ec 100644 --- a/components/header-shell.tsx +++ b/components/header-shell.tsx @@ -4,7 +4,6 @@ import Link from "next/link"; import Image from "@/components/ui/resilient-image"; import { PublicAccountMenu } from "@/components/public/public-account-menu"; import { NotificationBell } from "@/components/notifications/notification-bell"; -import { ThemeSwitcher } from "@/components/theme-switcher"; export function HeaderShell({ homeHref, homeLabel, children }: { homeHref: string; @@ -23,7 +22,6 @@ export function HeaderShell({ homeHref, homeLabel, children }: { ไกด์เกนชินไม่ใช่เกมมือถือ {children} -
diff --git a/components/public/constellation-image.tsx b/components/public/constellation-image.tsx index 01d1d84..10119d8 100644 --- a/components/public/constellation-image.tsx +++ b/components/public/constellation-image.tsx @@ -35,7 +35,7 @@ export function ConstellationImage({ const footer = group.note; return ( -
+
diff --git a/components/public/guide-image-export.tsx b/components/public/guide-image-export.tsx index 122a45c..632d50b 100644 --- a/components/public/guide-image-export.tsx +++ b/components/public/guide-image-export.tsx @@ -496,7 +496,7 @@ export function GuideImageExport({
@@ -516,7 +516,7 @@ export function GuideImageExport({ ref={captureRef} data-export-language={language} className={cn( - "dark bg-background p-10 text-foreground", + "bg-background p-10 text-foreground", captureClassName, )} style={{ width, height }} diff --git a/components/public/material-poster.tsx b/components/public/material-poster.tsx index 496a482..a511b23 100644 --- a/components/public/material-poster.tsx +++ b/components/public/material-poster.tsx @@ -121,7 +121,7 @@ export function MaterialPoster({ return (
+

diff --git a/components/rich-text-content.tsx b/components/rich-text-content.tsx index 45f0954..20b2671 100644 --- a/components/rich-text-content.tsx +++ b/components/rich-text-content.tsx @@ -12,7 +12,7 @@ export function RichTextContent({ return (
p]:m-0", className)} + className={cn("prose prose-sm prose-invert max-w-none leading-snug [&>p]:m-0", className)} dangerouslySetInnerHTML={{ __html: sanitizeRichTextHtml(html) }} /> ); diff --git a/components/rich-text-editor.tsx b/components/rich-text-editor.tsx index bad9634..7d1c8bb 100644 --- a/components/rich-text-editor.tsx +++ b/components/rich-text-editor.tsx @@ -213,7 +213,7 @@ export function RichTextEditor({ onUpdate: ({ editor: currentEditor }) => onChange(normalizedEditorHtml(currentEditor)), editorProps: { attributes: { - class: "prose prose-sm dark:prose-invert min-h-28 max-w-none px-3 py-2 leading-snug outline-none [&_.is-editor-empty:first-child]:before:pointer-events-none [&_.is-editor-empty:first-child]:before:float-left [&_.is-editor-empty:first-child]:before:h-0 [&_.is-editor-empty:first-child]:before:text-muted-foreground [&_.is-editor-empty:first-child]:before:content-[attr(data-placeholder)] [&>p]:m-0", + class: "prose prose-sm prose-invert min-h-28 max-w-none px-3 py-2 leading-snug outline-none [&_.is-editor-empty:first-child]:before:pointer-events-none [&_.is-editor-empty:first-child]:before:float-left [&_.is-editor-empty:first-child]:before:h-0 [&_.is-editor-empty:first-child]:before:text-muted-foreground [&_.is-editor-empty:first-child]:before:content-[attr(data-placeholder)] [&>p]:m-0", }, }, }); diff --git a/components/theme-provider.tsx b/components/theme-provider.tsx deleted file mode 100644 index 51485dd..0000000 --- a/components/theme-provider.tsx +++ /dev/null @@ -1,12 +0,0 @@ -"use client"; - -import { ThemeProvider as NextThemesProvider } from "next-themes"; -import type { ReactNode } from "react"; - -export function ThemeProvider({ children }: { children: ReactNode }) { - return ( - - {children} - - ); -} diff --git a/components/theme-switcher.tsx b/components/theme-switcher.tsx deleted file mode 100644 index d78c0ea..0000000 --- a/components/theme-switcher.tsx +++ /dev/null @@ -1,31 +0,0 @@ -"use client"; - -import { MoonIcon, SunIcon, SunMoonIcon } from "lucide-react"; -import { useTheme } from "next-themes"; -import { useSyncExternalStore } from "react"; - -import { Button } from "@/components/ui/button"; - -const subscribe = () => () => {}; -const clientSnapshot = () => true; -const serverSnapshot = () => false; - -export function ThemeSwitcher() { - const { resolvedTheme, setTheme } = useTheme(); - const mounted = useSyncExternalStore(subscribe, clientSnapshot, serverSnapshot); - const isDark = resolvedTheme === "dark"; - const label = mounted ? (isDark ? "เปลี่ยนเป็นโหมดสว่าง" : "เปลี่ยนเป็นโหมดมืด") : "เปลี่ยนธีม"; - - return ( - - ); -} diff --git a/components/ui/sonner.tsx b/components/ui/sonner.tsx index ab0b8b9..d3f848c 100644 --- a/components/ui/sonner.tsx +++ b/components/ui/sonner.tsx @@ -1,14 +1,12 @@ "use client" import { Toaster as Sonner, type ToasterProps } from "sonner" -import { useTheme } from "next-themes" import { CircleCheckIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon, Loader2Icon } from "lucide-react" const Toaster = ({ ...props }: ToasterProps) => { - const { resolvedTheme } = useTheme() return (