Skip to content

Commit

Permalink
update scunt judge form
Browse files Browse the repository at this point in the history
  • Loading branch information
Freeassassin committed Aug 28, 2023
1 parent 937ff0c commit c19e37c
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions client/src/pages/ScuntJudgeForm/ScuntJudgeForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const PageScuntJudgeForm = () => {
const getScuntTeams = async () => {
try {
const response = await axios.get('/scunt-teams');
const { teamPoints } = response.data;
const { teams: teamPoints } = response.data;
if (teamPoints.length <= 0 || !teamPoints) setTeams([]);
else {
setTeamObjs(teamPoints);
Expand All @@ -70,24 +70,22 @@ export const PageScuntJudgeForm = () => {
}, []);

return (
<>
<div className="scunt-judge-form-page">
<div className="scunt-judge-form-container">
<h1>Judge Dashboard</h1>
<h3>
Hello,{' '}
{user?.preferredName === '' || !user?.preferredName
? user?.firstName
: user?.preferredName}
</h3>
<ScuntMissionSelection teams={teams} missions={missions} teamObjs={teamObjs} />
<div className="separator" />
<ScuntBribePoints teams={teams} teamObjs={teamObjs} />
<div className="separator" />
<ScuntNegativePoints teams={teams} teamObjs={teamObjs} />
</div>
<div className="scunt-judge-form-page">
<div className="scunt-judge-form-container">
<h1>Judge Dashboard</h1>
<h3>
Hello,{' '}
{user?.preferredName === '' || !user?.preferredName
? user?.firstName
: user?.preferredName}
</h3>
<ScuntMissionSelection teams={teams} missions={missions} teamObjs={teamObjs} />
<div className="separator" />
<ScuntBribePoints teams={teams} teamObjs={teamObjs} />
<div className="separator" />
<ScuntNegativePoints teams={teams} teamObjs={teamObjs} />
</div>
</>
</div>
);
};

Expand Down Expand Up @@ -347,8 +345,8 @@ const ScuntMissionSelection = ({ missions, teams: teamsPassed, teamObjs }) => {
useEffect(() => {
if (scuntSettings !== undefined) {
if (Array.isArray(scuntSettings)) {
setMinAmountPointsPercent(scuntSettings[0]?.minAmountPointsPercent);
setMaxAmountPointsPercent(scuntSettings[0]?.maxAmountPointsPercent);
setMinAmountPointsPercent(scuntSettings?.minAmountPointsPercent);
setMaxAmountPointsPercent(scuntSettings?.maxAmountPointsPercent);
}
}
}, [scuntSettings]);
Expand Down

0 comments on commit c19e37c

Please sign in to comment.