Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C-4338] Fix $AUDIO available to claim #8350

Merged
merged 2 commits into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const messages = {
'Something has gone wrong, not all your rewards were claimed. Please try again or contact support@audius.co.',
claimErrorAAO:
'Your account is unable to claim rewards at this time. Please try again later or contact support@audius.co. ',
claimYourReward: 'Claim This Reward',
claimableAmountLabel: (amount: number) => `Claim $${amount} AUDIO`,
twitterShare: (modalType: 'referrals' | 'ref-v') =>
`Share Invite With Your ${modalType === 'referrals' ? 'Friends' : 'Fans'}`,
twitterCopy: `Come support me on @audius! Use my link and we both earn $AUDIO when you sign up.\n\n #audius #audiorewards\n\n`,
Expand Down Expand Up @@ -485,19 +485,14 @@ const ChallengeRewardsBody = ({ dismissModal }: BodyProps) => {
const renderClaimButton = () => {
if (audioToClaim > 0) {
return (
<>
<div className={styles.claimRewardAmountLabel}>
{`${audioToClaim} ${messages.claimAmountLabel}`}
</div>
<Button
variant='primary'
isLoading={claimInProgress}
iconRight={IconCheck}
onClick={onClaimRewardClicked}
>
{messages.claimYourReward}
</Button>
</>
<Button
variant='primary'
isLoading={claimInProgress}
iconRight={IconCheck}
onClick={onClaimRewardClicked}
>
{messages.claimableAmountLabel(audioToClaim)}
</Button>
)
}
return null
Expand Down Expand Up @@ -582,6 +577,11 @@ const ChallengeRewardsBody = ({ dismissModal }: BodyProps) => {
{audioToClaim > 0 ||
(audioClaimedSoFar > 0 && challenge?.state !== 'disbursed') ? (
<div className={wm(styles.claimRewardWrapper)}>
{!isRewardsCooldownEnabled ? (
<div className={styles.claimRewardAmountLabel}>
{`${audioToClaim} ${messages.claimAmountLabel}`}
</div>
) : null}
{renderClaimButton()}
{renderClaimedSoFarContent()}
</div>
Expand Down