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

Commit

Permalink
Add link claiming (#2224)
Browse files Browse the repository at this point in the history
* Add claiming status

* Update src/custom/pages/Claim/ClaimingStatus.tsx

Co-authored-by: Leandro Boscariol <[email protected]>

Co-authored-by: Leandro Boscariol <[email protected]>
  • Loading branch information
anxolin and alfetopito authored Jan 20, 2022
1 parent eca3a88 commit 9615e5f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/custom/pages/Claim/ClaimingStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ import { useClaimState } from 'state/claim/hooks'
import { useActiveWeb3React } from 'hooks/web3'
import CowProtocolLogo from 'components/CowProtocolLogo'
import Circle from 'assets/images/blue-loader.svg'
import { ExplorerDataType, getExplorerLink } from 'utils/getExplorerLink'
import { useAllClaimingTransactions } from 'state/enhancedTransactions/hooks'
import { useMemo } from 'react'
// import { formatSmart } from 'utils/format'

export default function ClaimingStatus() {
const { chainId } = useActiveWeb3React()
const { activeClaimAccount, claimStatus /* , claimedAmount */ } = useClaimState()

const allClaimTxs = useAllClaimingTransactions()
const lastClaimTx = useMemo(() => {
const numClaims = allClaimTxs.length
return numClaims > 0 ? allClaimTxs[numClaims - 1] : undefined
}, [allClaimTxs])

// claim status
const isConfirmed = claimStatus === ClaimStatus.CONFIRMED
const isAttempting = claimStatus === ClaimStatus.ATTEMPTING
Expand Down Expand Up @@ -55,11 +64,9 @@ export default function ClaimingStatus() {
</p>
</AttemptFooter>
)}
{isSubmitted && chainId && (
// && claimTxn?.hash
{isSubmitted && chainId && lastClaimTx?.hash && (
<ExternalLink
// href={getExplorerLink(chainId, claimTxn?.hash, ExplorerDataType.TRANSACTION)}
href="#"
href={getExplorerLink(chainId, lastClaimTx.hash, ExplorerDataType.TRANSACTION)}
style={{ zIndex: 99, marginTop: '20px' }}
>
<Trans>View transaction on Explorer</Trans>
Expand Down

0 comments on commit 9615e5f

Please sign in to comment.