Skip to content

Commit f07af96

Browse files
authored
Gm updates (#739)
* basic gm page build * loading images and past GMs * prevent stretching of images * fixed set of errors * remove google maps border * lint fixes * lint fixes * more eslint * more eslint
1 parent 946434c commit f07af96

File tree

10 files changed

+129
-26
lines changed

10 files changed

+129
-26
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ offoutput.json
4040
townhall.json
4141
past-townhall.json
4242
gmData.json
43+
past-gm.json
4344

4445
# Local Netlify folder
4546
.netlify

components/Footer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ function Footer() {
114114
<FooterLinkElement
115115
path={path}
116116
/* TODO: resolve 404 with <Image /> component */
117-
/* eslint-disable-next-line @next/next/no-img-element */
118117
title={
118+
/* eslint-disable-next-line @next/next/no-img-element */
119119
<img
120120
className="committee-sidebar-image"
121121
src={wordmark_dark}

package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"@fortawesome/react-fontawesome": "^0.2.1",
1111
"@netlify/plugin-nextjs": "^5.9.4",
1212
"@testing-library/dom": "^10.4.0",
13+
"a": "^3.0.1",
1314
"dotenv": "^16.4.5",
1415
"googleapis": "^144.0.0",
1516
"moment": "^2.29.4",

pages/gm.js

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { faFileAlt, faVideo } from '@fortawesome/free-solid-svg-icons';
2+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3+
14
import Image from 'next/legacy/image';
25
import Link from 'next/link';
36
import { NextSeo } from 'next-seo';
@@ -7,6 +10,7 @@ import Countdown from 'react-countdown';
710
import Banner from '../components/Banner';
811
import Layout from '../components/Layout';
912
import gmData from '../gmData.json';
13+
import pastData from '../past-gm.json';
1014

1115
import aiLogo from '../public/images/committees/ai_wordmark.svg';
1216
import boardLogo from '../public/images/committees/board_wordmark.svg';
@@ -21,6 +25,11 @@ import wLogo from '../public/images/committees/w_wordmark.svg';
2125
import googleSlideLogo from '../public/images/slides.png';
2226
import winterGMgraphic from '../public/images/Winter_GM_2025_graphic.png';
2327

28+
const inlineButtonListStyle = {
29+
display: 'inline-block',
30+
marginBottom: '1em',
31+
};
32+
2433
const dayToName = (day) => {
2534
switch (day) {
2635
case 0:
@@ -156,6 +165,8 @@ const GMCountdown = (props) => {
156165
};
157166

158167
function gm() {
168+
169+
const pastGMs = [...pastData].reverse();
159170
const data = parseGMData(gmData);
160171
function countdownRenderer({ days, hours, minutes, seconds, completed }) {
161172
const { dayString, hourString, minuteString, secondString } =
@@ -335,6 +346,7 @@ function gm() {
335346
</div>
336347
{data.initiatives.map((item) => (
337348
<p key={item.id} className="gm-program-row">
349+
{/* eslint-disable-next-line @next/next/no-img-element */}
338350
{item}
339351
</p>
340352
))}
@@ -347,10 +359,67 @@ function gm() {
347359
friends!
348360
</p>
349361
</div>
350-
<p className="gm-program-row">All ACM officers</p>
362+
<div className="gm-program-row">All ACM officers</div>
351363
</div>
352364
</div>
353365
</div>
366+
{/* Past GMs */}
367+
<div className="content-container-medium">
368+
<hr></hr>
369+
<h2 className="text-center">Past General Meetings</h2>
370+
{pastGMs.map((pastGM, index) => (
371+
<div className="grid-tablet-2" key={index}>
372+
<div>
373+
<h3>{pastGM.title + ' // ' + pastGM.date}</h3>
374+
<p>{pastGM.description}</p>
375+
<ul className="list-unstyled">
376+
<li style={inlineButtonListStyle}>
377+
<Link href={pastGM.slides}>
378+
<a
379+
className="button"
380+
target="_blank"
381+
rel="noopener noreferrer"
382+
>
383+
<FontAwesomeIcon
384+
icon={faFileAlt}
385+
fixedWidth
386+
aria-hidden={true}
387+
/>{' '}
388+
Event Slides
389+
</a>
390+
</Link>
391+
</li>{' '}
392+
<li style={inlineButtonListStyle}>
393+
{pastGM.notes && pastGM.notes.trim() !== '' && (
394+
<Link href={pastGM.notes}>
395+
<a
396+
className="button"
397+
target="_blank"
398+
rel="noopener noreferrer"
399+
>
400+
<FontAwesomeIcon
401+
icon={faVideo}
402+
fixedWidth
403+
aria-hidden={true}
404+
/>{' '}
405+
Event Recording
406+
</a>
407+
</Link>
408+
)}
409+
</li>
410+
</ul>
411+
</div>
412+
<div>
413+
{/* eslint-disable-next-line @next/next/no-img-element */}
414+
<img
415+
src={pastGM.banner}
416+
alt={pastGM.alt_text}
417+
style={{ maxWidth: '100%' }}
418+
/>
419+
</div>
420+
</div>
421+
))}
422+
</div>
354423
</Layout>
355424
);
356425
}

pages/gm/f21.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,55 +213,55 @@ function F21() {
213213
Fall quarter
214214
</p>
215215
</div>
216-
{/* eslint-disable-next-line @next/next/no-img-element */}
217216
<p className="gm-program-row">
217+
{/* eslint-disable-next-line @next/next/no-img-element */}
218218
<img
219219
src="/images/committees/studio_wordmark.svg"
220220
alt="ACM studio"
221221
/>{' '}
222222
Christian Loanzon, Peter Sutarjo
223223
</p>
224-
{/* eslint-disable-next-line @next/next/no-img-element */}
225224
<p className="gm-program-row">
225+
{/* eslint-disable-next-line @next/next/no-img-element */}
226226
<img src="/images/committees/icpc_wordmark.svg" alt="ACM icpc" />{' '}
227227
Jacob Zhang
228228
</p>
229-
{/* eslint-disable-next-line @next/next/no-img-element */}
230229
<p className="gm-program-row">
230+
{/* eslint-disable-next-line @next/next/no-img-element */}
231231
<img
232232
src="/images/committees/design_wordmark.svg"
233233
alt="ACM design"
234234
/>{' '}
235235
Crystal Huynh, Muthu Palaniappan
236236
</p>
237-
{/* eslint-disable-next-line @next/next/no-img-element */}
238237
<p className="gm-program-row">
238+
{/* eslint-disable-next-line @next/next/no-img-element */}
239239
<img
240240
src="/images/committees/cyber_wordmark.svg"
241241
alt="ACM cyber"
242242
/>{' '}
243243
Josh Lee, Henry Chang
244244
</p>
245-
{/* eslint-disable-next-line @next/next/no-img-element */}
246245
<p className="gm-program-row">
246+
{/* eslint-disable-next-line @next/next/no-img-element */}
247247
<img
248248
src="/images/committees/teachLA_wordmark.svg"
249249
alt="ACM teachLA"
250250
/>{' '}
251251
Sophie Schoenmeyer, Chloe Uy
252252
</p>
253-
{/* eslint-disable-next-line @next/next/no-img-element */}
254253
<p className="gm-program-row">
254+
{/* eslint-disable-next-line @next/next/no-img-element */}
255255
<img src="/images/committees/w_wordmark.svg" alt="ACM w" /> Cindy
256256
Zhang, Lena O&apos;Grady
257257
</p>
258-
{/* eslint-disable-next-line @next/next/no-img-element */}
259258
<p className="gm-program-row">
259+
{/* eslint-disable-next-line @next/next/no-img-element */}
260260
<img src="/images/committees/ai_wordmark.svg" alt="ACM ai" />{' '}
261261
Justin Yi
262262
</p>
263-
{/* eslint-disable-next-line @next/next/no-img-element */}
264263
<p className="gm-program-row">
264+
{/* eslint-disable-next-line @next/next/no-img-element */}
265265
<img src="/images/committees/hack_wordmark.svg" alt="ACM hack" />{' '}
266266
Asha Kar, Eugene Lo
267267
</p>
@@ -274,16 +274,16 @@ function F21() {
274274
events
275275
</p>
276276
</div>
277-
{/* eslint-disable-next-line @next/next/no-img-element */}
278277
<p className="gm-program-row">
278+
{/* eslint-disable-next-line @next/next/no-img-element */}
279279
<img
280280
src="/images/committees/board_wordmark.svg"
281281
alt="ACM board"
282282
/>
283283
&nbsp;&nbsp;External: Tina Huang
284284
</p>
285-
{/* eslint-disable-next-line @next/next/no-img-element */}
286285
<p className="gm-program-row">
286+
{/* eslint-disable-next-line @next/next/no-img-element */}
287287
<img
288288
src="/images/committees/board_wordmark.svg"
289289
alt="ACM board"

pages/gm/w22.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,55 +213,55 @@ function W22() {
213213
Winter quarter
214214
</p>
215215
</div>
216-
{/* eslint-disable-next-line @next/next/no-img-element */}
217216
<p className="gm-program-row">
217+
{/* eslint-disable-next-line @next/next/no-img-element */}
218218
<img
219219
src="/images/committees/studio_wordmark.svg"
220220
alt="ACM studio"
221221
/>{' '}
222222
Christian Loanzon, Peter Sutarjo
223223
</p>
224-
{/* eslint-disable-next-line @next/next/no-img-element */}
225224
<p className="gm-program-row">
225+
{/* eslint-disable-next-line @next/next/no-img-element */}
226226
<img src="/images/committees/icpc_wordmark.svg" alt="ACM icpc" />{' '}
227227
Jacob Zhang
228228
</p>
229-
{/* eslint-disable-next-line @next/next/no-img-element */}
230229
<p className="gm-program-row">
230+
{/* eslint-disable-next-line @next/next/no-img-element */}
231231
<img
232232
src="/images/committees/design_wordmark.svg"
233233
alt="ACM design"
234234
/>{' '}
235235
Crystal Huynh, Muthu Palaniappan
236236
</p>
237-
{/* eslint-disable-next-line @next/next/no-img-element */}
238237
<p className="gm-program-row">
238+
{/* eslint-disable-next-line @next/next/no-img-element */}
239239
<img
240240
src="/images/committees/cyber_wordmark.svg"
241241
alt="ACM cyber"
242242
/>{' '}
243243
Josh Lee, Henry Chang
244244
</p>
245-
{/* eslint-disable-next-line @next/next/no-img-element */}
246245
<p className="gm-program-row">
246+
{/* eslint-disable-next-line @next/next/no-img-element */}
247247
<img
248248
src="/images/committees/teachLA_wordmark.svg"
249249
alt="ACM teachLA"
250250
/>{' '}
251251
Sophie Schoenmeyer, Chloe Uy
252252
</p>
253-
{/* eslint-disable-next-line @next/next/no-img-element */}
254253
<p className="gm-program-row">
254+
{/* eslint-disable-next-line @next/next/no-img-element */}
255255
<img src="/images/committees/w_wordmark.svg" alt="ACM w" /> Cindy
256256
Zhang, Lena O&apos;Grady
257257
</p>
258-
{/* eslint-disable-next-line @next/next/no-img-element */}
259258
<p className="gm-program-row">
259+
{/* eslint-disable-next-line @next/next/no-img-element */}
260260
<img src="/images/committees/ai_wordmark.svg" alt="ACM ai" />{' '}
261261
Justin Yi
262262
</p>
263-
{/* eslint-disable-next-line @next/next/no-img-element */}
264263
<p className="gm-program-row">
264+
{/* eslint-disable-next-line @next/next/no-img-element */}
265265
<img src="/images/committees/hack_wordmark.svg" alt="ACM hack" />{' '}
266266
Asha Kar, Eugene Lo
267267
</p>
@@ -274,16 +274,16 @@ function W22() {
274274
events
275275
</p>
276276
</div>
277-
{/* eslint-disable-next-line @next/next/no-img-element */}
278277
<p className="gm-program-row">
278+
{/* eslint-disable-next-line @next/next/no-img-element */}
279279
<img
280280
src="/images/committees/board_wordmark.svg"
281281
alt="ACM board"
282282
/>
283283
&nbsp;&nbsp;External: Tina Huang
284284
</p>
285-
{/* eslint-disable-next-line @next/next/no-img-element */}
286285
<p className="gm-program-row">
286+
{/* eslint-disable-next-line @next/next/no-img-element */}
287287
<img
288288
src="/images/committees/board_wordmark.svg"
289289
alt="ACM board"

pages/town-hall.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,11 @@ function TownHall() {
361361
</ul>
362362
</div>
363363
<div>
364-
<Image
364+
{/* eslint-disable-next-line @next/next/no-img-element */}
365+
<img
365366
src={pastTownHall.banner}
366367
alt={pastTownHall.alt_text}
367-
width={800}
368-
height={450}
369-
quality={70}
368+
style={{ maxWidth: '100%' }}
370369
/>
371370
</div>
372371
</div>

scripts/gm-generator.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,23 @@ async function fetchGMData() {
5555
return formattedData;
5656
}
5757

58+
async function fetchPastGMData() {
59+
const data = await getGoogleSheetData('PastGMs!A2:G');
60+
61+
// Format the rows into an array of objects
62+
const formattedData = data.map((row) => ({
63+
title: row[0],
64+
date: row[1],
65+
description: row[2],
66+
slides: row[3],
67+
notes: row[4],
68+
banner: row[5],
69+
alt_text: row[6],
70+
}));
71+
72+
return formattedData;
73+
}
74+
5875
// Write data from sheets to a json file
5976
async function writeToOutput(name, formattedData) {
6077
const output = JSON.stringify(formattedData);
@@ -68,4 +85,5 @@ async function writeToOutput(name, formattedData) {
6885
// Outputs all necessary json files
6986
async function writeAllOutputs() {
7087
writeToOutput('gmData.json', await fetchGMData());
88+
writeToOutput('past-gm.json', await fetchPastGMData());
7189
}

styles/components/GM.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
}
136136

137137
.map-frame {
138+
border-width: 0;
138139
height: 100%;
139140
width: 100%;
140141
}

0 commit comments

Comments
 (0)