@@ -30,7 +30,7 @@ export default function ChallengeCard({ data, community, isCourseEnd }: Challeng
30
30
const link = `/communities/${ community . slug } /challenges/${ data . id } ` ;
31
31
const expiresAt = useMemo ( ( ) => ( data . expiresAt ? new Date ( data . expiresAt ) . toLocaleDateString ( ) : null ) , [ data . expiresAt ] ) ;
32
32
const reward = isCourseEnd ? data ?. rewards ?. find ( ( reward ) => reward . type === "SUBMISSION" ) : data ?. reward ;
33
- const totalReward = data ?. rewards ?. reduce ( ( acc , reward ) => ( acc += Number ( reward . amount ) ) , 0 ) ;
33
+ const amount = shortenNumber ( data ?. rewards ?. reduce ( ( acc , reward ) => ( acc += Number ( reward . amount ) ) , 0 ) ) ;
34
34
35
35
return (
36
36
< div className = "border-solid border border-gray-200 bg-gray-50 rounded-3xl mb-5 group text-gray-700" >
@@ -60,7 +60,12 @@ export default function ChallengeCard({ data, community, isCourseEnd }: Challeng
60
60
< div className = "md:pl-2 max-w-max" >
61
61
< div className = "flex text-sm text-gray-700" >
62
62
< span className = "block font-medium" >
63
- { shortenNumber ( totalReward ) } { reward ?. token } { ` ${ data ?. isHackathon ? `Prize pool` : "" } rewards` }
63
+ { data ?. isHackathon ? < > { reward ?. fiatCurrency ?
64
+ t ( 'communities.overview.reward.fiat.prize.pool' , { amount, currency : reward . fiatCurrency , token : reward ?. token } ) :
65
+ t ( 'communities.overview.reward.crypto.prize.pool' , { amount, token : reward ?. token } )
66
+ } </ > : < > { amount } { reward ?. token } </ > }
67
+
68
+ { t ( "communities.overview.reward.title" ) }
64
69
</ span >
65
70
</ div >
66
71
< div className = "text-gray-400 text-xs font-normal" > { data ?. isHackathon ? "Top projects win money prizes" : "For submission and feedback" } </ div >
0 commit comments