@@ -12,7 +12,11 @@ import { MenuContext } from './MenuContext'
12
12
const SidebarMenuItemLink = ( props ) =>
13
13
props . to || props . href ? (
14
14
props . to ? (
15
- < Link to = { props . to } style = { props . textStyle } className = { `${ props . classBase } __entry__link` } >
15
+ < Link
16
+ to = { props . to }
17
+ style = { props . textStyle }
18
+ className = { `${ props . classBase } __entry__link` }
19
+ >
16
20
{ props . children }
17
21
</ Link >
18
22
) : (
@@ -42,7 +46,7 @@ SidebarMenuItemLink.propTypes = {
42
46
onToggle : PropTypes . func ,
43
47
children : PropTypes . node ,
44
48
classBase : PropTypes . string ,
45
- textStyle : PropTypes . object
49
+ textStyle : PropTypes . object ,
46
50
}
47
51
48
52
/**
@@ -68,7 +72,7 @@ export class SidebarMenuItem extends React.Component {
68
72
href : PropTypes . string ,
69
73
exact : PropTypes . bool ,
70
74
noCaret : PropTypes . bool ,
71
- textStyle : PropTypes . object
75
+ textStyle : PropTypes . object ,
72
76
}
73
77
74
78
static defaultProps = {
@@ -119,11 +123,11 @@ export class SidebarMenuItem extends React.Component {
119
123
active : entry && entry . active ,
120
124
} )
121
125
const activeMenu = {
122
- color : 'white !important' ,
123
- backgroundColor : 'rgb(3, 169, 109)' ,
124
- }
125
- const nonaActiveMenu = {
126
+ color : '#ffffff' ,
127
+ background : 'linear-gradient(90deg, #00C9FF 0%, #92FE9D 100%)' ,
128
+ fontWeight : 'bold' ,
126
129
}
130
+ const nonaActiveMenu = { }
127
131
128
132
function getStyle ( itemClass ) {
129
133
if (
@@ -135,6 +139,17 @@ export class SidebarMenuItem extends React.Component {
135
139
}
136
140
return nonaActiveMenu
137
141
}
142
+
143
+ function getTextStyle ( itemClass ) {
144
+ if (
145
+ itemClass . includes ( 'active' , 0 ) &&
146
+ itemClass . includes ( 'submenu__entry' , 0 ) &&
147
+ ! itemClass . includes ( 'open' , 0 )
148
+ ) {
149
+ return { color : 'white' , fontWeight : 'inherit' }
150
+ }
151
+ return null
152
+ }
138
153
return (
139
154
< li
140
155
style = { getStyle ( itemClass ) }
@@ -148,7 +163,7 @@ export class SidebarMenuItem extends React.Component {
148
163
href = { this . props . href || null }
149
164
onToggle = { this . toggleNode . bind ( this ) }
150
165
classBase = { classBase }
151
- textStyle = { this . props . textStyle }
166
+ textStyle = { getTextStyle ( itemClass ) || this . props . textStyle }
152
167
>
153
168
{ this . props . icon &&
154
169
React . cloneElement ( this . props . icon , {
0 commit comments