Skip to content

Commit 482b727

Browse files
refactor: add additiona information properties on the hackathon challenges
1 parent 0ca5f13 commit 482b727

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/components/sections/challenges/Rubric.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default function RubricHeader({ ratingCriteria, selected, hideTitle = fal
5858
return (
5959
<div className="text-base font-normal text-slate-700 pt-8 md:w-182.5 inline-flex flex-wrap items-center gap-1">
6060
{challenge?.isHackathon ? (
61-
<div dangerouslySetInnerHTML={{ __html: hackatonPassingScore }} />
61+
<div dangerouslySetInnerHTML={{ __html: challenge?.additionalInfo?.gradingCriteria || hackatonPassingScore }} />
6262
) : (
6363
passingScoreParts.map((part, index) => {
6464
if (index === passingScoreParts.length - 1) {
@@ -94,9 +94,8 @@ export default function RubricHeader({ ratingCriteria, selected, hideTitle = fal
9494
{criteria.rubric.map((rubric, k) => (
9595
<div
9696
key={`criteria-rubic-item-${k}`}
97-
className={`text-sm border border-transparent sm:border-gray-200 px-0 py-2 sm:p-3.5 rounded-2xl ${
98-
selected?.length && !selectedRubric(rubric.id) ? "opacity-40" : "relative"
99-
}`}
97+
className={`text-sm border border-transparent sm:border-gray-200 px-0 py-2 sm:p-3.5 rounded-2xl ${selected?.length && !selectedRubric(rubric.id) ? "opacity-40" : "relative"
98+
}`}
10099
>
101100
{selectedRubric(rubric.id) && (
102101
<span className="absolute right-2 bottom-3 w-3" style={{ color: colors?.textAccent }}>

src/components/sections/challenges/SetupTeamChallenge.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ interface Props {
2020
export default function SetupTeamChallenge(): JSX.Element {
2121
const { invite, challenge } = useMultiSelector<unknown, Props>({ invite: (state: IRootState) => state.invites.data, challenge: (state: IRootState) => state.challenges.current });
2222

23+
const description = challenge?.additionalInfo?.teamFormation || "Join DeArk - ICP.Hub Germany telegram group and find your teammates to complete the challenge with you."
2324
const { t } = useTranslation();
2425

2526
return (
2627
<Section title="Submission">
2728
<div className="text-base font-normal text-slate-700 pt-8 pb-7 md:w-182.5">{t("communities.overview.challenge.team.setup.info")}</div>
2829
<div className="md:flex flex-row gap-5">
29-
<FormTeamCard index={1} title="Form your team" description="Join DeArk - ICP.Hub Germany telegram group and find your teammates to complete the challenge with you." />
30+
<FormTeamCard index={1} title="Form your team" description={description} />
3031
{invite && !invite.team?.locked ? (
3132
<ConfirmTeamInvitation index={2} title="Submit your team" text={`The maximum team members for this challenge is ${challenge?.teamLimit || "3"} people`} invite={invite} />
3233
) : (

src/types/course.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ export type Challenge = {
7878
teamLimit?: number;
7979
isHackathon?: boolean;
8080
multipleSubmissions?: boolean;
81+
additionalInfo?: {
82+
gradingCriteria?: string;
83+
teamFormation?: string;
84+
};
8185
};
8286

8387
export type RatingCriteria = {

0 commit comments

Comments
 (0)