Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

194 add judge score preview #255

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/components/judging/CriteriaCard.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from "react";
import { Typography, Card, Slider } from "antd";
import { Badge } from "@chakra-ui/react";

const { Paragraph } = Typography;

interface Props {
criteria: any;
changeScore: (value: number, id: number) => void;
currScore: string;
}

const CriteriaCard: React.FC<Props> = props => {
Expand All @@ -17,7 +19,10 @@ const CriteriaCard: React.FC<Props> = props => {
return (
<div>
<Card hoverable title={props.criteria.name} size="small" style={{ maxWidth: "500px" }}>
<Paragraph>{props.criteria.description}</Paragraph>
<Paragraph>{props.criteria.description} <Badge colorScheme="blue" variant="subtle">
{props.currScore}
</Badge></Paragraph>

<Slider
marks={marks}
min={props.criteria.minScore}
Expand Down
10 changes: 7 additions & 3 deletions src/components/judging/CriteriaCardContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ interface Props {
criteriaArray: any[];
changeScore: (value: number, id: number) => void;
categoryName: string;
projectScores: any;
}

const CriteriaCardContainer: React.FC<Props> = props => (
<div>
<Title level={3}>{props.categoryName}</Title>
{props.criteriaArray.map((criteria: any) => (
<CriteriaCard criteria={criteria} changeScore={props.changeScore} />
))}
{props.criteriaArray.map((criteria: any) => {
const currScore = props.projectScores[criteria.id];
return (
<CriteriaCard criteria={criteria} changeScore={props.changeScore} currScore={currScore} />
)
})}
</div>
);

Expand Down
1 change: 1 addition & 0 deletions src/components/judging/JudgingCardsContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const JudgingCardsContainer: React.FC<Props> = props => {
criteriaArray={cToCMapping[key]}
changeScore={changeScore}
categoryName={key}
projectScores={projectScores}
/>
);
}
Expand Down