Skip to content

Commit

Permalink
chore: update code
Browse files Browse the repository at this point in the history
  • Loading branch information
camewell071 committed Jan 25, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 7fc0347 commit 73f6789
Showing 4 changed files with 69 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/modules/Whitelist/index.tsx
Original file line number Diff line number Diff line change
@@ -113,7 +113,7 @@ const Whitelist = () => {
<Steps />
</TabPanel>
<TabPanel>
<StepsEco />
<StepsEco setTabIndex={setIndex} />
</TabPanel>
<TabPanel>
<StepsAirdrop setIndex={setIndex}/>
18 changes: 14 additions & 4 deletions src/modules/Whitelist/stepsEco/Step/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { CDN_URL_ICONS } from '@/config';
import AllowBTCMessage from '@/modules/Whitelist/AllowBTCMessage';
import { Button, Flex } from '@chakra-ui/react';
import cs from 'classnames';
import cx from 'clsx';
import Image from 'next/image';
import React, { useMemo } from 'react';
import s from './styles.module.scss';
import sanitizeHtml from 'sanitize-html';
import { ALLOWED_ATTRIBUTES } from '@/constants/constants';

export interface IItemCommunity {
project: string;
@@ -25,6 +22,14 @@ export interface IItemCommunity {
desc: string;
tooltip?: any;
};
tag?: StepTagType
}

export const STEP_TAG = ['', 'New'];

export enum StepTagType {
NONE,
NEW,
}

export default function ItemCommunity({
@@ -56,7 +61,12 @@ export default function ItemCommunity({
<Flex direction={["column", "row"]} justifyContent="space-between" gap={[1, 4]}>
<Flex direction="column" w="100%">
<div className={s.itemCommunity__project}>{content?.project}</div>
<div className={s.itemCommunity__title}>{content?.title}</div>
<Flex gap="4px" alignItems="center">
{content?.tag !== undefined && (
<div className={cx(s.itemCommunity__tag, s[STEP_TAG[content?.tag].toLowerCase()])}>{STEP_TAG[content?.tag]}</div>
)}
<div className={s.itemCommunity__title}>{content?.title}</div>
</Flex>
{!!content?.desc && (
<div
className={s.itemCommunity__desc}
12 changes: 12 additions & 0 deletions src/modules/Whitelist/stepsEco/Step/styles.module.scss
Original file line number Diff line number Diff line change
@@ -89,6 +89,18 @@
display: none;
}
}
&__tag {
font-size: 12px;
font-weight: 400;
padding: 4px 12px;
border-radius: 100px;
height: fit-content;

&.new {
color: #FFFFFF;
background: linear-gradient(90deg, #F4603F 0%, #FFA751 100%);
}
}
}

.modalContent {
56 changes: 42 additions & 14 deletions src/modules/Whitelist/stepsEco/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import AuthenStorage from '@/utils/storage/authen.storage';
import { Flex, Tooltip } from '@chakra-ui/react';
import React, { useMemo, useState } from 'react';
import ItemStep, { IItemCommunity } from './Step';
import ItemStep, { IItemCommunity, StepTagType } from './Step';
import s from './styles.module.scss';
import VerifyBVMModal from './VerifyBVMModal';
import styles from '@/modules/Whitelist/leaderBoard/styles.module.scss';
@@ -18,7 +18,11 @@ export const LearnMore = (href: string) => {
</a>`;
};

const StepsEco = () => {
interface IProps {
setTabIndex: (_: number) => void
}

const StepsEco = ({ setTabIndex }: IProps) => {
const token = AuthenStorage.getAuthenKey();
const [showSyncBVM, setShowSyncBVM] = useState(false);
const [showDownloadAlphaApp, setShowDownloadAlphhaApp] = useState(false);
@@ -49,6 +53,28 @@ const StepsEco = () => {
// desc: '',
// },
// },
{
project: 'Bitcoin L2 for GameFi',
title: "Bitcoin Arcade",
desc: `<span style='font-style: italic'>The first ever fully on-chain gaming blockchain on Bitcoin.</span>${LearnMore(
'https://bitcoinarcade.xyz/',
)}<br/>
Get rewarded with 1,000 PTS for every match you play on Bitcoin Arcade. Have fun, play, and earn more points.
`,
actionText: token ? 'Download app' : 'Craft a tweet about BVM first',
image: 'bitcoin-arcade.svg',
isActive: true,
actionHandle: () => {
if (!token) {
return setTabIndex(0)
}
setShowDownloadBitcoinArcadeApp(true);
},
right: {
title: '+1000 PTS',
desc: 'per match',
},
},
{
project: 'Bitcoin L2 for SoFi',
title: 'Alpha',
@@ -88,11 +114,12 @@ const StepsEco = () => {
},
{
project: 'Bitcoin L2 for DeFi',
title: 'NakaChain',
desc: `<span style='font-style: italic'>A low-cost and lightning-fast Bitcoin Layer 2 blockchain designed for DeFi apps.</span>${LearnMore(
title: 'NakaChain Perpetual',
desc: `<span style='font-style: italic'>The first decentralized perpetual BRC20 trading platform. </span>${LearnMore(
'https://nakachain.xyz/',
)}<br/>
Swap and add liquidity on Naka Genesis to earn points. The higher the volume you make the more points you will get.
Play long/short brc20 on Naka Genesis to earn points.<br/>
The higher the volume you make the more points you will get.
`,
actionText: 'Connect Naka Genesis',
image: 'ic-naka.svg',
@@ -104,24 +131,25 @@ const StepsEco = () => {
title: '+1000 PTS',
desc: 'per 0.001 BTC',
},
tag: StepTagType.NEW
},
{
project: 'Bitcoin L2 for GameFi',
title: "Bitcoin Arcade",
desc: `<span style='font-style: italic'>The first ever fully on-chain gaming blockchain on Bitcoin.</span>${LearnMore(
'https://bitcoinarcade.xyz/',
project: 'Bitcoin L2 for DeFi',
title: 'NakaChain Swap',
desc: `<span style='font-style: italic'>A low-cost and lightning-fast Bitcoin Layer 2 blockchain designed for DeFi apps.</span>${LearnMore(
'https://nakachain.xyz/',
)}<br/>
Get rewarded with 1,000 PTS for every match you play on Bitcoin Arcade. Have fun, play, and earn more points.
Swap and add liquidity on Naka Genesis to earn points. The higher the volume you make the more points you will get.
`,
actionText: 'Download app',
image: 'bitcoin-arcade.svg',
actionText: 'Connect Naka Genesis',
image: 'ic-naka.svg',
actionHandle: () => {
setShowDownloadBitcoinArcadeApp(true);
setShowSyncBVM(true);
},
isActive: !!token,
right: {
title: '+1000 PTS',
desc: 'per match',
desc: 'per 0.001 BTC',
},
},
];

0 comments on commit 73f6789

Please sign in to comment.