File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
- import React , { type FC , useState } from 'react' ;
1
+ import React , { type FC , useEffect , useState } from 'react' ;
2
2
import { Cluster , ClusterFeaturesEnum } from 'generated-sources' ;
3
3
import * as S from 'components/Nav/Nav.styled' ;
4
4
import MenuTab from 'components/Nav/Menu/MenuTab' ;
@@ -35,14 +35,18 @@ const ClusterMenu: FC<ClusterMenuProps> = ({
35
35
const hasFeatureConfigured = ( key : ClusterFeaturesEnum ) =>
36
36
features ?. includes ( key ) ;
37
37
38
- const [ isOpen , setIsOpen ] = useState ( ! ! opened ) ;
38
+ const [ isOpen , setIsOpen ] = useState ( opened ) ;
39
39
const location = useLocation ( ) ;
40
40
const navigate = useNavigate ( ) ;
41
41
const [ colorKey , setColorKey ] = useLocalStorage < ClusterColorKey > (
42
42
`clusterColor-${ name } ` ,
43
43
'transparent'
44
44
) ;
45
45
46
+ useEffect ( ( ) => {
47
+ if ( opened ) setIsOpen ( true ) ;
48
+ } , [ opened ] ) ;
49
+
46
50
const getIsMenuItemActive = ( path : string ) => {
47
51
return location . pathname . includes ( path ) ;
48
52
} ;
You can’t perform that action at this time.
0 commit comments