@@ -116,17 +116,11 @@ const IDEView = () => {
116116 } ;
117117
118118 const Banner = ( ) => {
119- // temporary banner to display funding opportunities
120- const textObj = {
121- copy :
122- 'Help us raise $20K to continue our mission of building equitable and accessible creative coding tools!' ,
123- url : 'https://p5js.org/donate/'
124- } ;
125-
126119 const [ isBannerVisible , setIsBannerVisible ] = useState ( true ) ;
127120
128- // eslint-disable-next-line consistent-return
129121 useEffect ( ( ) => {
122+ if ( ! isBannerVisible ) return ;
123+
130124 const script = document . createElement ( 'script' ) ;
131125 script . type = 'text/javascript' ;
132126 script . defer = true ;
@@ -148,6 +142,7 @@ const IDEView = () => {
148142
149143 document . body . appendChild ( script ) ;
150144
145+ // eslint-disable-next-line consistent-return
151146 return ( ) => {
152147 const existingScript = document . getElementById (
153148 'donorbox-popup-button-installer'
@@ -156,7 +151,7 @@ const IDEView = () => {
156151 existingScript . remove ( ) ;
157152 }
158153 } ;
159- } , [ ] ) ;
154+ } , [ isBannerVisible ] ) ;
160155
161156 const handleCloseBanner = ( ) => {
162157 setIsBannerVisible ( false ) ;
@@ -174,18 +169,49 @@ const IDEView = () => {
174169 }
175170 } ;
176171
177- return (
178- isBannerVisible && (
179- < div className = "banner" >
180- < a href = { textObj . url } target = "_blank" rel = "noopener noreferrer" >
181- { textObj . copy }
182- </ a >
183- < button className = "banner-close-button" onClick = { handleCloseBanner } >
184- < CrossIcon />
185- </ button >
186- </ div >
187- )
188- ) ;
172+ return isBannerVisible ? (
173+ < div
174+ style = { {
175+ position : 'fixed' ,
176+ top : '0' ,
177+ right : '23%' ,
178+ zIndex : 10000 ,
179+ display : 'flex' ,
180+ alignItems : 'center' ,
181+ gap : '10px' ,
182+ padding : '8px 18px' ,
183+ borderRadius : '5px'
184+ } }
185+ >
186+ < button
187+ style = { {
188+ background : 'transparent' ,
189+ border : 'none' ,
190+ color : 'white' ,
191+ fontSize : '16px' ,
192+ cursor : 'pointer' ,
193+ display : 'flex' ,
194+ alignItems : 'center' ,
195+ fontFamily : 'Verdana, sans-serif' ,
196+ padding : '8px 22px 8px 18px' ,
197+ borderRadius : '0px 0px 5px 5px' ,
198+ gap : '8px' ,
199+ width : 'fit-content' ,
200+ lineHeight : '24px' ,
201+ position : 'fixed' ,
202+ top : '61%' ,
203+ left : '20px' ,
204+ transform : 'translate(-50%, -50%) rotate(-90deg)' ,
205+ zIndex : 9999 ,
206+ overflow : 'hidden'
207+ } }
208+ onClick = { handleCloseBanner }
209+ aria-label = "Close Banner"
210+ >
211+ < CrossIcon />
212+ </ button >
213+ </ div >
214+ ) : null ;
189215 } ;
190216
191217 useEffect ( ( ) => {
0 commit comments