feat :just remove theme switch
This commit is contained in:
@@ -279,7 +279,7 @@ function OverviewPoster({
|
||||
<DndContext sensors={posterSensors} onDragEnd={handlePosterDragEnd}>
|
||||
<div
|
||||
ref={posterRef}
|
||||
className="dark relative isolate aspect-square size-full overflow-hidden bg-black text-white @container"
|
||||
className="relative isolate aspect-square size-full overflow-hidden bg-black text-white @container"
|
||||
style={{ fontFamily: '"Genshin Overview", sans-serif' }}
|
||||
>
|
||||
{composition.backgroundUrl ? (
|
||||
|
||||
@@ -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 }: {
|
||||
<span className="hidden lg:inline">ไกด์เกนชินไม่ใช่เกมมือถือ</span>
|
||||
</Link>
|
||||
{children}
|
||||
<ThemeSwitcher />
|
||||
<NotificationBell />
|
||||
<PublicAccountMenu />
|
||||
</div>
|
||||
|
||||
@@ -35,7 +35,7 @@ export function ConstellationImage({
|
||||
const footer = group.note;
|
||||
|
||||
return (
|
||||
<div className="dark relative isolate size-375 overflow-hidden bg-[#070b20] font-heading text-white">
|
||||
<div className="relative isolate size-375 overflow-hidden bg-[#070b20] font-heading text-white">
|
||||
<GuideExportBranding backgroundUrl={background} variant="constellation" />
|
||||
|
||||
<div className="absolute inset-x-20 top-7 z-10 flex items-start justify-center gap-5">
|
||||
|
||||
@@ -496,7 +496,7 @@ export function GuideImageExport({
|
||||
<div
|
||||
ref={previewRef}
|
||||
data-export-language={language}
|
||||
className={cn("dark bg-background p-10 text-foreground", captureClassName)}
|
||||
className={cn("bg-background p-10 text-foreground", captureClassName)}
|
||||
style={{ width, height }}
|
||||
>
|
||||
<style>{'[data-export-language="th"] [data-export-lang="en"],[data-export-language="en"] [data-export-lang="th"]{display:none!important}'}</style>
|
||||
@@ -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 }}
|
||||
|
||||
@@ -121,7 +121,7 @@ export function MaterialPoster({
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn("dark @container relative aspect-4/5 w-full select-none overflow-hidden bg-black text-white", interactive && characterArtUrl && "cursor-move", className)}
|
||||
className={cn("@container relative aspect-4/5 w-full select-none overflow-hidden bg-black text-white", interactive && characterArtUrl && "cursor-move", className)}
|
||||
style={{ backgroundImage: background }}
|
||||
onPointerDown={handlePointerDown}
|
||||
onPointerMove={handlePointerMove}
|
||||
|
||||
@@ -64,7 +64,7 @@ export function WeaponComparisonImage({
|
||||
const maximum = Math.max(100, ...values);
|
||||
|
||||
return (
|
||||
<div className="dark relative isolate w-300 overflow-hidden bg-[#070b20] px-14 pt-10 pb-12 font-heading text-white">
|
||||
<div className="relative isolate w-300 overflow-hidden bg-[#070b20] px-14 pt-10 pb-12 font-heading text-white">
|
||||
<GuideExportBranding backgroundUrl={guide.character.splashImageUrl ?? guide.coverUrl} />
|
||||
<header className="relative z-10 flex flex-col items-center px-48 text-center drop-shadow-[0_4px_3px_rgba(0,0,0,0.9)]">
|
||||
<h2 className="max-w-full text-5xl leading-tight font-bold text-balance">
|
||||
|
||||
@@ -12,7 +12,7 @@ export function RichTextContent({
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn("prose prose-sm dark:prose-invert max-w-none leading-snug [&>p]:m-0", className)}
|
||||
className={cn("prose prose-sm prose-invert max-w-none leading-snug [&>p]:m-0", className)}
|
||||
dangerouslySetInnerHTML={{ __html: sanitizeRichTextHtml(html) }}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -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 (
|
||||
<NextThemesProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>
|
||||
{children}
|
||||
</NextThemesProvider>
|
||||
);
|
||||
}
|
||||
@@ -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 (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
aria-label={label}
|
||||
title={label}
|
||||
disabled={!mounted}
|
||||
onClick={() => setTheme(isDark ? "light" : "dark")}
|
||||
>
|
||||
{!mounted ? <SunMoonIcon /> : isDark ? <SunIcon /> : <MoonIcon />}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
@@ -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 (
|
||||
<Sonner
|
||||
theme={resolvedTheme === "dark" ? "dark" : "light"}
|
||||
theme="dark"
|
||||
className="toaster group"
|
||||
icons={{
|
||||
success: (
|
||||
|
||||
Reference in New Issue
Block a user