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

Commit

Permalink
Rename constacts (#2180)
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin authored Jan 18, 2022
1 parent 8502d80 commit 172fe43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
11 changes: 1 addition & 10 deletions src/custom/pages/Claim/CanUserClaimMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,7 @@ export default function CanUserClaimMessage({ hasClaims, isAirdropOnly }: ClaimI
const { activeClaimAccount, claimStatus } = useClaimState()
const { setActiveClaimAccount } = useClaimDispatchers()

const { airdropDeadline, deployment, investmentDeadline, isAirdropWindowOpen, isInvestmentWindowOpen } =
useClaimTimeInfo()
// console.log('Deadlines', {
// airdropDeadline: airdropDeadline && new Date(airdropDeadline).toISOString(),
// deployment: deployment && new Date(deployment).toISOString(),
// investmentDeadline: investmentDeadline && new Date(investmentDeadline).toISOString(),

// isAirdropWindowOpen,
// isInvestmentWindowOpen,
// })
const { airdropDeadline } = useClaimTimeInfo()

// only show when active claim account
if (!activeClaimAccount || claimStatus !== ClaimStatus.DEFAULT) return null
Expand Down
8 changes: 4 additions & 4 deletions src/custom/state/claim/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export const GNO_PRICE = '375000000000000' // '0.000375' GNO (18 decimals) per v
export const USDC_PRICE = '150000' // '0.15' USDC (6 decimals) per vCOW, in atoms

// Constants regarding investment time windows
const TWO_WEEKS = ms`2 weeks`
const SIX_WEEKS = ms`6 weeks`
const INVESTMENT_TIME = ms`2 weeks`
const AIRDROP_TIME = ms`6 weeks`

// For native token price calculation
const DENOMINATOR = JSBI.exponentiate(JSBI.BigInt(10), JSBI.BigInt(18))
Expand Down Expand Up @@ -328,8 +328,8 @@ type ClaimTimeInfo = {
*/
export function useClaimTimeInfo(): ClaimTimeInfo {
const deployment = useDeploymentTimestamp()
const investmentDeadline = deployment && deployment + TWO_WEEKS
const airdropDeadline = deployment && deployment + SIX_WEEKS
const investmentDeadline = deployment && deployment + INVESTMENT_TIME
const airdropDeadline = deployment && deployment + AIRDROP_TIME

const isInvestmentWindowOpen = Boolean(investmentDeadline && investmentDeadline > Date.now())
const isAirdropWindowOpen = Boolean(airdropDeadline && airdropDeadline > Date.now())
Expand Down

0 comments on commit 172fe43

Please sign in to comment.