Skip to content

Commit

Permalink
Merge pull request #179 from TrustlessComputer/feat/whitelist_munual
Browse files Browse the repository at this point in the history
add tooltip & login
  • Loading branch information
0xmegalodon authored Jan 31, 2024
2 parents d7ab63b + edd0e72 commit 8fe5486
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/modules/PublicSale/leaderBoardVisual/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const LeaderBoardVisual = (props: IProps) => {
listRender.map((item, index) => {
return <>
<AvatarItem data={item} idx={index} isShowName={index < 4}
isYou={user?.twitter_id === item?.twitter_id} />
isYou={user?.twitter_id === item?.twitter_id} key={item?.twitter_id || item?.twitter_username}/>
{
item?.lastRender &&
<span className={`${styles.lastRender} ${styles[`lastRender__${item?.levelRender}`]}`}></span>
Expand Down
29 changes: 19 additions & 10 deletions src/modules/PublicSale/raffleButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {
Box,
Button,
Center,
Flex,
Popover,
Expand All @@ -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,
Expand All @@ -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();
Expand Down Expand Up @@ -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 && (
<Popover onClose={onClose} isOpen={isOpen}>
Expand All @@ -116,7 +125,7 @@ const RaffleButton = ({ className }: any) => {
lineHeight={'12px'}
fontWeight={400}
>
Daily Raffle
Day {currentDay?.diffDay + 1} Raffle
</Text>
<Flex gap={'6px'} className={s.timeWrapper}>
<Countdown
Expand Down Expand Up @@ -193,8 +202,8 @@ const RaffleButton = ({ className }: any) => {
onClick={handleShareTw}
cursor="pointer"
>
<Text lineHeight={'100%'} fontSize={'14px'}>
Like and repost to join
<Text lineHeight={'100%'} fontSize={'13px'}>
Enter the raffle
</Text>
<svg
width="24"
Expand Down Expand Up @@ -260,7 +269,7 @@ const RaffleButton = ({ className }: any) => {
cursor="pointer"
mt={'20px'}
>
<Text>Like and repost to join</Text>
<Text>Enter the raffle</Text>
<svg
width="24"
height="24"
Expand Down Expand Up @@ -298,7 +307,7 @@ const RaffleButton = ({ className }: any) => {
cursor="pointer"
mt={'20px'}
>
<Text>Like and repost to join</Text>
<Text>Enter the raffle</Text>
<svg
width="24"
height="24"
Expand Down

0 comments on commit 8fe5486

Please sign in to comment.