@@ -22,7 +22,11 @@ import type {
2222} from "@/features/notifications/hooks" ;
2323import { RelayMembersSettingsCard } from "@/features/relay-members/ui/RelayMembersSettingsCard" ;
2424import { cn } from "@/shared/lib/cn" ;
25- import { ACCENT_COLORS , useTheme } from "@/shared/theme/ThemeProvider" ;
25+ import {
26+ ACCENT_COLORS ,
27+ NEUTRAL_ACCENT ,
28+ useTheme ,
29+ } from "@/shared/theme/ThemeProvider" ;
2630import { SYNTAX_THEMES , isLightTheme } from "@/shared/theme/theme-loader" ;
2731import { ChannelTemplatesSettingsCard } from "./ChannelTemplatesSettingsCard" ;
2832import { DoctorSettingsPanel } from "./DoctorSettingsPanel" ;
@@ -128,7 +132,8 @@ function formatThemeLabel(name: string): string {
128132}
129133
130134function ThemeSettingsCard ( ) {
131- const { setTheme, themeName, accentColor, setAccentColor } = useTheme ( ) ;
135+ const { setTheme, themeName, isDark, accentColor, setAccentColor } =
136+ useTheme ( ) ;
132137 const [ search , setSearch ] = useState ( "" ) ;
133138 const didScrollRef = useRef ( false ) ;
134139 const activeRef = ( node : HTMLButtonElement | null ) => {
@@ -209,25 +214,34 @@ function ThemeSettingsCard() {
209214 < div className = "mt-4" >
210215 < h3 className = "mb-2 text-sm font-medium" > Accent Color</ h3 >
211216 < div className = "flex gap-2" >
212- { ACCENT_COLORS . map ( ( color ) => (
213- < button
214- className = { cn (
215- "flex h-7 w-7 items-center justify-center rounded-full transition-transform hover:scale-110" ,
216- accentColor === color . value &&
217- "ring-2 ring-ring ring-offset-2 ring-offset-background" ,
218- ) }
219- data-testid = { `accent-color-${ color . name . toLowerCase ( ) } ` }
220- key = { color . value }
221- onClick = { ( ) => setAccentColor ( color . value ) }
222- style = { { backgroundColor : color . value } }
223- title = { color . name }
224- type = "button"
225- >
226- { accentColor === color . value && (
227- < Check className = "h-3.5 w-3.5 text-white" />
228- ) }
229- </ button >
230- ) ) }
217+ { ACCENT_COLORS . map ( ( color ) => {
218+ const isNeutral = color . value === NEUTRAL_ACCENT ;
219+ const swatchColor = isNeutral
220+ ? "hsl(var(--foreground))"
221+ : color . value ;
222+ const checkClassName =
223+ isNeutral && isDark ? "text-black" : "text-white" ;
224+
225+ return (
226+ < button
227+ className = { cn (
228+ "flex h-7 w-7 items-center justify-center rounded-full border border-border/50 transition-transform hover:scale-110" ,
229+ accentColor === color . value &&
230+ "ring-2 ring-ring ring-offset-2 ring-offset-background" ,
231+ ) }
232+ data-testid = { `accent-color-${ color . name . toLowerCase ( ) } ` }
233+ key = { color . value }
234+ onClick = { ( ) => setAccentColor ( color . value ) }
235+ style = { { backgroundColor : swatchColor } }
236+ title = { color . name }
237+ type = "button"
238+ >
239+ { accentColor === color . value && (
240+ < Check className = { cn ( "h-3.5 w-3.5" , checkClassName ) } />
241+ ) }
242+ </ button >
243+ ) ;
244+ } ) }
231245 </ div >
232246 </ div >
233247 </ section >
0 commit comments