File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,37 @@ function WarnIfUnsavedChanges() {
8787 ) ;
8888}
8989
90+ function Banner ( ) {
91+ // temporary banner to display funding opportunities
92+ const [ textObj , setTextObj ] = useState ( { } ) ;
93+
94+ useEffect ( ( ) => {
95+ const grant1 = {
96+ copy :
97+ 'Learn to make art with AI with the Social Software High School Summer Institute. Apply by June 1!' ,
98+ url : 'https://summer.ucla.edu/program/social-software-summer-institute/'
99+ } ;
100+
101+ const grant2 = {
102+ copy :
103+ 'Join us in contributing to p5.js——receive a $10,000 opportunity to grow within the contributor community!' ,
104+ url : 'https://processingfoundation.org/grants'
105+ } ;
106+
107+ const allMessages = [ grant1 , grant2 ] ;
108+ const randomIndex = Math . floor ( Math . random ( ) * allMessages . length ) ;
109+ const randomMessage = allMessages [ randomIndex ] ;
110+
111+ setTextObj ( randomMessage ) ;
112+ } , [ ] ) ;
113+
114+ return (
115+ < div className = "banner" >
116+ < a href = { textObj . url } > { textObj . copy } </ a >
117+ </ div >
118+ ) ;
119+ }
120+
90121export const CmControllerContext = React . createContext ( { } ) ;
91122
92123const IDEView = ( ) => {
@@ -170,6 +201,7 @@ const IDEView = () => {
170201 < Helmet >
171202 < title > { getTitle ( project ) } </ title >
172203 </ Helmet >
204+ < Banner />
173205 < IDEKeyHandlers getContent = { ( ) => cmRef . current ?. getContent ( ) } />
174206 < WarnIfUnsavedChanges />
175207 < Toast />
You can’t perform that action at this time.
0 commit comments