1
1
import React from "react" ;
2
2
import Section from "@/components/sections/communities/_partials/Section" ;
3
3
import TeamChallengeCard from "@/components/cards/TeamChallenge" ;
4
- // import { Challenge } from "@/types/course";
5
4
import { useSelector } from "@/hooks/useTypedSelector" ;
6
5
7
6
/**
@@ -20,67 +19,52 @@ interface CardData {
20
19
* * @interface TeamChallengeCard
21
20
*/
22
21
23
-
24
22
export default function TeamChallenge ( ) : JSX . Element {
25
23
const challenge = useSelector ( ( state ) => state . challenges . current ) ;
26
24
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
+ ] ;
77
60
78
61
return (
79
62
< Section title = "Team Challenge" >
80
63
< 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 >
81
64
< 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
+ ) ) }
84
68
</ div >
85
69
</ Section >
86
70
) ;
0 commit comments