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

Commit

Permalink
[Claim] Context state (#2064)
Browse files Browse the repository at this point in the history
* claim state: actions

* claim state: reducer

* claim state: hooks

* added state to main index

* type enum

* extrapolate EligibleBanner

* removed eslint exception comment

* createAction conversion

* createReducer conversion and remove unnecessary types
  • Loading branch information
W3stside authored Jan 11, 2022
1 parent efc1af0 commit 48d1b7a
Show file tree
Hide file tree
Showing 5 changed files with 672 additions and 454 deletions.
21 changes: 21 additions & 0 deletions src/custom/pages/Claim/EligibleBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Trans } from '@lingui/macro'
import useClaimState from './state'
import { CheckIcon, EligibleBanner as EligibleBannerWrapper } from './styled'

export default function EligibleBanner({ hasClaims }: { hasClaims: boolean }) {
const {
state: { claimAttempting, claimConfirmed, claimSubmitted, activeClaimAccount, isInvestFlowActive },
} = useClaimState()

const isEligible =
!claimAttempting && !claimConfirmed && !claimSubmitted && !!activeClaimAccount && !isInvestFlowActive && hasClaims

if (!isEligible) return null

return (
<EligibleBannerWrapper>
<CheckIcon />
<Trans>This account is eligible for vCOW token claims!</Trans>
</EligibleBannerWrapper>
)
}
Loading

0 comments on commit 48d1b7a

Please sign in to comment.