From edd0e72837048ff578179aeb41e8d86fe72210e1 Mon Sep 17 00:00:00 2001 From: 0xmegalodon Date: Wed, 31 Jan 2024 12:03:48 +0700 Subject: [PATCH] add tooltip & login --- .../PublicSale/leaderBoardVisual/index.tsx | 2 +- src/modules/PublicSale/raffleButton/index.tsx | 29 ++++++++++++------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/modules/PublicSale/leaderBoardVisual/index.tsx b/src/modules/PublicSale/leaderBoardVisual/index.tsx index 50ba1d250..f39f7c836 100644 --- a/src/modules/PublicSale/leaderBoardVisual/index.tsx +++ b/src/modules/PublicSale/leaderBoardVisual/index.tsx @@ -198,7 +198,7 @@ const LeaderBoardVisual = (props: IProps) => { listRender.map((item, index) => { return <> + isYou={user?.twitter_id === item?.twitter_id} key={item?.twitter_id || item?.twitter_username}/> { item?.lastRender && diff --git a/src/modules/PublicSale/raffleButton/index.tsx b/src/modules/PublicSale/raffleButton/index.tsx index 597830b47..b8d65b2ba 100644 --- a/src/modules/PublicSale/raffleButton/index.tsx +++ b/src/modules/PublicSale/raffleButton/index.tsx @@ -1,6 +1,4 @@ import { - Box, - Button, Center, Flex, Popover, @@ -19,7 +17,6 @@ import React, { useEffect, useState } from 'react'; import cx from 'clsx'; import { useAppSelector } from '@/stores/hooks'; import { userSelector } from '@/stores/states/user/selector'; -import { getLink } from '@/utils/helpers'; import { getPublicSaleProgram, getPublicSaleSummary, @@ -28,9 +25,9 @@ import { joinRafflePrograme, } from '@/services/public-sale'; import AuthenStorage from '@/utils/storage/authen.storage'; -import DepositClaimItHere from '@/modules/PublicSale/depositModal/deposit.claim.it.here'; import { formatCurrency } from '@/utils/format'; -import { isMobile } from 'react-device-detect'; +import BigNumber from 'bignumber.js'; +import { PUBLIC_SALE_START } from '@/modules/Whitelist'; const RaffleButton = ({ className }: any) => { const { isOpen, onOpen, onClose } = useDisclosure(); @@ -102,6 +99,18 @@ const RaffleButton = ({ className }: any) => { ); }; + const currentDay = React.useMemo(() => { + const diffDay = new BigNumber( + dayjs.utc(PUBLIC_SALE_START).diff(dayjs.utc(), 'days'), + ) + .absoluteValue() + .toNumber(); + return { + // step: DAYS.length > diffDay ? DAYS[diffDay] : DAYS[DAYS.length - 1], + diffDay, + }; + }, []); + return ( !isLoading && ( @@ -116,7 +125,7 @@ const RaffleButton = ({ className }: any) => { lineHeight={'12px'} fontWeight={400} > - Daily Raffle + Day {currentDay?.diffDay + 1} Raffle { onClick={handleShareTw} cursor="pointer" > - - Like and repost to join + + Enter the raffle { cursor="pointer" mt={'20px'} > - Like and repost to join + Enter the raffle { cursor="pointer" mt={'20px'} > - Like and repost to join + Enter the raffle