@@ -4,11 +4,7 @@ import { useAppContext } from '../utils/app.context';
4
4
import { classNames } from '../utils/misc' ;
5
5
import daisyuiThemes from 'daisyui/theme/object' ;
6
6
import { THEMES } from '../Config' ;
7
- import {
8
- Cog8ToothIcon ,
9
- MoonIcon ,
10
- Bars3Icon ,
11
- } from '@heroicons/react/24/outline' ;
7
+ import { Cog8ToothIcon , Bars3Icon } from '@heroicons/react/24/outline' ;
12
8
13
9
export default function Header ( ) {
14
10
const [ selectedTheme , setSelectedTheme ] = useState ( StorageUtils . getTheme ( ) ) ;
@@ -72,34 +68,50 @@ export default function Header() {
72
68
role = "button"
73
69
className = "btn btn-ghost m-1 w-8 h-8 p-0 rounded-full"
74
70
>
75
- < MoonIcon className = "w-5 h-5" />
71
+ < div className = "bg-base-100 grid shrink-0 grid-cols-2 gap-1 rounded-md p-1 shadow-sm" >
72
+ < div className = "bg-base-content size-1 rounded-full" > </ div > { ' ' }
73
+ < div className = "bg-primary size-1 rounded-full" > </ div > { ' ' }
74
+ < div className = "bg-secondary size-1 rounded-full" > </ div > { ' ' }
75
+ < div className = "bg-accent size-1 rounded-full" > </ div >
76
+ </ div >
76
77
</ div >
77
78
< ul
78
79
tabIndex = { 0 }
79
- className = "dropdown-content bg-base-300 rounded-box z-[1] w-52 p-2 shadow-2xl h-80 overflow-y-auto"
80
+ className = "dropdown-content rounded-box z-[1] w-50 p-2 shadow-2xl h-80 text-sm overflow-y-auto"
80
81
>
81
82
< li >
82
83
< button
83
84
className = { classNames ( {
84
- 'btn btn-sm btn-block btn-ghost justify-start ' : true ,
85
+ 'flex gap-3 p-2 btn btn-sm btn-ghost ' : true ,
85
86
'btn-active' : selectedTheme === 'auto' ,
86
87
} ) }
87
88
onClick = { ( ) => setTheme ( 'auto' ) }
88
89
>
89
- auto
90
+ < div className = "w-32 ml-6 pl-1 truncate text-left" > auto</ div >
90
91
</ button >
91
92
</ li >
92
93
{ THEMES . map ( ( theme ) => (
93
94
< li key = { theme } >
94
- < input
95
- type = "radio"
96
- name = "theme-dropdown"
97
- className = "theme-controller btn btn-sm btn-block btn-ghost justify-start"
98
- aria-label = { theme }
99
- value = { theme }
100
- checked = { selectedTheme === theme }
101
- onChange = { ( e ) => e . target . checked && setTheme ( theme ) }
102
- />
95
+ < button
96
+ className = { classNames ( {
97
+ 'flex gap-3 p-2 btn btn-sm btn-ghost' : true ,
98
+ 'btn-active' : selectedTheme === theme ,
99
+ } ) }
100
+ data-set-theme = { theme }
101
+ data-act-class = "[&_svg]:visible"
102
+ onClick = { ( ) => setTheme ( theme ) }
103
+ >
104
+ < div
105
+ data-theme = { theme }
106
+ className = "bg-base-100 grid shrink-0 grid-cols-2 gap-0.5 rounded-md p-1 shadow-sm"
107
+ >
108
+ < div className = "bg-base-content size-1 rounded-full" > </ div > { ' ' }
109
+ < div className = "bg-primary size-1 rounded-full" > </ div > { ' ' }
110
+ < div className = "bg-secondary size-1 rounded-full" > </ div > { ' ' }
111
+ < div className = "bg-accent size-1 rounded-full" > </ div >
112
+ </ div >
113
+ < div className = "w-32 truncate text-left" > { theme } </ div >
114
+ </ button >
103
115
</ li >
104
116
) ) }
105
117
</ ul >
0 commit comments