Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Add claim status reset (#2358)
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin authored Jan 31, 2022
1 parent 954d790 commit 8d23af2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/custom/pages/Claim/ClaimingStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ import { AMOUNT_PRECISION } from 'constants/index'
import { shortenAddress } from 'utils'
import CopyHelper from 'components/Copy'
import { ButtonSecondary } from 'components/Button'
import { ClaimCommonTypes } from './types'

const COW_TWEET_TEMPLATE =
'I just joined the 🐮 CoWmunity @MEVprotection and claimed my first vCOW tokens! Join me at https://cowswap.exchange/'

export default function ClaimingStatus() {
type ClaimNavProps = Pick<ClaimCommonTypes, 'handleChangeAccount'>

export default function ClaimingStatus({ handleChangeAccount }: ClaimNavProps) {
const { chainId, account } = useActiveWeb3React()
const { activeClaimAccount, claimStatus, claimedAmount } = useClaimState()

Expand Down Expand Up @@ -159,11 +162,16 @@ export default function ClaimingStatus() {
</AttemptFooter>
</>
)}
{(isConfirmed || isFailure) && (
{isFailure && (
<ButtonSecondary onClick={() => setClaimStatus(ClaimStatus.DEFAULT)}>
<Trans>Go back</Trans>
</ButtonSecondary>
)}
{isConfirmed && (
<ButtonSecondary onClick={handleChangeAccount}>
<Trans>Claim for another account</Trans>
</ButtonSecondary>
)}
</ConfirmOrLoadingWrapper>
)
}
2 changes: 1 addition & 1 deletion src/custom/pages/Claim/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export default function Claim() {
/>

{/* Try claiming or inform successful claim */}
<ClaimingStatus />
<ClaimingStatus handleChangeAccount={handleChangeAccount} />
{/* IS Airdrop + investing (advanced) */}
<ClaimsTable isAirdropOnly={isAirdropOnly} claims={userClaimData} hasClaims={hasClaims} />
{/* Investing vCOW flow (advanced) */}
Expand Down

0 comments on commit 8d23af2

Please sign in to comment.