Redesign and update 'Meet the Team' data #452
Merged
j285he
merged 17 commits from j285he-meet-the-team-s22
into main
9 months ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'j285he-meet-the-team-s22'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Closes #450. Closes #436.
Redesign and update 'Meet the Team' datato WIP: Redesign and update 'Meet the Team' data 10 months agoWIP: Redesign and update 'Meet the Team' datato Redesign and update 'Meet the Team' data 10 months agoRedesign and update 'Meet the Team' datato WIP: Redesign and update 'Meet the Team' data 10 months agoWIP: Redesign and update 'Meet the Team' datato Redesign and update 'Meet the Team' data 10 months agoimport React from "react";
import { Metadata } from "@/lib/team";
Components should be isolated and self contained. They should not be importing things from outside the /components folder.
This is why we duplicated an interface here to
TeamMemberProps
. This makes the component independent of whatever the Metadata is. If in the future the metadata changes, the props of this component would also change (or the other way around) - which we may not want.photography = sortTeam(photography);
website = sortTeam(website);
systems = sortTeam(systems);
terminal = sortTeam(terminal);
This is getting a little out of hand. With these many teams, can you move them into a 2d array?
return {
props: {
execs,
coordinators,
this way you can make the props: execs (a 1d array) and teams: (a 2d array)
What about the
teams
array on line 64? Won't we need to change eachmembers
property to be (for example)members: teams[0]
?I was also thinking perhaps
teams
could go in a contents .json file but let me know what you think is bestYeah if we move it into an array here, then we won't need the array on line 64, and a lot of hardcoding would go away.
Perhaps putting all the teams in one place would be a better idea.
Eg - instead of
/contents/team/team-name.json
we can put all the json data in an array in/contents/team/non-execs.json
which could follow the following format:But don't block this PR on this change. Let's get the content updated first and you can file an issue to get back to this :)
const teamMembers: Metadata[] = [];
const teamOthers: Metadata[] = [];
for (const member of team) {
if (!Object.prototype.hasOwnProperty.call(member, "role")) {
if (member.hasOwnProperty("role")) {
or
if (member["role"] != null)
}
teamLeads.sort((a, b) => a.name.localeCompare(b.name));
teamMembers.sort((a, b) => a.name.localeCompare(b.name));
teamOthers.sort((a, b) => a.name.localeCompare(b.name));
nit: Instead of using that for loop, I would suggest using a more declarative approach.
yay all the old pictures are gone!
Left comments for code nits, but looks good overall :) Thanks @j285he!!
"name": "Andrew Wang"
},
{
"name": "Anthony Brennan",
@j285he I suspect we want to keep all these alumni-labelled peeps, but let's let @r389li confirm that. Sorry for not being more clear with expectations 😅
@a258wang Correct, we should keep them. Syscom membership doesn't usually change. This term, however, Max graduated, so he is now Alumni, and I misidentified Edwin as alumni when he's in fact a current student. Also if someone could link syscom and termcom in my bio to the relevant sections on the page that would be appreciated!
.filter(({ role }) => role === "Team Lead")
.sort(memberComparer);
const general = team
.filter(({ role }) => role == null || role === "")
Would
role == null || role === ""
be equivalent to!role
here? (and also a couple lines below)Just one tiny (non-blocking) nitpick, but otherwise this looks great! 🚢
Once this is merged, could you please create a ticket to clean up how we store/process the team data, as discussed in the comments of this PR? Thanks!
e1af564621
into main 9 months agoReviewers
e1af564621
.