File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
libs/remix-ui/top-bar/src/lib Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -290,11 +290,12 @@ export function RemixUiTopbar () {
290
290
}
291
291
292
292
useEffect ( ( ) => {
293
- const run = async ( ) => {
294
- const theme = await getCurrentTheme ( )
293
+ plugin . on ( 'theme' , 'themeChanged' , ( theme ) => {
295
294
setCurrentTheme ( theme )
295
+ } )
296
+ return ( ) => {
297
+ plugin . off ( 'theme' , 'themeChanged' )
296
298
}
297
- run ( )
298
299
} , [ ] )
299
300
300
301
const renameModalMessage = ( workspaceName ?: string ) => {
@@ -540,7 +541,14 @@ export function RemixUiTopbar () {
540
541
setShowTheme ( ! showTheme )
541
542
} }
542
543
>
543
- < i className = { `fas ${ currentTheme && currentTheme . name . includes ( 'Dark' ) ? 'fa-moon' : 'fa-sun-bright' } mr-2` } > </ i >
544
+ < i
545
+ className = {
546
+ `fas ${ currentTheme && currentTheme . name . includes ( 'Dark' ) ? 'fa-moon' : 'fa-sun-bright text-white' } mr-2`
547
+ }
548
+ onClick = { ( ) => {
549
+ setShowTheme ( ! showTheme )
550
+ } }
551
+ > </ i >
544
552
Theme
545
553
</ Dropdown . Toggle >
546
554
< Dropdown . Menu
You can’t perform that action at this time.
0 commit comments