@@ -4,58 +4,81 @@ import infoIcon from '../../../public/img/info-icon.svg';
44import calendarIcon from '../../../public/img/calendar-icon.svg' ;
55import contactIcon from '../../../public/img/contact-icon.svg' ;
66import { ABOUT , CONTACT , EVENTS } from '../../util/routeConstants' ;
7- import LinkButton from '../LinkButton/LinkButton' ;
7+ import menuIcon from '../../../public/img/menu-icon.svg' ;
8+ import closeIcon from '../../../public/img/close-icon.svg' ;
9+ import { Menu } from '@headlessui/react' ;
810
9- interface DropdownMenuProps {
10- onCloseMenu : ( ) => void ;
11- }
12-
13- export default function DropdownMenu ( { onCloseMenu } : DropdownMenuProps ) {
11+ export default function DropdownMenu ( ) {
1412 return (
15- < div className = "bg-white rounded-[10px] overflow-hidden w-[158px] h-fit absolute top-14 right-5 shadow-[0_0_50px_-12px_rgb(0,0,0,0.25)]" >
16- < ul >
17- < li className = "" >
18- < a
19- href = { ABOUT }
20- className = "w-full p-[10px] flex justify-start items-center"
21- onClick = { ( ) => onCloseMenu ( ) }
22- >
23- < Image src = { infoIcon } alt = "" width = { 25 } height = { 22 } />
24- < p className = "inline-block ml-[10px]" > About us</ p >
25- </ a >
26- </ li >
27- < li className = "" >
28- < a
29- href = { EVENTS }
30- className = "w-full p-[10px] flex justify-start items-center"
31- onClick = { ( ) => onCloseMenu ( ) }
32- >
33- < Image src = { calendarIcon } alt = "" width = { 25 } height = { 22 } />
34- < p className = "inline-block ml-[10px]" > Events</ p >
35- </ a >
36- </ li >
37- < li className = "" >
38- < a
39- href = { CONTACT }
40- className = "w-full p-[10px] flex justify-start items-center"
41- onClick = { ( ) => onCloseMenu ( ) }
42- >
43- < Image src = { contactIcon } alt = "" width = { 25 } height = { 25 } />
44- < p className = "inline-block ml-[10px]" > Contact</ p >
45- </ a >
46- </ li >
47- </ ul >
48- < div className = "" >
49- < LinkButton
50- className = "flex justify-center items-center bg-[#12A04E] text-white w-full font-montserrat text-xs py-[10px]"
51- href = "https://bit.ly/joinreactdevske"
52- target = "_blank"
53- rel = "noopener noreferrer"
54- onClick = { ( ) => onCloseMenu ( ) }
55- >
56- Join React.JS Kenya
57- </ LinkButton >
13+ < Menu >
14+ < Menu . Button >
15+ { ( { open } ) =>
16+ open ? (
17+ < div className = "inline-flex justify-center items-center w-[30px] " >
18+ < Image src = { closeIcon } alt = "" width = { 20 } height = { 20 } />
19+ </ div >
20+ ) : (
21+ < Image src = { menuIcon } alt = "" width = { 30 } height = { 30 } />
22+ )
23+ }
24+ </ Menu . Button >
25+ < div className = "bg-white rounded-[10px] overflow-hidden w-[158px] h-fit absolute top-14 right-5 shadow-[0_0_50px_-12px_rgb(0,0,0,0.25)]" >
26+ < Menu . Items >
27+ < Menu . Item >
28+ { ( { active } ) => (
29+ < a
30+ href = { ABOUT }
31+ className = { `w-full p-[10px] flex justify-start items-center ${
32+ active && 'bg-green-100'
33+ } `}
34+ >
35+ < Image src = { infoIcon } alt = "" width = { 25 } height = { 22 } />
36+ < p className = "inline-block ml-[10px]" > About us</ p >
37+ </ a >
38+ ) }
39+ </ Menu . Item >
40+ < Menu . Item >
41+ { ( { active } ) => (
42+ < a
43+ href = { EVENTS }
44+ className = { `w-full p-[10px] flex justify-start items-center ${
45+ active && 'bg-green-100'
46+ } `}
47+ >
48+ < Image src = { calendarIcon } alt = "" width = { 25 } height = { 22 } />
49+ < p className = "inline-block ml-[10px]" > Events</ p >
50+ </ a >
51+ ) }
52+ </ Menu . Item >
53+ < Menu . Item >
54+ { ( { active } ) => (
55+ < a
56+ href = { CONTACT }
57+ className = { `w-full p-[10px] flex justify-start items-center ${
58+ active && 'bg-green-100'
59+ } `}
60+ >
61+ < Image src = { contactIcon } alt = "" width = { 25 } height = { 25 } />
62+ < p className = "inline-block ml-[10px]" > Contact</ p >
63+ </ a >
64+ ) }
65+ </ Menu . Item >
66+ < Menu . Item >
67+ { ( { active } ) => (
68+ < a
69+ className = { `flex justify-center items-center bg-[#12A04E] text-white w-full font-montserrat text-xs py-[10px] ${
70+ active && 'bg-green-500'
71+ } `}
72+ href = "https://bit.ly/joinreactdevske"
73+ target = "_blank"
74+ rel = "noopener noreferrer"
75+ >
76+ Join React.JS Kenya
77+ </ a >
78+ ) }
79+ </ Menu . Item >
80+ </ Menu . Items >
5881 </ div >
59- </ div >
82+ </ Menu >
6083 ) ;
6184}
0 commit comments