Skip to content

Commit 56aa78e

Browse files
ideen1dependabot[bot]hannagracecburtonjongjustin-phxm
authored
Merge to prod (#160)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Hanna <[email protected]> Co-authored-by: Burton Jong <[email protected]> Co-authored-by: burtonjong <[email protected]> Co-authored-by: Justin Pham <[email protected]> Co-authored-by: hannagracec <[email protected]> Co-authored-by: Natalie <[email protected]>
1 parent 9b9f6bc commit 56aa78e

15 files changed

+220
-208
lines changed

amplify/data/resource.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ const schema = a
2525
allow.ownerDefinedIn("profileOwner").to(["read", "create"]),
2626
allow.groups(["Admin"]).to(["read", "update", "create"]),
2727
]),
28-
email: a.string(),
28+
email: a
29+
.string()
30+
.authorization((allow) => [
31+
allow.ownerDefinedIn("profileOwner").to(["read", "create"]),
32+
allow.groups(["Admin"]).to(["read", "create"]),
33+
]),
2934
institution: a.string(),
3035
completedRegistration: a.boolean(),
3136
allergies: a.string(),

src/app/globals.css

+26
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,32 @@ body {
3232
rgb(var(--background-start-rgb));
3333
}
3434

35+
@media (max-width: 768px) {
36+
.text-shadow-outline {
37+
text-shadow:
38+
-2px -2px 0 #7055fd,
39+
2px -2px 0 #7055fd,
40+
-2px 2px 0 #7055fd,
41+
2px 2px 0 #7055fd,
42+
-2px -2px 0 #7055fd,
43+
2px -2px 0 #7055fd,
44+
-2px 2px 0 #7055fd,
45+
2px 2px 0 #7055fd;
46+
}
47+
}
48+
49+
.text-shadow-title {
50+
text-shadow:
51+
-2px -2px 0 #7055fd,
52+
2px -2px 0 #7055fd,
53+
-2px 2px 0 #7055fd,
54+
2px 2px 0 #7055fd,
55+
-2px -2px 0 #7055fd,
56+
2px -2px 0 #7055fd,
57+
-2px 2px 0 #7055fd,
58+
2px 2px 0 #7055fd;
59+
}
60+
3561
.lds-ring,
3662
.lds-ring div {
3763
box-sizing: border-box;

src/app/judging/JudgingDashboard.tsx

+5-9
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,10 @@ export default async function JudgingDashboard() {
1212
};
1313

1414
return (
15-
<>
16-
<div className={"flex h-screen justify-center text-blackish"}>
17-
<div className={"w-full max-w-[1500px] p-6"}>
18-
<Greetings accentColor="text-dark-pink" />
19-
<h2 className={"py-4 text-xl font-semibold"}>Assigned Teams</h2>
20-
<JudgingTable hackathonData={hackathonData} />
21-
</div>
22-
</div>
23-
</>
15+
<div className="flex w-full flex-1 flex-col items-center p-6 text-blackish">
16+
<Greetings accentColor="text-dark-pink" />
17+
<h2 className="flex w-full py-4 text-xl font-semibold">Assigned Teams</h2>
18+
<JudgingTable hackathonData={hackathonData} />
19+
</div>
2420
);
2521
}

src/app/judging/JudgingTable.tsx

+48-74
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use client";
22

3-
import { useMemo, useState } from "react";
3+
import { useState } from "react";
4+
import Skeleton from "react-loading-skeleton";
45

56
import type { Schema } from "@/amplify/data/resource";
67
import LoadingRing from "@/components/LoadingRing";
@@ -48,36 +49,34 @@ export default function JudgingTable({
4849
return teams;
4950
},
5051
});
51-
if (
52-
roomIsFetching ||
53-
teamsForRoomIsFetching ||
54-
!roomData ||
55-
!teamsForRoomData
56-
) {
57-
return <div>Loading...</div>;
52+
const isFetching = roomIsFetching || teamsForRoomIsFetching;
53+
if (isFetching || !roomData || !teamsForRoomData) {
54+
return (
55+
<div className="flex flex-1">
56+
<Skeleton className="h-full" containerClassName="flex-1" />
57+
</div>
58+
);
5859
}
5960

60-
const panelData = useMemo(() => {
61-
return [
62-
{
63-
icon: "/svgs/judging/team_icon.svg",
64-
alt: "Teams assigned icon",
65-
stat: teamsForRoomData.length,
66-
text: `Teams Assigned to ${roomData.name}`,
67-
},
68-
{
69-
icon: "/svgs/judging/teams_left.svg",
70-
alt: "Teams left icon",
71-
stat: teamsForRoomData.filter(
72-
async (team) =>
73-
(await team?.scores())?.data.filter(
74-
(score) => score.judgeId === currentUser.username,
75-
).length === 0,
76-
).length,
77-
text: "Teams Left To Score",
78-
},
79-
];
80-
}, [roomData, teamsForRoomData]);
61+
const panelData = [
62+
{
63+
icon: "/svgs/judging/team_icon.svg",
64+
alt: "Teams assigned icon",
65+
stat: teamsForRoomData.length,
66+
text: `Teams Assigned to ${roomData.name}`,
67+
},
68+
{
69+
icon: "/svgs/judging/teams_left.svg",
70+
alt: "Teams left icon",
71+
stat: teamsForRoomData.filter(
72+
async (team) =>
73+
(await team?.scores())?.data.filter(
74+
(score) => score.judgeId === currentUser.username,
75+
).length === 0,
76+
).length,
77+
text: "Teams Left To Score",
78+
},
79+
];
8180
const handleCreateScoreClick = (teamId: string) => {
8281
setSelectedTeamId(teamId);
8382
};
@@ -89,57 +88,32 @@ export default function JudgingTable({
8988
setSelectedTeamId("");
9089
};
9190

92-
const isFetching = roomIsFetching || teamsForRoomIsFetching;
93-
94-
const tableHeaders = [
95-
{ columnHeader: "Team Name", className: "w-1/3 rounded-tl-lg" },
96-
...hackathonData.scoringComponents.map((component) => ({
97-
columnHeader: component.friendlyName,
98-
className: "w-fit",
99-
})),
100-
...hackathonData.scoringSidepots.map((component) => ({
101-
columnHeader: (
102-
<div className="flex flex-col">
103-
<p>Sidepot:</p>
104-
{component.friendlyName}
105-
</div>
106-
),
107-
className: "w-fit bg-pastel-pink",
108-
})),
109-
];
11091
return isFetching ? (
111-
<div
112-
className={
113-
"flex h-screen w-full items-center justify-center bg-pastel-pink"
114-
}
115-
>
92+
<div className="flex size-full flex-1 items-center justify-center bg-pastel-pink">
11693
<LoadingRing />
11794
</div>
11895
) : (
119-
<div className={"flex h-screen justify-center text-blackish"}>
120-
<div className="mb-4 flex w-full max-w-[1500px] p-6">
121-
<div className="mr-4 flex w-1/4 flex-col space-y-4">
96+
<>
97+
<div className="flex w-full flex-col justify-center gap-4 py-6 xl:flex-row">
98+
<div className=" flex w-full flex-row gap-4 xl:w-1/4 xl:flex-col">
12299
{panelData.map((item, index) => (
123-
<div key={index} className="h-1/2">
124-
<StatsPanel
125-
icon={item.icon}
126-
alt={item.alt}
127-
stat={item.stat}
128-
subheader={item.text}
129-
/>
130-
</div>
100+
<StatsPanel
101+
key={index}
102+
icon={item.icon}
103+
alt={item.alt}
104+
stat={item.stat}
105+
subheader={item.text}
106+
/>
131107
))}
132108
</div>
133-
<div className="w-3/4">
134-
<ScoresTable
135-
tableHeaders={tableHeaders}
136-
tableData={teamsForRoomData as Schema["Team"]["type"][]}
137-
onCreateScoreClick={handleCreateScoreClick}
138-
onEditScoreClick={handleEditScoreClick}
139-
colorScheme="pink"
140-
entriesPerPage={150}
141-
/>
142-
</div>
109+
<ScoresTable
110+
tableData={teamsForRoomData as Schema["Team"]["type"][]}
111+
onCreateScoreClick={handleCreateScoreClick}
112+
onEditScoreClick={handleEditScoreClick}
113+
colorScheme="pink"
114+
entriesPerPage={150}
115+
hackathonData={hackathonData}
116+
/>
143117
</div>
144118
{selectedTeam !== "" && (
145119
<ModalPopup
@@ -148,6 +122,6 @@ export default function JudgingTable({
148122
teamId={selectedTeam}
149123
/>
150124
)}
151-
</div>
125+
</>
152126
);
153127
}

src/app/judging/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const metadata: Metadata = {
1919
};
2020
export default function Judging() {
2121
return (
22-
<main className="w-full bg-dashboard-grey">
22+
<main className="flex w-full flex-1 flex-col gap-4 bg-dashboard-grey">
2323
<JudgingDashboard />
2424
</main>
2525
);

src/app/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { enableLandingPage } from "@/featureFlags";
1010
export const revalidate = 600;
1111
const Home = () => {
1212
return (
13-
<main className="">
13+
<main className="w-full">
1414
{enableLandingPage ? (
1515
<PagePlaceholder />
1616
) : (

src/components/LandingPage/AboutEventTile.tsx

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ import type { ReactNode } from "react";
33

44
import { fetchContent } from "@/app/actions";
55

6-
const EVENT_DETAILS_SECTION_STYLES = "flex flex-col items-center bg-white";
6+
const EVENT_DETAILS_SECTION_STYLES =
7+
"flex w-full flex-col items-center bg-white";
78
const EVENT_DETAILS_CONTENT_STYLES =
8-
"bg-pastel-pink border-4 border-dark-pink rounded-3xl my-4 lg:my-8 flex md:flex md:justify-center md:max-w-[1100px] md:shadow-[15px_15px_0px_0px_#FF4D6F]";
9+
"bg-pastel-pink border-4 border-dark-pink rounded-3xl mt-4 mb-8 xl:mt-8 xl:mb-12 flex flex-col xl:flex-row w-4/5 shadow-[15px_15px_0px_0px_#FF4D6F]";
910
const EVENT_IMAGE_CONTAINER_STYLES =
10-
"bg-blackish rounded-t-20 border-b-4 border-dark-pink w-72 h-64 md:rounded-tr-none md:rounded-l-3xl md:border-b-0 md:border-r-4 md:h-[370px] md:w-[40vw]";
11+
"bg-blackish border-b-4 border-dark-pink size-full xl:size-1/2 rounded-t-2xl xl:rounded-tr-none xl:rounded-l-2xl xl:border-b-0 xl:border-r-4 ";
1112
const EVENT_IMAGE_STYLES =
12-
"w-full h-full object-cover md:rounded-l-2xl md:rounded-tl-2xl md:rounded-t-none rounded-t-2xl";
13+
"w-full h-full object-cover rounded-bl-none rounded-t-2xl xl:rounded-tr-none xl:rounded-l-2xl";
1314
const EVENT_DETAILS_CONTAINER_STYLES =
14-
"flex items-center w-72 h-[370px] rounded-b-20 md:w-[50vw] md:rounded-bl-none md:rounded-r-2xl";
15+
"flex items-center w-full xl:w-1/2 rounded-b-20 md:rounded-bl-none md:rounded-r-2xl";
1516
const EVENT_DETAIL_STYLES = "flex items-center ml-10";
1617
const EVENT_DETAIL_TITLE_STYLES =
1718
"text-lg text-blackish font-extrabold leading-tight";

src/components/LandingPage/HeroSectionTile.tsx

+2-18
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,6 @@ import type { HackathonDetails } from "@/app/contentfulTypes";
22

33
import HeroCallToAction from "./HeroCallToAction";
44

5-
const HERO_HEADER_STYLE = {
6-
textShadow: `
7-
-2px -2px 0 #7055FD,
8-
2px -2px 0 #7055FD,
9-
-2px 2px 0 #7055FD,
10-
2px 2px 0 #7055FD,
11-
-2px -2px 0 #7055FD,
12-
2px -2px 0 #7055FD,
13-
-2px 2px 0 #7055FD,
14-
2px 2px 0 #7055FD
15-
`,
16-
};
17-
185
const HeroSectionTile = ({
196
hackathonDetails,
207
}: {
@@ -26,13 +13,10 @@ const HeroSectionTile = ({
2613

2714
return (
2815
<div className={"flex flex-col px-4 pt-10 md:items-center md:px-0 "}>
29-
<h1
30-
className="flex-wrap text-5xl font-black text-pastel-green drop-shadow-lg md:text-center md:text-6xl"
31-
style={HERO_HEADER_STYLE}
32-
>
16+
<h1 className="text-shadow-title flex-wrap text-5xl font-black text-pastel-green drop-shadow-lg md:text-center md:text-6xl">
3317
<span className="text-white">{eventName} </span> {" " + eventYear}
3418
</h1>
35-
<strong className="flex w-full max-w-7xl flex-wrap justify-center py-4 text-xl text-awesomer-purple opacity-95 md:text-center md:text-xl">
19+
<strong className="text-shadow-outline flex w-full max-w-7xl flex-wrap justify-center rounded-lg p-2 text-xl text-pastel-green opacity-95 drop-shadow-lg md:py-4 md:text-center md:text-xl md:text-awesomer-purple ">
3620
{eventBlurb}
3721
</strong>
3822
<HeroCallToAction />

src/components/LandingPage/JudgingCriteria.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import Image from "next/image";
22

33
const judgingCriteriaStyles =
4-
"relative flex -mt-5 justify-between bg-[#BAFBE4] py-20 px-10 md:px-24 lg:px-40 drop-shadow-lg md:drop-shadow-none";
4+
"relative flex -mt-5 justify-between bg-[#BAFBE4] py-20 px-[5%] md:px-24 lg:px-40 drop-shadow-lg md:drop-shadow-none";
55

66
const itemStyles =
7-
"flex justify-start p-4 lg:px-10 lg:text-[1.0rem] items-start";
7+
"flex justify-start p-4 lg:px-6 lg:text-[1.0rem] items-start";
88

99
const checkMarkSvg = "/svgs/landingPage/check_mark_bkg.svg";
1010

src/components/UserProfile/TeamForm.tsx

+39-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
"use client";
2+
3+
import { generateClient } from "aws-amplify/api";
4+
15
import { type Schema } from "@/amplify/data/resource";
6+
import { useQuery } from "@tanstack/react-query";
27

38
const INPUT_STYLES =
49
"rounded-full border-4 placeholder-black border-white bg-[#FFFFFF] bg-white/30 ps-3 py-2 my-2 text-sm md:text-md backdrop-opacity-30";
@@ -17,7 +22,23 @@ export default function TeamForm({ data, teamMutation }: TeamFormProp) {
1722
teamMutation.mutate(data);
1823
};
1924

25+
const client = generateClient<Schema>();
26+
2027
// eslint-disable-next-line @typescript-eslint/no-unused-vars
28+
const { data: teamData, isFetching } = useQuery({
29+
initialData: null,
30+
initialDataUpdatedAt: 0,
31+
queryKey: ["TeamWithMembers"],
32+
queryFn: async () => {
33+
const { data: teamWithMembers } = await client.models.Team.get(
34+
{ id: data.id },
35+
{ selectionSet: ["id", "members.*"] },
36+
);
37+
38+
return teamWithMembers;
39+
},
40+
enabled: !!data,
41+
});
2142

2243
return (
2344
<>
@@ -40,16 +61,24 @@ export default function TeamForm({ data, teamMutation }: TeamFormProp) {
4061
/>
4162
<label>Team Members</label>
4263
<div className="flex flex-col">
43-
{Array.isArray(data.members) &&
44-
data.members.map((member: Schema["User"]["type"]) => (
45-
<input
46-
key={member.id}
47-
className={INPUT_STYLES}
48-
type="text"
49-
value={`${member.firstName} ${member.lastName}`}
50-
disabled
51-
/>
52-
))}
64+
{isFetching ? (
65+
<h1 className={INPUT_STYLES}>Loading...</h1>
66+
) : (
67+
<>
68+
{Array.isArray(teamData?.members) &&
69+
teamData?.members.map(
70+
(member: Partial<Schema["User"]["type"]>) => (
71+
<input
72+
key={member.id}
73+
className={INPUT_STYLES}
74+
type="text"
75+
value={`${member.firstName} ${member.lastName}`}
76+
disabled
77+
/>
78+
),
79+
)}
80+
</>
81+
)}
5382
</div>
5483
</form>
5584
<div className="mb-10 mt-3 flex justify-end md:mx-10">

0 commit comments

Comments
 (0)