@@ -60,9 +60,14 @@ const GetLabels = (labels) => (
6060const Roadmap = ( ) => {
6161 const [ item , setItem ] = useState ( [ ] ) ;
6262
63+ const setPopupOpen = ( open ) => {
64+ document . getElementById ( "popup" ) ?. classList . toggle ( styles [ "popup-container-visible" ] , open ) ;
65+ document . documentElement . classList . toggle ( 'roadmap-popup-open' , open ) ;
66+ } ;
67+
6368 const Item = ( { title, image, video, description, labels, external_link, external_link_title } ) => (
6469 < button key = { title } className = { clsx ( "item" , styles . item ) } onClick = { function ( ) {
65- document . getElementById ( "popup" ) . classList . add ( styles [ "popup-container-visible" ] ) ;
70+ setPopupOpen ( true ) ;
6671 setItem ( { title, image, video, description, labels, external_link, external_link_title } ) ;
6772 } } >
6873 { image ? < ImageExternal path = { image } /> : null }
@@ -94,7 +99,7 @@ const Roadmap = () => {
9499 < >
95100 < div id = "popup" className = { clsx ( "popup-container" , styles [ "popup-container" ] ) } >
96101 < button className = { clsx ( "popup-background" , styles [ "popup-background" ] ) } onClick = { function ( ) {
97- document . getElementById ( "popup" ) . classList . remove ( styles [ "popup-container-visible" ] ) ;
102+ setPopupOpen ( false ) ;
98103 } } > </ button >
99104 < div className = { clsx ( "popup-content" , styles [ "popup-content" ] ) } >
100105 { item . image ? < ImageExternal className = { clsx ( "popup-image" , styles [ "popup-image" ] ) } path = { item . image } /> : null }
@@ -108,7 +113,7 @@ const Roadmap = () => {
108113 < span id = "popup-labels" className = { clsx ( "popup-labels" , styles [ "popup-labels" ] ) } > { GetLabels ( item . labels ) } </ span >
109114 </ div >
110115 < button className = { clsx ( "popup-close" , styles [ "popup-close" ] ) } onClick = { function ( ) {
111- document . getElementById ( "popup" ) . classList . remove ( styles [ "popup-container-visible" ] ) ;
116+ setPopupOpen ( false ) ;
112117 } } > x</ button >
113118 </ div >
114119 < Layout title = "Roadmap" description = "nanos world Roadmap" >
0 commit comments