@@ -11,6 +11,7 @@ const Overlay = styled.div`
11
11
left: 0;
12
12
top: 0;
13
13
background-color: rgba(0, 0, 0, 0.5);
14
+ display: ${ ( { isMenuPanelVisible } ) => ! isMenuPanelVisible && "none" } ;
14
15
` ;
15
16
16
17
const MenuPanelStyled = styled . div `
@@ -21,7 +22,15 @@ const MenuPanelStyled = styled.div`
21
22
top: 0;
22
23
right: 0;
23
24
height: 100vh;
24
- padding-top: 30px;
25
+ padding-top: 50px;
26
+ padding-right: 50px;
27
+ display: ${ ( { isMenuPanelVisible } ) => ! isMenuPanelVisible && "none" } ;
28
+ ` ;
29
+
30
+ const CloseButton = styled . span `
31
+ cursor: pointer;
32
+ display: flex;
33
+ justify-content: flex-end;
25
34
` ;
26
35
27
36
const Links = styled . ul `
@@ -46,12 +55,27 @@ const Links = styled.ul`
46
55
}
47
56
` ;
48
57
49
- const MenuPanel = ( { isAuthenticated, handleLogout } ) => {
58
+ const MenuPanel = ( {
59
+ isMenuPanelVisible,
60
+ toggleMenuPanelVisible,
61
+ isAuthenticated,
62
+ handleLogout,
63
+ } ) => {
50
64
return (
51
65
< >
52
- < Overlay > </ Overlay >
66
+ < Overlay isMenuPanelVisible = { isMenuPanelVisible } > </ Overlay >
53
67
54
- < MenuPanelStyled >
68
+ < MenuPanelStyled isMenuPanelVisible = { isMenuPanelVisible } >
69
+ < CloseButton
70
+ onClick = { ( ) => toggleMenuPanelVisible ( ! isMenuPanelVisible ) }
71
+ >
72
+ < img
73
+ src = "/icons/close-icon.svg"
74
+ alt = "Close Icon"
75
+ width = { 50 }
76
+ height = { 50 }
77
+ />
78
+ </ CloseButton >
55
79
< Links >
56
80
< li >
57
81
< Link to = "/artists" > Artists</ Link >
@@ -77,6 +101,8 @@ const MenuPanel = ({ isAuthenticated, handleLogout }) => {
77
101
} ;
78
102
79
103
MenuPanel . propTypes = {
104
+ isMenuPanelVisible : PropTypes . bool ,
105
+ toggleMenuPanelVisible : PropTypes . func ,
80
106
isAuthenticated : PropTypes . bool ,
81
107
handleLogout : PropTypes . func ,
82
108
} ;
0 commit comments