fix: appearance fix
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Appearance, useAppearance } from '@/hooks/use-appearance';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { LucideIcon, Monitor, Moon, Sun } from 'lucide-react';
|
||||
import { LucideIcon, Sun } from 'lucide-react';
|
||||
import { HTMLAttributes } from 'react';
|
||||
|
||||
export default function AppearanceToggleTab({
|
||||
@@ -11,8 +11,8 @@ export default function AppearanceToggleTab({
|
||||
|
||||
const tabs: { value: Appearance; icon: LucideIcon; label: string }[] = [
|
||||
{ value: 'light', icon: Sun, label: 'Light' },
|
||||
{ value: 'dark', icon: Moon, label: 'Dark' },
|
||||
{ value: 'system', icon: Monitor, label: 'System' },
|
||||
// { value: 'dark', icon: Moon, label: 'Dark' },
|
||||
// { value: 'system', icon: Monitor, label: 'System' },
|
||||
];
|
||||
|
||||
return (
|
||||
|
||||
@@ -42,7 +42,7 @@ const handleSystemThemeChange = () => {
|
||||
|
||||
export function initializeTheme() {
|
||||
const savedAppearance =
|
||||
(localStorage.getItem('appearance') as Appearance) || 'system';
|
||||
(localStorage.getItem('appearance') as Appearance) || 'light';
|
||||
|
||||
applyTheme(savedAppearance);
|
||||
|
||||
@@ -51,7 +51,7 @@ export function initializeTheme() {
|
||||
}
|
||||
|
||||
export function useAppearance() {
|
||||
const [appearance, setAppearance] = useState<Appearance>('system');
|
||||
const [appearance, setAppearance] = useState<Appearance>('light');
|
||||
|
||||
const updateAppearance = useCallback((mode: Appearance) => {
|
||||
setAppearance(mode);
|
||||
@@ -69,7 +69,7 @@ export function useAppearance() {
|
||||
const savedAppearance = localStorage.getItem(
|
||||
'appearance',
|
||||
) as Appearance | null;
|
||||
updateAppearance(savedAppearance || 'system');
|
||||
updateAppearance(savedAppearance || 'light');
|
||||
|
||||
return () =>
|
||||
mediaQuery()?.removeEventListener(
|
||||
|
||||
Reference in New Issue
Block a user