11import * as React from 'react'
22import { Menu , Icon , Drawer } from '@alifd/next'
3+ import { useTheme } from 'emotion-theming'
4+ import { Theme } from '../../../styles/theme'
35
46const { Item, Divider } = Menu
57
@@ -11,10 +13,10 @@ const styles = {
1113 margin : 0 ,
1214 height : '100%' ,
1315 } ,
14- active : {
15- color : ' white',
16- backgroundColor : 'rgb(85, 132, 255)' ,
17- } ,
16+ active : ( theme : Theme ) => ( {
17+ color : theme [ '$color- white'] ,
18+ backgroundColor : theme [ '$color-brand1-9' ] ,
19+ } ) ,
1820 itemText : {
1921 marginLeft : '0.5rem' ,
2022 } ,
@@ -31,6 +33,7 @@ const SideMenu = (props: Props) => {
3133 const onMenuClose = ( ) => {
3234 props . toggleVisible ( false )
3335 }
36+ const theme : Theme = useTheme ( )
3437 return (
3538 < Drawer
3639 bodyStyle = { styles . drawer }
@@ -44,7 +47,7 @@ const SideMenu = (props: Props) => {
4447 < Item
4548 key = "level"
4649 disabled = { props . page === 'level' }
47- style = { props . page === 'level' ? styles . active : { } }
50+ style = { props . page === 'level' ? styles . active ( theme ) : { } }
4851 onClick = { ( ) => {
4952 onMenuClose ( )
5053 props . setPage ( 'level' )
@@ -56,7 +59,7 @@ const SideMenu = (props: Props) => {
5659 < Item
5760 key = "review"
5861 disabled = { props . page === 'review' }
59- style = { props . page === 'review' ? styles . active : { } }
62+ style = { props . page === 'review' ? styles . active ( theme ) : { } }
6063 onClick = { ( ) => {
6164 onMenuClose ( )
6265 props . setPage ( 'review' )
@@ -69,7 +72,7 @@ const SideMenu = (props: Props) => {
6972 < Item
7073 key = "about"
7174 disabled = { props . page === 'about' }
72- style = { props . page === 'about' ? styles . active : { } }
75+ style = { props . page === 'about' ? styles . active ( theme ) : { } }
7376 onClick = { ( ) => {
7477 onMenuClose ( )
7578 props . setPage ( 'about' )
0 commit comments