@@ -9,6 +9,10 @@ import { Colors } from "@/types/community";
9
9
import { Challenge } from "@/types/course" ;
10
10
import { IRootState } from "@/store" ;
11
11
12
+ interface EvaluationsProps {
13
+ testId ?: string ;
14
+ }
15
+
12
16
/**
13
17
* interface for Evaluations multiSelector
14
18
* @date 9/13/2023 - 9:21:32 AM
@@ -29,7 +33,7 @@ interface EvaluationsMultiSelector {
29
33
* @export
30
34
* @returns {ReactElement }
31
35
*/
32
- export default function Evaluations ( ) : ReactElement {
36
+ export default function Evaluations ( { testId = "evaluationsId" } : EvaluationsProps ) : ReactElement {
33
37
const { t } = useTranslation ( ) ;
34
38
const { colors, submission, challenge } = useMultiSelector < unknown , EvaluationsMultiSelector > ( {
35
39
colors : ( state : IRootState ) => state . ui . colors ,
@@ -39,45 +43,47 @@ export default function Evaluations(): ReactElement {
39
43
const evaluation = submission ?. evaluation as Evaluation ;
40
44
41
45
return (
42
- < EvaluationCard evaluation = { evaluation } >
43
- < >
44
- { challenge && < RatingRubric hideTitle ratingCriteria = { challenge . ratingCriteria } selected = { evaluation . criteria } /> }
45
- < div className = "grid grid-cols-1 mt-3 space-y-4 md:space-y-0 md:grid-cols-2 lg:grid-cols-4 gap-y-5 gap-x-5" >
46
- < div className = "text-sm" >
47
- < span className = "block font-medium" > { t ( "communities.challenge.evaluation.total" ) } </ span >
48
- < span className = "text-xl" style = { { color : colors ?. textAccent } } >
49
- { evaluation . points }
50
- </ span >
51
- < span style = { { color : colors ?. textAccent } } >
52
- /{ evaluation . totalPoints }
53
- { t ( "communities.challenge.evaluation.points" ) }
54
- </ span >
55
- </ div >
56
- { evaluation . reward && (
57
- < div className = "relative text-sm" >
58
- { challenge ?. isHackathon ? (
59
- < >
60
- < div > { t ( "communities.challenge.evaluation.message.nominated" , { threshold : challenge . threshold } ) } </ div >
61
- < div className = "inline-block font-medium" style = { { color : colors ?. textAccent } } >
62
- < span className = "text-xl" > { evaluation . reward . amount } </ span > USD
63
- </ div >
64
- </ >
65
- ) : (
66
- < >
67
- < span className = "block font-medium" > { t ( "communities.challenge.evaluation.total" ) } </ span >
68
- < div className = "absolute -left-5 top-7" >
69
- < Coin token = { evaluation . reward . token } size = "small" />
70
- </ div >
71
- < div className = "inline-block font-medium" style = { { color : colors ?. textAccent } } >
72
- < span className = "text-xl" > { evaluation . reward . amount } </ span > < span > { evaluation . reward . token } </ span >
73
- </ div >
74
- < div > { t ( "communities.challenge.evaluation.message" ) } </ div >
75
- </ >
76
- ) }
46
+ < div data-testid = { testId } >
47
+ < EvaluationCard evaluation = { evaluation } >
48
+ < >
49
+ { challenge && < RatingRubric hideTitle ratingCriteria = { challenge . ratingCriteria } selected = { evaluation ?. criteria } /> }
50
+ < div className = "grid grid-cols-1 mt-3 space-y-4 md:space-y-0 md:grid-cols-2 lg:grid-cols-4 gap-y-5 gap-x-5" >
51
+ < div className = "text-sm" >
52
+ < span className = "block font-medium" > { t ( "communities.challenge.evaluation.total" ) } </ span >
53
+ < span className = "text-xl" style = { { color : colors ?. textAccent } } >
54
+ { evaluation ?. points }
55
+ </ span >
56
+ < span style = { { color : colors ?. textAccent } } >
57
+ /{ evaluation ?. totalPoints }
58
+ { t ( "communities.challenge.evaluation.points" ) }
59
+ </ span >
77
60
</ div >
78
- ) }
79
- </ div >
80
- </ >
81
- </ EvaluationCard >
61
+ { evaluation ?. reward && (
62
+ < div className = "relative text-sm" >
63
+ { challenge ?. isHackathon ? (
64
+ < >
65
+ < div > { t ( "communities.challenge.evaluation.message.nominated" , { threshold : challenge . threshold } ) } </ div >
66
+ < div className = "inline-block font-medium" style = { { color : colors ?. textAccent } } >
67
+ < span className = "text-xl" > { evaluation . reward . amount } </ span > USD
68
+ </ div >
69
+ </ >
70
+ ) : (
71
+ < >
72
+ < span className = "block font-medium" > { t ( "communities.challenge.evaluation.total" ) } </ span >
73
+ < div className = "absolute -left-5 top-7" >
74
+ < Coin token = { evaluation . reward . token } size = "small" />
75
+ </ div >
76
+ < div className = "inline-block font-medium" style = { { color : colors ?. textAccent } } >
77
+ < span className = "text-xl" > { evaluation . reward . amount } </ span > < span > { evaluation . reward . token } </ span >
78
+ </ div >
79
+ < div > { t ( "communities.challenge.evaluation.message" ) } </ div >
80
+ </ >
81
+ ) }
82
+ </ div >
83
+ ) }
84
+ </ div >
85
+ </ >
86
+ </ EvaluationCard >
87
+ </ div >
82
88
) ;
83
89
}
0 commit comments