This repository was archived by the owner on Sep 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ import { connect, createState } from './reactive';
2828import { actions , store , Viewer } from './stream-store' ;
2929import themes from './themes' ;
3030import { AuthorizationProps , HalLink , HalLinks } from './types' ;
31- import { mediaTypes } from './utils' ;
31+ import { mediaTypes , preventDefault } from './utils' ;
3232
3333const getSelfAlias = ( links : HalLinks ) =>
3434 Object . keys ( links )
@@ -90,14 +90,16 @@ const lightbulbs: { [key: string]: ComponentType<SvgIconProps> } = {
9090 light : LightbulbOutline ,
9191} ;
9292
93+ const onThemeToggle = preventDefault ( ( ) => themes . actions . type . next ( void 0 ) ) ;
94+
9395const Hero = ( { theme } : { theme : Theme } ) => (
9496 < AppBar position = { 'static' } >
9597 < Toolbar >
9698 < SqlStreamStore color = { 'action' } />
9799 < Typography variant = { 'h6' } color = { 'inherit' } >
98100 Sql Stream Store
99101 </ Typography >
100- < IconButton onClick = { ( ) => themes . actions . type . next ( void 0 ) } >
102+ < IconButton onClick = { onThemeToggle } >
101103 { createElement ( lightbulbs [ theme . palette . type ] ) }
102104 </ IconButton >
103105 </ Toolbar >
You can’t perform that action at this time.
0 commit comments