diff --git a/components/ClaimButton.tsx b/components/ClaimButton.tsx index 2c5f876..9cfab0c 100644 --- a/components/ClaimButton.tsx +++ b/components/ClaimButton.tsx @@ -4,10 +4,15 @@ import DefaultButton, { DefaultButtonProps } from './common/DefaultButton'; export interface ClaimButtonProps extends DefaultButtonProps { allowance: number; walletAlreadyClaimed: number; + withinClaimPeriod: boolean; } -const ClaimButton = ({ allowance, walletAlreadyClaimed, disabled, ...rest }: ClaimButtonProps) => { +const ClaimButton = ({ allowance, walletAlreadyClaimed, withinClaimPeriod, disabled, ...rest }: ClaimButtonProps) => { const getClaimButtonText = () => { + if (!withinClaimPeriod) { + return 'CLAIM PLOTS'; + } + if (allowance > 0 && allowance > walletAlreadyClaimed) { return `CLAIM ${allowance - walletAlreadyClaimed} PLOTS`; } @@ -20,7 +25,10 @@ const ClaimButton = ({ allowance, walletAlreadyClaimed, disabled, ...rest }: Cla }; return ( - + {getClaimButtonText()} ); diff --git a/pages/index.tsx b/pages/index.tsx index b6dc51a..eb39baf 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -156,6 +156,7 @@ const Home: NextPage = () => { Date.now()} disabled={!address} onClick={ walletAlreadyClaimed === 0 || walletAlreadyClaimed < allowance ? handleOpenClaimModal : showMintedNfts diff --git a/yarn.lock b/yarn.lock index 5c1a4c2..a8bd383 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2737,7 +2737,7 @@ "resolved" "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-1.4.2.tgz" "version" "1.4.2" dependencies: - "ethereumjs-abi" "git+https://github.com/ethereumjs/ethereumjs-abi.git" + "ethereumjs-abi" "0.6.8" "ethereumjs-util" "^5.1.1" "ethereum-bloom-filters@^1.0.6":