This repository was archived by the owner on Jun 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show banner if the user has claimed already (#2393)
* Show banner if the user has claimed already * Update claimed banner message and color * Change one const name
- Loading branch information
Showing
5 changed files
with
50 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Trans } from '@lingui/macro' | ||
import { useClaimState } from 'state/claim/hooks' | ||
import { ClaimBanner as ClaimBannerWrapper } from './styled' | ||
import CheckCircle from 'assets/cow-swap/check.svg' | ||
import { ClaimStatus } from 'state/claim/actions' | ||
import SVG from 'react-inlinesvg' | ||
import { ClaimCommonTypes } from 'pages/Claim/types' | ||
|
||
type ClaimBannerProps = Pick<ClaimCommonTypes, 'hasClaims'> & { | ||
isClaimed: boolean | ||
} | ||
|
||
export default function ClaimBanner({ hasClaims, isClaimed }: ClaimBannerProps) { | ||
const { claimStatus, activeClaimAccount, isInvestFlowActive } = useClaimState() | ||
|
||
const shouldShowBanner = | ||
claimStatus === ClaimStatus.DEFAULT && !!activeClaimAccount && !isInvestFlowActive && (hasClaims || isClaimed) | ||
|
||
if (!shouldShowBanner) return null | ||
|
||
return ( | ||
<ClaimBannerWrapper isClaimed={isClaimed}> | ||
<SVG src={CheckCircle} description="eligible" /> | ||
<Trans> | ||
{hasClaims | ||
? 'This account is eligible for vCOW token claims!' | ||
: 'This account has already claimed vCOW tokens!'} | ||
</Trans> | ||
</ClaimBannerWrapper> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters