Skip to content

Commit bf4f6c1

Browse files
fix: change the team team creation steps but only for hachathon
1 parent f6f2e92 commit bf4f6c1

File tree

1 file changed

+38
-54
lines changed

1 file changed

+38
-54
lines changed

src/components/sections/challenges/TeamChallenge.tsx

Lines changed: 38 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
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";
54
import { useSelector } from "@/hooks/useTypedSelector";
65

76
/**
@@ -20,67 +19,52 @@ interface CardData {
2019
* * @interface TeamChallengeCard
2120
*/
2221

23-
2422
export default function TeamChallenge(): JSX.Element {
2523
const challenge = useSelector((state) => state.challenges.current);
2624

27-
const TeamChallengeData: CardData[] = [
28-
{
29-
index: 1,
30-
title: "Form your team",
31-
text: "Open discord channel #teams and find your teammates to complete the challenge with you",
32-
},
33-
{
34-
index: 2,
35-
title: "Confirm your team",
36-
text: "Make sure your teammates accept notification to confirm your team",
37-
},
38-
{
39-
index: 3,
40-
title: "Submit!",
41-
text: "Once you have completed the challenge, only one person needs to submit it at the end of this page",
42-
},
43-
];
44-
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-
}
25+
const TeamChallengeData: CardData[] = challenge?.isHackathon
26+
? [
27+
{
28+
index: 1,
29+
title: "Form your team",
30+
text: "Open Telegram channel https://t.me/+0oJye8IwAuxkMDY0 and find your teammates to complete the challenge with you",
31+
},
32+
{
33+
index: 2,
34+
title: "Confirm your team",
35+
text: "Make sure your teammates accept notification to confirm your team",
36+
},
37+
{
38+
index: 3,
39+
title: "Submit!",
40+
text: "Once you have completed the challenge, only one person needs to submit it at the end of this page",
41+
},
42+
]
43+
: [
44+
{
45+
index: 1,
46+
title: "Form your team",
47+
text: "Open discord channel #teams and find your teammates to complete the challenge with you",
48+
},
49+
{
50+
index: 2,
51+
title: "Confirm your team",
52+
text: "Make sure your teammates accept notification to confirm your team",
53+
},
54+
{
55+
index: 3,
56+
title: "Submit!",
57+
text: "Once you have completed the challenge, only one person needs to submit it at the end of this page",
58+
},
59+
];
7760

7861
return (
7962
<Section title="Team Challenge">
8063
<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>
8164
<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">
82-
83-
{ challengeData() }
65+
{TeamChallengeData.map((card) => (
66+
<TeamChallengeCard key={`TeamChallenge-card-data-${card.index}`} index={card.index} title={card.title} text={card.text} />
67+
))}
8468
</div>
8569
</Section>
8670
);

0 commit comments

Comments
 (0)