Skip to content

Commit

Permalink
Merge pull request #112 from TrustlessComputer/feat/whitelist_munual
Browse files Browse the repository at this point in the history
update css
  • Loading branch information
0xmegalodon authored Jan 29, 2024
2 parents 90fabd2 + ece270b commit 8a3c499
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 33 deletions.
21 changes: 10 additions & 11 deletions src/modules/PublicSale/AuthForBuy/buyAsGuest.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import SvgInset from '@/components/SvgInset';
import { generateTOkenWithSecretCode } from '@/services/public-sale';
import { setGuestSecretCode } from '@/stores/states/user/reducer';
import { generateRandomString } from '@/utils/encryption';
import AuthenStorage from '@/utils/storage/authen.storage';
import {
Box,
Button,
Center,
Divider,
Flex,
Spinner,
Text,
Text
} from '@chakra-ui/react';
import { ethers } from 'ethers';
import React, { useCallback, useEffect, useState } from 'react';
import { useGoogleReCaptcha } from 'react-google-recaptcha-v3';
import DepositContent from '../depositModal/deposit.content';
import SvgInset from '@/components/SvgInset';
import s from './styles.module.scss';
import copy from 'copy-to-clipboard';
import { useCallback, useEffect, useState } from 'react';
import { useGoogleReCaptcha } from 'react-google-recaptcha-v3';
import toast from 'react-hot-toast';
import AuthenStorage from '@/utils/storage/authen.storage';
import { useDispatch } from 'react-redux';
import { setGuestSecretCode } from '@/stores/states/user/reducer';
import DepositContent from '../depositModal/deposit.content';
import s from './styles.module.scss';

export const SECRET_CODE_GUEST = 'SECRET_CODE_GUEST';
export const BARER_TOKEN_GUEST = 'BARER_TOKEN_GUEST';
Expand Down Expand Up @@ -53,7 +52,7 @@ const BuyAsGuest = () => {
if (secretCode) {
return;
}
const _secretCode = ethers.Wallet.createRandom().privateKey.slice(0, 10);
const _secretCode = generateRandomString(10);

const rs = await generateTOkenWithSecretCode(_secretCode, captcha);
AuthenStorage.setGuestSecretKey(_secretCode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { getUrlAvatarTwitter } from '@/utils/twitter';
import React, { forwardRef, ReactElement, useState } from 'react';
import Image from 'next/image';
import { ILeaderBoardPoint } from '@/interfaces/leader-board-point';
import { formatCurrency } from '@/utils/format';

interface IProps {
data: ILeaderBoardPoint
Expand All @@ -19,6 +20,8 @@ const AvatarItem = forwardRef((props: IProps, ref: any) => {
src={'/images/mk-user.jpg'} alt={'user'} />;
};

console.log('data', data);

return (
<div
className={`${s.avatarItem} ${data.levelRender !== undefined && 'level-' + data.levelRender} js-avatarItem`} ref={ref} {...rest}>
Expand All @@ -43,7 +46,7 @@ const AvatarItem = forwardRef((props: IProps, ref: any) => {
'medium',
) || ''} alt={'medium'} />}
</div>
<p className={s.price}>$100,000</p>
<p className={s.price}>${formatCurrency(data?.usdt_value, 0, 0, 'BTC', true)}</p>
</div>
</div>
);
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 @@ -34,7 +34,7 @@ const LeaderBoardVisual = (props: IProps) => {
const hasIncrementedPageRef = useRef(false);
const refParams = useRef({
page: 1,
limit: 23,
limit: 24,
});
const refInitial = useRef(false);

Expand Down
41 changes: 21 additions & 20 deletions src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const getLink = (referralCode?: string) => {
// return `${window.location.origin}${referral}`;
};

const REFERRAL_TEXT = 'refer'
const REFERRAL_TEXT = 'refer';

export const shareReferralURL = (code: string) => {
if (APP_ENV === 'production') {
Expand All @@ -33,13 +33,13 @@ export const shareReferralURL = (code: string) => {

export const getReferralByURL = () => {
const params = new URLSearchParams(window.location?.search || '');
return params.get(REFERRAL_TEXT)
return params.get(REFERRAL_TEXT);
};

export const shareTwitterSignature = (params: {
fee: string | number,
txsCount: string | number,
point: string | number,
fee: string | number;
txsCount: string | number;
point: string | number;
}) => {
const shareUrl = getLink('');
let content = '';
Expand All @@ -54,30 +54,31 @@ export const shareTwitterSignature = (params: {
)}`,
'_blank',
);
}, 200)
}
}, 200);
};

export const shareBTCOG = (params: {
fee: string | number,
feeUSD: string | number,
refCode: string,
fee: string | number;
feeUSD: string | number;
refCode: string;
}) => {
const shareUrl = getLink(params.refCode);
const amount = new BigNumber(params.fee).gte(0.0001) ?
new BigNumber(params.fee).toFixed(4, BigNumber.ROUND_FLOOR) :
new BigNumber(params.fee).toFixed();
const content = `I ♥️ Bitcoin\n\nI’ve spent ${amount} BTC on transaction fees. Right now, that’s $${formatCurrency(new BigNumber(params.feeUSD || 1).toNumber() || 1, 0, 2)}.\n\nAnd I can’t wait for $BVM to launch.\n\n@BVMnetwork is going to be the future of Bitcoin. I’m going to be doing so much more with my BTC.\n\n${shareUrl}`;
const amount = new BigNumber(params.fee).gte(0.0001)
? new BigNumber(params.fee).toFixed(4, BigNumber.ROUND_FLOOR)
: new BigNumber(params.fee).toFixed();
const content = `I ♥️ Bitcoin\n\nI’ve spent ${amount} BTC on transaction fees. Right now, that’s $${formatCurrency(
new BigNumber(params.feeUSD || 1).toNumber() || 1,
0,
2,
)}.\n\nAnd I can’t wait for $BVM to launch.\n\n@BVMnetwork is going to be the future of Bitcoin. I’m going to be doing so much more with my BTC.\n\n${shareUrl}`;

setTimeout(() => {
window.open(
`https://twitter.com/intent/tweet?text=${encodeURIComponent(
content,
)}`,
`https://twitter.com/intent/tweet?text=${encodeURIComponent(content)}`,
'_blank',
);
}, 200)
}

}, 200);
};

export const getReferralSearchURL = (referralCode?: string) => {
let game_url = '';
Expand Down

0 comments on commit 8a3c499

Please sign in to comment.