Skip to content

Commit

Permalink
Merge branch 'main' of github.com:TrustlessComputer/bvm-website
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfred committed Jan 31, 2024
2 parents 0a7044b + e3a01d7 commit 1b69d39
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 38 deletions.
4 changes: 2 additions & 2 deletions src/modules/PublicSale/activities/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Good luck and have fun!
},
],
desc: 'NakaChain is a low-cost and lightning-fast Bitcoin Layer 2 blockchain designed for DeFi apps, enabling the payment of gas fees in Bitcoin. It’s powered by BVM with these modules: Bitcoin for security, Polygon for data availability, and Optimism for execution.' +
'<br/><br/>On the second day of awesomeness, challenge yourself to dominate the market by trading futures on BRC-20 tokens\' prices. The top gainer will be rewarded every 2 hours.' +
'<br/><br/>On the second day of awesomeness, challenge yourself to dominate the market by trading futures on BRC-20 tokens\' prices. Every two hours, the top gainer will earn $250 in Bitcoin.\n' +
'<br/><br/>Total rewards: <span style="color: #FA4E0E">$3,000</span>',
},
{
Expand Down Expand Up @@ -172,7 +172,7 @@ Good luck and have fun!
.toNumber();

// Case naka start at 4h UTC
if (diffDay === 1 && dayjs.utc().hour() < 4) {
if (diffDay === ActivityType.Day2 && dayjs.utc().hour() < 4) {
diffDay = 0;
}

Expand Down
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
60 changes: 28 additions & 32 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 @@ -189,38 +198,25 @@ const RaffleButton = ({ className }: any) => {
<>
<Flex
className={cx(s.learnMoreWrapper)}
gap={3}
gap={2}
onClick={handleShareTw}
cursor="pointer"
>
<Text lineHeight={'100%'} fontSize={'14px'}>
Like and repost to join
</Text>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect width="24" height="24" fill="black" />
<g clip-path="url(#clip0_30479_11542)">
<path
d="M16.0256 5.67383H18.1722L13.4823 11.0347L19 18.3281H14.6798L11.2965 13.9041L7.42433 18.3281H5.2765L10.2932 12.5939L5 5.67441H9.42983L12.4882 9.71808L16.0256 5.67383ZM15.2725 17.0436H16.4619L8.7835 6.89124H7.50717L15.2725 17.0436Z"
fill="white"
/>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="24" height="24" fill="black"/>
<g clip-path="url(#clip0_30591_7687)">
<path d="M16.0256 5.67383H18.1722L13.4823 11.0347L19 18.3281H14.6798L11.2965 13.9041L7.42433 18.3281H5.2765L10.2932 12.5939L5 5.67441H9.42983L12.4882 9.71808L16.0256 5.67383ZM15.2725 17.0436H16.4619L8.7835 6.89124H7.50717L15.2725 17.0436Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_30479_11542">
<rect
width="14"
height="14"
fill="white"
transform="translate(5 5)"
/>
<clipPath id="clip0_30591_7687">
<rect width="14" height="14" fill="white" transform="translate(5 5)"/>
</clipPath>
</defs>
</svg>

<Text lineHeight={'100%'} fontSize={'13px'}>
Enter the raffle
</Text>
</Flex>
</>
)}
Expand Down Expand Up @@ -260,7 +256,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 +294,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
3 changes: 1 addition & 2 deletions src/modules/PublicSale/raffleButton/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,10 @@
.learnMoreWrapper {
background: #ffffff;
padding: 4px;
width: fit-content;
color: #000000;
font-size: 14px;
align-items: center;
justify-content: center;
//justify-content: center;
height: 32px;
gap: 8px;
width: 100%;
Expand Down
1 change: 0 additions & 1 deletion src/modules/Whitelist/leaderBoard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,6 @@ const LeaderBoard = (props: IProps) => {
{/*<InfiniteScroll*/}
{/* dataLength={columns.length}*/}
{/* next={() => {*/}
{/* console.log('SANG TEST: ');*/}
{/* refParams.current = {*/}
{/* ...refParams.current,*/}
{/* page: refParams.current.page + 1,*/}
Expand Down

0 comments on commit 1b69d39

Please sign in to comment.