Skip to content

Commit 480b1ef

Browse files
committed
temporary banner for IDE view
1 parent 9bc4286 commit 480b1ef

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

client/modules/IDE/pages/IDEView.jsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
90121
export const CmControllerContext = React.createContext({});
91122

92123
const 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 />

0 commit comments

Comments
 (0)