Skip to content

Commit

Permalink
add chapter leader and remove president position
Browse files Browse the repository at this point in the history
  • Loading branch information
wkim10 authored and nickbar01234 committed Apr 4, 2024
1 parent 2e1a2d5 commit d013bbc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
8 changes: 6 additions & 2 deletions src/components/TileGrid/UserTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,17 @@ export function UserTile({
{student ? (
<p
className={
(student.position === ""
(student.position === "" && student.role !== "CHAPTER_LEADER"
? "bg-med-tan text-dark-teal "
: "bg-[#AE583C] font-bold text-white ") +
"mt-5 inline-block text-ellipsis whitespace-nowrap rounded-3xl px-3.5 py-1.5 text-center text-xs"
}
>
{student.position === "" ? "Member" : student.position}
{student.role === "CHAPTER_LEADER"
? "Chapter Leader"
: student.position === ""
? "Member"
: student.position}
</p>
) : null}
{/* @TODO: Add pronouns once we add to student field */}
Expand Down
20 changes: 13 additions & 7 deletions src/utils/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,22 @@ export const seniorFullName = (senior: Senior) =>

export const sortedStudents = (students: User[]) => {
const positionOrder: PositionOrder = {
President: 0,
"Social Coordinator": 1,
"Senior Outreach Coordinator": 2,
"Head of Media": 3,
Secretary: 4,
Treasurer: 5,
"Match Coordinator": 6,
"Social Coordinator": 0,
"Senior Outreach Coordinator": 1,
"Head of Media": 2,
Secretary: 3,
Treasurer: 4,
"Match Coordinator": 5,
};

const comparePositions = (a: User, b: User) => {
if (a.role === "CHAPTER_LEADER" && b.role !== "CHAPTER_LEADER") {
return -1;
}
if (b.role === "CHAPTER_LEADER" && a.role !== "CHAPTER_LEADER") {
return 1;
}

const orderA = positionOrder[a.position] || Infinity;
const orderB = positionOrder[b.position] || Infinity;

Expand Down

0 comments on commit d013bbc

Please sign in to comment.