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

Commit

Permalink
Updated claim enum usage and some other small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nenadV91 committed Jan 6, 2022
1 parent 319d7a9 commit 42e307a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 20 deletions.
8 changes: 2 additions & 6 deletions src/custom/pages/Claim/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,7 @@ export default function Claim() {
)}
</ConfirmedIcon>
<h3>{claimConfirmed ? 'Claimed!' : 'Claiming'}</h3>
{!claimConfirmed && (
<p>
<Trans>{formatSmart(unclaimedAmount)} vCOW</Trans>
</p>
)}
{!claimConfirmed && <Trans>{formatSmart(unclaimedAmount)} vCOW</Trans>}

{claimConfirmed && (
<>
Expand All @@ -381,7 +377,7 @@ export default function Claim() {
</Trans>
</>
)}
{claimAttempting && !claimSubmitted && (
{claimAttempting && !claimSubmitted && !claimConfirmed && (
<AttemptFooter>
<p>
<Trans>Confirm this transaction in your wallet</Trans>
Expand Down
3 changes: 3 additions & 0 deletions src/custom/pages/Claim/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ export const ConfirmOrLoadingWrapper = styled.div<{ activeBG: boolean }>`
padding: 24px;
color: white;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
background: linear-gradient(315deg, #000000 0%, #000000 55%, #202020 100%);
/* background: ${({ activeBG }) =>
activeBG &&
Expand Down
12 changes: 6 additions & 6 deletions src/custom/state/claim/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ const CLAIMS_REPO_BRANCH = 'main'
export const CLAIMS_REPO = `https://raw.githubusercontent.com/gnosis/cow-merkle-drop/${CLAIMS_REPO_BRANCH}/`

export const enum ClaimType {
Airdrop = 'Airdrop', // free, no vesting, can be available on both mainnet and gchain
GnoOption = 'GnoOption', // paid, with vesting, must use GNO, can be available on both mainnet and gchain
UserOption = 'UserOption', // paid, with vesting, must use Native currency, can be available on both mainnet and gchain
Investor = 'Investor', // paid, with vesting, must use USDC, only on mainnet
Team = 'Team', // free, with vesting, only on mainnet
Advisor = 'Advisor', // free, with vesting, only on mainnet
Airdrop, // free, no vesting, can be available on both mainnet and gchain
GnoOption, // paid, with vesting, must use GNO, can be available on both mainnet and gchain
UserOption, // paid, with vesting, must use Native currency, can be available on both mainnet and gchain
Investor, // paid, with vesting, must use USDC, only on mainnet
Team, // free, with vesting, only on mainnet
Advisor, // free, with vesting, only on mainnet
}

type RepoClaimType = keyof typeof ClaimType
Expand Down
16 changes: 8 additions & 8 deletions src/custom/state/claim/hooks/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,17 @@ export function getTypeToCurrencyMap(chainId: number | undefined): TypeToCurrenc
if (!chainId) return {}

const map: TypeToCurrencyMapper = {
GnoOption: 'GNO',
Investor: 'USDC',
UserOption: '',
[ClaimType.GnoOption]: 'GNO',
[ClaimType.Investor]: 'USDC',
[ClaimType.UserOption]: '',
}

if ([SupportedChainId.MAINNET, SupportedChainId.RINKEBY].includes(chainId)) {
map.UserOption = 'ETH'
map[ClaimType.UserOption] = 'ETH'
}

if (chainId === SupportedChainId.XDAI) {
map.UserOption = 'XDAI'
map[ClaimType.UserOption] = 'XDAI'
}

return map
Expand All @@ -108,9 +108,9 @@ export type TypeToPriceMapper = {
export function getTypeToPriceMap(): TypeToPriceMapper {
// Hardcoded values
const map: TypeToPriceMapper = {
GnoOption: 16.66,
Investor: 26.66,
UserOption: 36.66,
[ClaimType.GnoOption]: 16.66,
[ClaimType.Investor]: 26.66,
[ClaimType.UserOption]: 36.66,
}

return map
Expand Down

0 comments on commit 42e307a

Please sign in to comment.