Skip to content

Commit 4c371c0

Browse files
committed
amends for ICP Hackathon
1 parent b60da3b commit 4c371c0

File tree

4 files changed

+69
-8
lines changed

4 files changed

+69
-8
lines changed

public/locales/en/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
"communities.challenge.criteria.subtitle": "The following learning materials will equip you with the technical expertise required to successfully address the challenge.",
135135
"communities.challenge.criteria.points": "Points",
136136
"communities.challenge.passing.score.description": "In order to earn {{coinPlaceholder}} <strong>{{amount}}</strong> <strong>{{token}}</strong> you must get at least <strong>{{minPoints}}</strong> out of <strong>{{maxPoints}}</strong> Points in this challenge.",
137-
"communities.challenge.hackathon.passing.score": "You need to get <strong>90%</strong> to get into the prize pool and earn prizes worth of <strong>USD 7,000.</strong>",
137+
"communities.challenge.hackathon.passing.score": "You need to get <strong>90 points</strong> to get into the prize pool and earn prizes worth of <strong>USD 10,000</strong>. Earn some extra points through your localization's implementations.",
138138
"communities.challenge.submission": "Submission",
139139
"communities.challenge.submit": "Submit",
140140
"communities.challenge.feedback": "Feedback",

src/components/sections/challenges/TeamChallenge.tsx

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from "react";
22
import Section from "@/components/sections/communities/_partials/Section";
33
import TeamChallengeCard from "@/components/cards/TeamChallenge";
4+
// import { Challenge } from "@/types/course";
5+
import { useSelector } from "@/hooks/useTypedSelector";
46

57
/**
68
* Data structure for a card.
@@ -15,8 +17,13 @@ interface CardData {
1517
* TeamChallenge component.
1618
*
1719
* @returns {JSX.Element} The TeamChallenge component JSX element.
20+
* * @interface TeamChallengeCard
1821
*/
22+
23+
1924
export default function TeamChallenge(): JSX.Element {
25+
const challenge = useSelector((state) => state.challenges.current);
26+
2027
const TeamChallengeData: CardData[] = [
2128
{
2229
index: 1,
@@ -31,17 +38,49 @@ export default function TeamChallenge(): JSX.Element {
3138
{
3239
index: 3,
3340
title: "Submit!",
34-
text: "Once you have completed the challenge, only person needs to submit it at the end of this page",
41+
text: "Once you have completed the challenge, only one person needs to submit it at the end of this page",
3542
},
3643
];
3744

45+
const HackathonData: CardData[] = [
46+
{
47+
index: 1,
48+
title: "Form your team",
49+
text: "Open Telegram channel https://t.me/+0oJye8IwAuxkMDY0 and find your teammates to complete the challenge with you",
50+
},
51+
{
52+
index: 2,
53+
title: "Confirm your team",
54+
text: "Make sure your teammates accept notification to confirm your team",
55+
},
56+
{
57+
index: 3,
58+
title: "Submit!",
59+
text: "Once you have completed the challenge, only one person needs to submit it at the end of this page",
60+
},
61+
];
62+
63+
const challengeData: any = () => {
64+
if (challenge?.isTeamChallenge && !challenge?.isHackathon) {
65+
console.log("isTeamChallenge", challenge?.isTeamChallenge)
66+
return TeamChallengeData.map((card) => (
67+
<TeamChallengeCard key={`TeamChallenge-card-data-${card.index}`} index={card.index} title={card.title} text={card.text} />
68+
))
69+
}
70+
else if (challenge?.isHackathon){
71+
console.log("isHackathon", challenge?.isHackathon)
72+
return HackathonData.map((card) => (
73+
<TeamChallengeCard key={`TeamChallenge-card-data-${card.index}`} index={card.index} title={card.title} text={card.text} />
74+
))
75+
}
76+
}
77+
3878
return (
3979
<Section title="Team Challenge">
4080
<div className="text-base font-normal text-slate-700 pt-8 pb-7 md:w-182.5">To complete the team challenge, you need to follow these steps:</div>
4181
<div className="md:flex flex-row gap-20 md:divide-y-0 divide-y divide-gray-900 divide-dotted space-y-5 md:space-y-0 space-x-0">
42-
{TeamChallengeData.map((card) => (
43-
<TeamChallengeCard key={`TeamChallenge-card-data-${card.index}`} index={card.index} title={card.title} text={card.text} />
44-
))}
82+
83+
{ challengeData() }
4584
</div>
4685
</Section>
4786
);

src/pages/bounties/index.tsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ReactElement, useCallback, useEffect } from "react";
1+
import { ReactElement, useCallback, useEffect, useMemo } from "react";
22
import Navigation from "@/components/sections/bounties/Navigation";
33
import BountyList from "@/components/list/Bounty";
44
import { useTranslation } from "react-i18next";
@@ -32,6 +32,25 @@ interface bountiesMultiSelector {
3232
* @type {Bounty}
3333
*/
3434

35+
const defaulBounty = {
36+
name: "Tezos Starter Course",
37+
image: "/img/communities/tacode.svg",
38+
type: "Challenge",
39+
link: "https://tacode.dev/courses/dev-starter/challenges/f9c23fc7-3022-4347-b19c-66cc2424ac2f",
40+
colors: {
41+
text: "#0D61FF",
42+
accent: "#0D61FF",
43+
textAccent: "#fff",
44+
primary: "#0D61FF",
45+
},
46+
reward: {
47+
amount: 12,
48+
token: "tez",
49+
type: "SUBMISSION",
50+
},
51+
url: "https://tacode.dev/courses/dev-starter",
52+
};
53+
3554
/**
3655
* Bounties page component
3756
* @date 5/16/2023 - 11:39:56 AM
@@ -56,6 +75,7 @@ export default function Bounties() {
5675
bounties: (state: IRootState) => state.bounties.bountiesList,
5776
});
5877

78+
const bountiesList = useMemo(() => [defaulBounty, ...(bounties || [])], [bounties]);
5979

6080
return (
6181
<div className="flex justify-center content-wrapper">
@@ -64,7 +84,7 @@ export default function Bounties() {
6484
</div>
6585
<div className="flex-col w-full">
6686
<h1 className="text-4xl sm:text-5xl pt-10 md:pt-20 pb-10">{t("nav.bounties")}</h1>
67-
<BountyList bounties={bounties as Bounty[]} referrals={referrals} />
87+
<BountyList bounties={bountiesList as Bounty[]} referrals={referrals} />
6888
</div>
6989
</div>
7090
);

src/pages/communities/[slug]/challenges/[challenge_id]/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ export default function ChallengePage() {
129129
<Header />
130130
<Rewards />
131131
<Objectives />
132-
{challenge.isTeamChallenge && <TeamChallenge />}
132+
{/* {challenge.isTeamChallenge && <TeamChallenge />} */}
133+
<TeamChallenge />
134+
133135
<Learning courses={challenge.courses} learningModules={challenge.learningModules} community={community} />
134136
<RatingRubric ratingCriteria={challenge?.ratingCriteria} selected={[]} />
135137
<BestSubmissions />

0 commit comments

Comments
 (0)