Commit 514ce3f 1 parent b87d3a5 commit 514ce3f Copy full SHA for 514ce3f
File tree 5 files changed +23
-14
lines changed
mobile/src/components/challenge-rewards-drawer
web/src/pages/rewards-page/components/modals/ChallengeRewardsModal
5 files changed +23
-14
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export type ChallengeRewardsInfo = {
15
15
title : string
16
16
description : ( amount : OptimisticUserChallenge | undefined ) => string
17
17
fullDescription ?: ( amount : OptimisticUserChallenge | undefined ) => string
18
+ optionalDescription ?: string
18
19
progressLabel ?: string
19
20
remainingLabel ?: string
20
21
completedLabel ?: string
@@ -313,8 +314,9 @@ export const challengeRewardsConfig: Record<
313
314
description : ( ) =>
314
315
`We're thrilled to reward our talented artist community for driving Audius' growth and success!` ,
315
316
fullDescription : ( ) =>
316
- `We're thrilled to reward our talented artist community for driving Audius' growth and success! \n\nClaim your tokens before they expire on 05/13/25!` ,
317
-
317
+ `We're thrilled to reward our talented artist community for driving Audius' growth and success!` ,
318
+ optionalDescription :
319
+ '\n\nClaim your tokens before they expire on 05/13/25!' ,
318
320
panelButtonText : '' ,
319
321
id : ChallengeName . OneShot ,
320
322
remainingLabel : 'Ineligible' ,
Original file line number Diff line number Diff line change @@ -14,8 +14,13 @@ type DescriptionContent =
14
14
| {
15
15
description ?: never
16
16
renderDescription : ( ) => ReactNode
17
+ optionalDescription ?: never
18
+ }
19
+ | {
20
+ description : ReactNode
21
+ renderDescription ?: never
22
+ optionalDescription ?: ReactNode
17
23
}
18
- | { description : ReactNode ; renderDescription ?: never }
19
24
20
25
type ChallengeDescriptionProps = {
21
26
/** Indicates if the challenge has a cooldown period */
@@ -29,6 +34,7 @@ type ChallengeDescriptionProps = {
29
34
export const ChallengeDescription = ( {
30
35
description,
31
36
renderDescription,
37
+ optionalDescription,
32
38
isCooldownChallenge = true
33
39
} : ChallengeDescriptionProps ) => {
34
40
const styles = useStyles ( )
@@ -40,6 +46,7 @@ export const ChallengeDescription = ({
40
46
< Flex gap = 'm' mb = 'l' >
41
47
< Text variant = 'body' size = 'l' >
42
48
{ description }
49
+ { optionalDescription }
43
50
</ Text >
44
51
{ isCooldownChallenge ? (
45
52
< Text variant = 'body' color = 'subdued' >
Original file line number Diff line number Diff line change @@ -51,6 +51,8 @@ const messages = {
51
51
type ChallengeRewardsDrawerContentProps = {
52
52
/** The description of the challenge */
53
53
description : string
54
+ /** The optional description of the challenge */
55
+ optionalDescription ?: string
54
56
/** The current progress the user has made */
55
57
currentStep : number
56
58
/** The number of steps the user has to complete in total */
@@ -90,6 +92,7 @@ type ChallengeRewardsDrawerContentProps = {
90
92
*/
91
93
export const ChallengeRewardsDrawerContent = ( {
92
94
description,
95
+ optionalDescription,
93
96
amount,
94
97
currentStep,
95
98
stepCount = 1 ,
@@ -157,17 +160,11 @@ export const ChallengeRewardsDrawerContent = ({
157
160
return (
158
161
< >
159
162
< ScrollView style = { styles . content } >
160
- { isVerifiedChallenge ? (
161
- < ChallengeDescription
162
- description = { description }
163
- isCooldownChallenge = { isCooldownChallenge }
164
- />
165
- ) : (
166
- < ChallengeDescription
167
- description = { description }
168
- isCooldownChallenge = { isCooldownChallenge }
169
- />
170
- ) }
163
+ < ChallengeDescription
164
+ description = { description }
165
+ optionalDescription = { isClaimable ? optionalDescription : undefined }
166
+ isCooldownChallenge = { isCooldownChallenge }
167
+ />
171
168
< Flex alignItems = 'center' gap = '3xl' w = '100%' >
172
169
< Flex row alignItems = 'center' gap = 'xl' >
173
170
< ChallengeReward amount = { amount } subtext = { messages . audio } />
Original file line number Diff line number Diff line change @@ -237,6 +237,7 @@ export const ChallengeRewardsDrawerProvider = () => {
237
237
? config . fullDescription ( challenge )
238
238
: config . description ( challenge )
239
239
}
240
+ optionalDescription = { config . optionalDescription }
240
241
progressLabel = { config . progressLabel ?? 'Completed' }
241
242
completedLabel = { config . completedLabel }
242
243
amount = { progressRewardAmount }
Original file line number Diff line number Diff line change @@ -288,6 +288,7 @@ const ChallengeRewardsBody = ({ dismissModal }: BodyProps) => {
288
288
const currentStepCount = challenge ?. current_step_count || 0
289
289
const {
290
290
fullDescription,
291
+ optionalDescription,
291
292
progressLabel,
292
293
completedLabel,
293
294
isVerifiedChallenge
@@ -343,6 +344,7 @@ const ChallengeRewardsBody = ({ dismissModal }: BodyProps) => {
343
344
) : null }
344
345
< Text variant = 'body' style = { { whiteSpace : 'pre-line' } } >
345
346
{ fullDescription ?.( challenge ) }
347
+ { challenge ?. claimableAmount ? optionalDescription : null }
346
348
</ Text >
347
349
{ isCooldownChallenge ? (
348
350
< Text variant = 'body' color = 'subdued' >
You can’t perform that action at this time.
0 commit comments