Skip to content

Commit 6d457c6

Browse files
authored
Merge pull request #1088 from dacadeorg/fix/reconcile-hardcoded-values-for-spiced-challenge
Fix/reconcile hardcoded values for spiced challenge
2 parents efb2d53 + a200208 commit 6d457c6

File tree

10 files changed

+47
-20
lines changed

10 files changed

+47
-20
lines changed

public/locales/bg/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
"communities.challenge.criteria.subtitle": "Следните учебни материали ще ви дадат необходимата техническа експертиза, за да се справите успешно с предизвикателството.",
134134
"communities.challenge.criteria.points": "Points",
135135
"communities.challenge.passing.score.description": "За да {{coinPlaceholder}} <strong>{{amount}}</strong> <strong>{{token}}</strong>, трябва да получите поне <strong>{{minPoints}}</strong> от <strong>{{maxPoints}}</strong> точки в този предизвикателство.",
136-
"communities.challenge.hackathon.passing.score": "Трябва да получите <strong>90%</strong>, за да влезете в наградния фонд и да спечелите награди на стойност <strong>7 000 щатски долара.</strong>",
136+
"communities.challenge.hackathon.passing.score": "Трябва да получите <strong>{{threshold}}%</strong>, за да влезете в наградния фонд и да спечелите награди на стойност <strong>{{prizePool}} щатски долара.</strong>",
137137
"communities.challenge.submission": "заявка",
138138
"communities.challenge.submit": "Изпращане",
139139
"communities.challenge.feedback": "обратна връзка",

public/locales/en/common.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
"communities.overview.challenge.subtitle": "Upon successful completion",
119119
"communities.overview.challenge.expiry": "Challenge expiry date:",
120120
"communities.overview.challenge.learning.title": "The following learning materials will equip you with the technical expertise required to successfully address the challenge.",
121-
"communities.overview.challenge.learning.start": "start now",
121+
"communities.overview.challenge.learning.start": "Start now",
122122
"communities.overview.challenge.team.setup.title": "Form your team",
123123
"communities.overview.challenge.team.setup.description": "Select from 1 to 3 members to join you in the challenge.",
124124
"communities.overview.challenge.team.setup.info": "To complete the team challenge, you need to follow these steps:",
@@ -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>{{threshold}}%</strong> to get into the prize pool and earn prizes worth of <strong>{{prizePool}}</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",

public/locales/es/common.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"communities.overview.challenge.subtitle": "Al completar con éxito",
118118
"communities.overview.challenge.expiry": "Fecha de vencimiento del desafío:",
119119
"communities.overview.challenge.learning.title": "Los siguientes materiales de aprendizaje le proporcionarán la experiencia técnica necesaria para abordar con éxito el desafío.",
120-
"communities.overview.challenge.learning.start": "comenzar ahora",
120+
"communities.overview.challenge.learning.start": "Comenzar ahora",
121121
"communities.overview.challenge.team.setup.title": "Forma tu equipo",
122122
"communities.overview.challenge.team.setup.description": "Selecciona de 1 a 3 miembros para que se unan a ti en el desafío.",
123123
"communities.overview.challenge.team.setup.info": "Para completar el desafío en equipo, debes seguir estos pasos:",
@@ -134,7 +134,7 @@
134134
"communities.challenge.criteria.subtitle": "Los siguientes materiales de aprendizaje lo equiparán con la experiencia técnica necesaria para abordar con éxito el desafío.",
135135
"communities.challenge.criteria.points": "Puntos",
136136
"communities.challenge.passing.score.description": "Para ganar {{coinPlaceholder}} <strong>{{amount}}</strong> <strong>{{token}}</strong>, debes obtener al menos <strong>{{minPoints}}</strong> de <strong>{{maxPoints}}</strong> puntos en este desafío.",
137-
"communities.challenge.hackathon.passing.score": "Necesitas obtener el <strong>90%</strong> para entrar en el fondo de premios y ganar premios por un valor de <strong>USD 7,000.</strong>",
137+
"communities.challenge.hackathon.passing.score": "Necesitas obtener el <strong>{{threshold}}%</strong> para entrar en el fondo de premios y ganar premios por un valor de <strong>{{prizePool}}.</strong>",
138138
"communities.challenge.submission": "Propuesta",
139139
"communities.challenge.submit": "Entregar",
140140
"communities.challenge.feedback": "Feedback",

public/locales/hr/common.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
"communities.challenge.criteria.subtitle": "Sljedeći materijali za učenje opremit će vas tehničkom stručnošću potrebnom za uspješno rješavanje izazova.",
119119
"communities.challenge.criteria.points": "bodova",
120120
"communities.challenge.passing.score.description": "U svrhu zarade {{coinPlaceholder}} <strong>{{amount}}</strong> <strong>{{token}}</strong>-ova morate osvojiti barem <strong>{{minPoints}}</strong> od <strong>{{maxPoints}}</strong> bodova u ovom izazovu.",
121-
"communities.challenge.hackathon.passing.score": "Trebate dobiti <strong>90%</strong> kako biste ušli u nagradni fond i osvojili nagrade u vrijednosti od <strong>7.000 američkih dolara.</strong>",
121+
"communities.challenge.hackathon.passing.score": "Trebate dobiti <strong>{{threshold}}%</strong> kako biste ušli u nagradni fond i osvojili nagrade u vrijednosti od <strong>{{prizePool}}</strong>",
122122
"communities.challenge.submission": "predaji zadatka",
123123
"communities.challenge.submit": "podnijeti",
124124
"communities.challenge.feedback": "povratnoj informaciji",
@@ -165,7 +165,7 @@
165165
"communities.overview.challenge.certificate": "Certificate",
166166
"communities.overview.challenge.expiry": "Datum isteka izazova:",
167167
"communities.overview.challenge.learning.title": "Sljedeći materijali za učenje opskrbit će vas tehničkim stručnostima potrebnim za uspješno rješavanje izazova.",
168-
"communities.overview.challenge.learning.start": "počnite sada",
168+
"communities.overview.challenge.learning.start": "Počnite sada",
169169
"communities.overview.challenge.team.setup.title": "Sastavite svoj tim",
170170
"communities.overview.challenge.team.setup.description": "Odaberite između 1 do 3 člana koji će vam se pridružiti u izazovu.",
171171
"communities.overview.challenge.team.setup.info": "Da biste završili timski izazov, trebate slijediti ove korake:",

src/components/cards/challenge/_partials/FormTeam.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function FormTeamCard({ index = 1, title, description }: FormTeam
2828
</div>
2929
<div className="text-sm font-normal text-gray-700 mt-3 max-w-xxs pb-6">{description}</div>
3030
</div>
31-
<Link href="https://discord.gg/gBQghCPeV7" target="_blank">
31+
<Link href="https://t.me/+0oJye8IwAuxkMDY0" target="_blank">
3232
<ArrowButton communityStyles={true} variant="outline-primary">
3333
Start now
3434
</ArrowButton>

src/components/sections/challenges/Objectives.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ export default function Objectives(): ReactElement {
2626
<div className="space-y-5">
2727
<ObjectiveList objectives={challenge?.objectives} />
2828
{expirationDate && <ExpiryDate expiresAt={expirationDate} />}
29-
{containsLink.test(challenge?.hint as string) && (
30-
<Hint>
29+
<Hint>
30+
{containsLink.test(challenge?.hint as string) ? (
3131
<span
3232
dangerouslySetInnerHTML={{
3333
__html: challenge?.hint as string,
3434
}}
3535
/>
36-
</Hint>
37-
)}
36+
) : (
37+
<>{challenge?.hint}</>
38+
)}
39+
</Hint>
3840
</div>
3941
</Section>
4042
);

src/components/sections/challenges/Rubric.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default function RubricHeader({ ratingCriteria, selected, hideTitle = fal
5353
});
5454

5555
const passingScoreParts = passingScore.split("{{coinPlaceholder}}");
56-
const hackatonPassingScore = t("communities.challenge.hackathon.passing.score");
56+
const hackatonPassingScore = t("communities.challenge.hackathon.passing.score", { threshold: challenge?.threshold, prizePool: `USD ${reward?.amount}` });
5757

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">

src/components/sections/challenges/SetupTeamChallenge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default function SetupTeamChallenge(): JSX.Element {
2626
<Section title="Submission">
2727
<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>
2828
<div className="md:flex flex-row gap-5">
29-
<FormTeamCard index={1} title="Form your team" description="Open discord channel #icp-ai-web3-hachathon and find your teammates to complete the challenge with you." />
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." />
3030
{invite && !invite.team?.locked ? (
3131
<ConfirmTeamInvitation index={2} title="Submit your team" text={`The maximum team members for this challenge is ${challenge?.teamLimit || "3"} people`} invite={invite} />
3232
) : (

src/components/sections/challenges/TeamChallenge.tsx

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import React from "react";
1+
import React, { useMemo } from "react";
22
import Section from "@/components/sections/communities/_partials/Section";
33
import TeamChallengeCard from "@/components/cards/TeamChallenge";
4+
import { useSelector } from "@/hooks/useTypedSelector";
45

56
/**
67
* Data structure for a card.
@@ -15,9 +16,30 @@ interface CardData {
1516
* TeamChallenge component.
1617
*
1718
* @returns {JSX.Element} The TeamChallenge component JSX element.
19+
* * @interface TeamChallengeCard
1820
*/
21+
1922
export default function TeamChallenge(): JSX.Element {
20-
const TeamChallengeData: CardData[] = [
23+
const challenge = useSelector((state) => state.challenges.current);
24+
25+
const hackathonChallengeSteps: CardData[] = [
26+
{
27+
index: 1,
28+
title: "Form your team",
29+
text: "Open Telegram group and find your teammates to complete the challenge with you",
30+
},
31+
{
32+
index: 2,
33+
title: "Confirm your team",
34+
text: "Make sure your teammates accept notification to confirm your team",
35+
},
36+
{
37+
index: 3,
38+
title: "Submit!",
39+
text: "Once you have completed the challenge, only one person needs to submit it at the end of this page",
40+
},
41+
];
42+
const teamChallengeSteps: CardData[] = [
2143
{
2244
index: 1,
2345
title: "Form your team",
@@ -31,16 +53,20 @@ export default function TeamChallenge(): JSX.Element {
3153
{
3254
index: 3,
3355
title: "Submit!",
34-
text: "Once you have completed the challenge, only person needs to submit it at the end of this page",
56+
text: "Once you have completed the challenge, only one person needs to submit it at the end of this page",
3557
},
3658
];
3759

60+
const steps: CardData[] = useMemo(() => {
61+
return challenge?.isHackathon ? hackathonChallengeSteps : teamChallengeSteps;
62+
}, [challenge?.isTeamChallenge]);
63+
3864
return (
3965
<Section title="Team Challenge">
4066
<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>
4167
<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} />
68+
{steps.map((step) => (
69+
<TeamChallengeCard key={`TeamChallenge-card-data-${step.index}`} index={step.index} title={step.title} text={step.text} />
4470
))}
4571
</div>
4672
</Section>

src/pages/bounties/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export default function Bounties() {
5656
bounties: (state: IRootState) => state.bounties.bountiesList,
5757
});
5858

59-
6059
return (
6160
<div className="flex justify-center content-wrapper">
6261
<div className="hidden lg:block w-1/4 mt-28 py-3 pr-10 lg:py-14">

0 commit comments

Comments
 (0)