diff --git a/apps/web/src/components/AbacusDisplayDropdown.tsx b/apps/web/src/components/AbacusDisplayDropdown.tsx index 0889093e..4d3a57c8 100644 --- a/apps/web/src/components/AbacusDisplayDropdown.tsx +++ b/apps/web/src/components/AbacusDisplayDropdown.tsx @@ -10,6 +10,7 @@ import { Z_INDEX } from '../constants/zIndex' import { css } from '../../styled-system/css' import { hstack, stack } from '../../styled-system/patterns' import { useAbacusSettings, useUpdateAbacusSettings } from '../hooks/useAbacusSettings' +import { useTheme } from '../contexts/ThemeContext' interface AbacusDisplayDropdownProps { isFullscreen?: boolean @@ -24,6 +25,8 @@ export function AbacusDisplayDropdown({ const { config, updateConfig, resetToDefaults } = useAbacusDisplay() const { data: abacusSettings } = useAbacusSettings() const { mutate: updateAbacusSettings } = useUpdateAbacusSettings() + const { resolvedTheme } = useTheme() + const isDark = resolvedTheme === 'dark' const handleOpenChange = (isOpen: boolean) => { setOpen(isOpen) @@ -43,18 +46,26 @@ export function AbacusDisplayDropdown({ py: '2', fontSize: 'sm', fontWeight: 'medium', - color: isFullscreen ? 'white' : 'gray.600', - bg: isFullscreen ? 'rgba(0, 0, 0, 0.85)' : 'white', + color: isFullscreen ? 'white' : isDark ? 'gray.200' : 'gray.600', + bg: isFullscreen ? 'rgba(0, 0, 0, 0.85)' : isDark ? 'gray.800' : 'white', border: '1px solid', - borderColor: isFullscreen ? 'rgba(255, 255, 255, 0.1)' : 'gray.200', + borderColor: isFullscreen + ? 'rgba(255, 255, 255, 0.1)' + : isDark + ? 'gray.700' + : 'gray.200', rounded: 'lg', shadow: 'lg', backdropFilter: isFullscreen ? 'blur(15px)' : 'none', transition: 'all', cursor: 'pointer', _hover: { - bg: isFullscreen ? 'rgba(0, 0, 0, 0.9)' : 'gray.50', - borderColor: isFullscreen ? 'rgba(255, 255, 255, 0.2)' : 'gray.300', + bg: isFullscreen ? 'rgba(0, 0, 0, 0.9)' : isDark ? 'gray.700' : 'gray.50', + borderColor: isFullscreen + ? 'rgba(255, 255, 255, 0.2)' + : isDark + ? 'gray.600' + : 'gray.300', }, _focus: { outline: 'none', @@ -85,11 +96,15 @@ export function AbacusDisplayDropdown({ 🎨 Abacus Style @@ -127,8 +142,8 @@ export function AbacusDisplayDropdown({ onClick={resetToDefaults} className={css({ fontSize: 'xs', - color: isFullscreen ? 'gray.300' : 'gray.500', - _hover: { color: isFullscreen ? 'white' : 'gray.700' }, + color: isFullscreen ? 'gray.300' : isDark ? 'gray.400' : 'gray.500', + _hover: { color: isFullscreen ? 'white' : isDark ? 'gray.200' : 'gray.700' }, })} > Reset @@ -137,7 +152,7 @@ export function AbacusDisplayDropdown({

Configure display across the entire app @@ -145,7 +160,7 @@ export function AbacusDisplayDropdown({ {/* Color Scheme */} - + updateConfig({ colorScheme: value as ColorScheme })} @@ -156,11 +171,12 @@ export function AbacusDisplayDropdown({ { value: 'alternating', label: 'Alternating' }, ]} isFullscreen={isFullscreen} + isDark={isDark} /> {/* Bead Shape */} - + updateConfig({ beadShape: value as BeadShape })} @@ -170,32 +186,36 @@ export function AbacusDisplayDropdown({ { value: 'square', label: '⬜ Square' }, ]} isFullscreen={isFullscreen} + isDark={isDark} /> {/* Toggle Options */}

- + updateConfig({ hideInactiveBeads: checked })} isFullscreen={isFullscreen} + isDark={isDark} /> - + updateConfig({ coloredNumerals: checked })} isFullscreen={isFullscreen} + isDark={isDark} /> - + updateConfig({ soundEnabled: checked })} isFullscreen={isFullscreen} + isDark={isDark} /> @@ -203,6 +223,7 @@ export function AbacusDisplayDropdown({ )} - + updateAbacusSettings({ nativeAbacusNumbers: checked }) } isFullscreen={isFullscreen} + isDark={isDark} />
@@ -272,10 +298,12 @@ function FormField({ label, children, isFullscreen = false, + isDark = false, }: { label: string children: React.ReactNode isFullscreen?: boolean + isDark?: boolean }) { return (
@@ -283,7 +311,7 @@ function FormField({ className={css({ fontSize: 'sm', fontWeight: 'medium', - color: isFullscreen ? 'white' : 'gray.900', + color: isFullscreen ? 'white' : isDark ? 'gray.100' : 'gray.900', })} > {label} @@ -297,10 +325,12 @@ function SwitchField({ checked, onCheckedChange, isFullscreen = false, + isDark = false, }: { checked: boolean onCheckedChange: (checked: boolean) => void isFullscreen?: boolean + isDark?: boolean }) { return ( e.stopPropagation()} // Prevent dropdown close only on the switch itself @@ -354,11 +388,13 @@ function RadioGroupField({ onValueChange, options, isFullscreen = false, + isDark = false, }: { value: string onValueChange: (value: string) => void options: Array<{ value: string; label: string }> isFullscreen?: boolean + isDark?: boolean }) { return ( @@ -371,8 +407,12 @@ function RadioGroupField({ h: '4', rounded: 'full', border: '2px solid', - borderColor: isFullscreen ? 'rgba(255, 255, 255, 0.3)' : 'gray.300', - bg: isFullscreen ? 'rgba(255, 255, 255, 0.1)' : 'white', + borderColor: isFullscreen + ? 'rgba(255, 255, 255, 0.3)' + : isDark + ? 'gray.600' + : 'gray.300', + bg: isFullscreen ? 'rgba(255, 255, 255, 0.1)' : isDark ? 'gray.800' : 'white', cursor: 'pointer', transition: 'all', _hover: { borderColor: isFullscreen ? 'blue.400' : 'brand.400' }, @@ -404,7 +444,7 @@ function RadioGroupField({