Skip to content

Commit ba061f6

Browse files
puranampKevin-D23
andauthored
Update About Page Leadership Section (#691)
* use spreadsheet data instead of hardcoded * filter by officer name * modified about page to use parser script * modify import path * modify data import path * modify import path * better variable name * fix: changed attribute names on about page to fit <Officers> props * feat: about page generates officers using officer-parser script * fix: resolved merging issues * fix: linting issues * update: changed default images on about page to show ACM logo * fix: resolved photo distortion on about page * fix: linting issues * fix: removed redundant code --------- Co-authored-by: Kevin-D23 <[email protected]>
1 parent 5beb283 commit ba061f6

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

next.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ module.exports = {
1515
'jcfp.site',
1616
'photos.google.com',
1717
'photos.app.goo.gl',
18+
't4.ftcdn.net',
19+
'www.acmcyber.com',
20+
'media.licdn.com',
21+
'github.com',
1822
'www.uclaacm.com',
1923
'raw.githubusercontent.com',
2024
],

pages/about.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,30 @@ import Banner from '../components/Banner';
77
import Layout from '../components/Layout';
88
import Officers from '../components/OfficerCard';
99
import SocialMedia from '../components/SocialMedia';
10-
import data from '../data';
10+
import data from '../offoutput.json';
1111

1212
import acmCommittees from '../public/images/acm_committees.png';
1313
import boardcollage from '../public/images/boardcollage.png';
1414
import acmHowToJoin from '../public/images/how-to-join.png';
1515
import initiative from '../public/images/initiative.png';
1616
import styles from '../styles/pages/About.module.scss';
1717

18+
19+
function extractContent(officerContent) {
20+
const convertedData = officerContent.map(officer => ({
21+
name: officer.name,
22+
pronouns: officer.pronouns,
23+
role: (officer.committee.includes('Board') ? officer.role : officer.role + ', ' + officer.committee),
24+
committee: officer.committee,
25+
major: officer.major,
26+
year: officer.year,
27+
photo: (officer.photo != 'https://t4.ftcdn.net/jpg/02/15/84/43/360_F_215844325_ttX9YiIIyeaR7Ne6EaLLjMAmy4GvPC69.jpg' ? officer.photo : '/images/officers/acmlogocopy.jpg'), // if photo is default, display ACM logo
28+
})).filter(officer => officer.role.includes('President'));
29+
return convertedData;
30+
}
31+
1832
function About() {
19-
const { leadership } = data;
33+
const filteredOfficers = extractContent(data);
2034
return (
2135
<Layout>
2236
<NextSeo
@@ -199,7 +213,7 @@ function About() {
199213
growth of their committee.
200214
</p>
201215
<div className="grid-desktop-3">
202-
<Officers officers={leadership} size="compact" />
216+
<Officers officers={filteredOfficers} size="compact" />
203217
</div>
204218
</div>
205219
</div>

styles/components/OfficerCard.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
display: inline-block;
8484
height: 70px;
8585
margin: 25px 10px 0;
86+
object-fit: cover;
8687
width: 70px;
8788
}
8889

0 commit comments

Comments
 (0)