@@ -9,6 +9,28 @@ import type { FormTranslationType } from '../../localization/defaults/form'
99import { formTranslation } from '../../localization/defaults/form'
1010import type { DialogProps } from '@/src/components/dialog/Dialog'
1111import { Dialog } from '@/src/components/dialog/Dialog'
12+ import { MonitorCog , MoonIcon , SunIcon } from 'lucide-react'
13+ import clsx from 'clsx'
14+
15+ type ThemeIconProps = {
16+ theme : ThemeType ,
17+ className ?: string ,
18+ }
19+ const ThemeIcon = ( { theme, className } : ThemeIconProps ) => {
20+ if ( theme === 'dark' ) {
21+ return (
22+ < MoonIcon className = { clsx ( 'w-4 h-4' , className ) } />
23+ )
24+ } else if ( theme === 'light' ) {
25+ return (
26+ < SunIcon className = { clsx ( 'w-4 h-4' , className ) } />
27+ )
28+ } else {
29+ return (
30+ < MonitorCog className = { clsx ( 'w-4 h-4' , className ) } />
31+ )
32+ }
33+ }
1234
1335type ThemeDialogTranslationAddon = {
1436 chooseTheme : string ,
@@ -18,10 +40,10 @@ type ThemeDialogTranslation = ThemeDialogTranslationAddon & ThemeTypeTranslation
1840
1941const defaultConfirmDialogTranslation : Translation < ThemeDialogTranslationAddon > = {
2042 en : {
21- chooseTheme : 'Choose your preferred theme' ,
43+ chooseTheme : 'Choose your preferred color theme. ' ,
2244 } ,
2345 de : {
24- chooseTheme : 'Wähle dein bevorzugtes Farbschema' ,
46+ chooseTheme : 'Wähle dein bevorzugtes Farbschema. ' ,
2547 }
2648}
2749
@@ -56,15 +78,28 @@ export const ThemeDialog = ({
5678 < Select
5779 value = { theme }
5880 onValueChanged = { ( theme ) => setTheme ( theme as ThemeType ) }
81+ iconAppearance = "right"
5982 contentPanelProps = { {
6083 className : 'z-100'
6184 } }
6285 buttonProps = { {
63- selectedDisplay : ( value ) => translation ( value as ThemeType )
86+ selectedDisplay : ( value ) => (
87+ < div className = "flex-row-2 items-center" >
88+ < ThemeIcon theme = { theme } />
89+ { translation ( value as ThemeType ) }
90+ </ div >
91+ ) ,
92+ className : 'min-w-32' ,
6493 } }
6594 >
66- { ThemeUtil . themes . map ( ( theme ) =>
67- < SelectOption key = { theme } value = { theme } > { translation ( theme ) } </ SelectOption > ) }
95+ { ThemeUtil . themes . map ( ( theme ) => (
96+ < SelectOption key = { theme } value = { theme } className = "gap-x-6 justify-between" >
97+ < div className = "flex-row-2 items-center" >
98+ < ThemeIcon theme = { theme } />
99+ { translation ( theme as ThemeType ) }
100+ </ div >
101+ </ SelectOption >
102+ ) ) }
68103 </ Select >
69104 < div className = "flex-row-4 mt-3 justify-end" >
70105 < SolidButton autoFocus color = "positive" onClick = { onClose } >
0 commit comments