Skip to content

Commit

Permalink
Merge branch 'peter/main-lm' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter committed Feb 2, 2024
2 parents c6b89fa + 13c622d commit 1a50703
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 76 deletions.
88 changes: 55 additions & 33 deletions src/modules/PublicSale/activities/AcitivitiesVer2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ enum ActivityType {
AI
}

const MODULAR_TW_LINK = "https://twitter.com/BVMnetwork/status/1752952381007171646";

export interface GameItemProps {
title: string;
subTitle?: string;
desc: string | any;
ctas?: ICTA[];
banner?: string,
link?: string,
type: ActivityType
type: ActivityType,
bannerLink?: string
}

const GAME_LINK = {
Expand Down Expand Up @@ -128,7 +131,7 @@ const ActivitiesVer2 = React.memo(() => {
desc: `
<ul>
${NormalRow({ key: "Activities:", value: "Play 8 different fully on-chain games to earn rewards." })}
${NormalRow({ key: "Rewards:", value: "Each game: $100 (1st place), $50 (2nd place), $30 (3rd place), $10 (4th), $10 (5th)." })}
${NormalRow({ key: "Prizes:", value: "Each game: $100 (1st), $50 (2nd), $30 (3rd), $10 (4th), $10 (5th)." })}
${LinkRow({ key: "Bitcoin L2:", value: "Bitcoin Arcade", link: GAME_LINK.ARCA })}
</ul>
`,
Expand All @@ -141,7 +144,7 @@ const ActivitiesVer2 = React.memo(() => {
desc: `
<ul>
${NormalRow({ key: "Activities:", value: "Trade BRC-20 perpetual futures on-chain." })}
${NormalRow({ key: "Rewards:", value: "$50 every 4 hours & 100k Naka points every hours." })}
${NormalRow({ key: "Prizes:", value: "$50 every 4 hours & 100k Naka points every hours." })}
${LinkRow({ key: "Bitcoin L2:", value: "Naka", link: GAME_LINK.NAKA })}
</ul>
`,
Expand All @@ -154,20 +157,21 @@ const ActivitiesVer2 = React.memo(() => {
desc: `
<ul>
${NormalRow({ key: "Activities:", value: "Learn about modular blockchain architecture via an exciting Lego game." })}
${NormalRow({ key: "Rewards:", value: "Bitcoin Punk 686 (1st place), Rare Modular (2nd place), Common Modular (3rd place)." })}
${NormalRow({ key: "Prizes:", value: "Bitcoin Punk 686 (1st), Rare Modular (2nd), Modular (3rd)." })}
${LinkRow({ key: "Bitcoin L2:", value: "Modular", link: GAME_LINK.MODULAR })}
</ul>
`,
banner: 'banner-03.png',
link: GAME_LINK.MODULAR,
type: ActivityType.Modular,
bannerLink: MODULAR_TW_LINK
},
{
title: 'SocialFi on Bitcoin',
desc: `
<ul>
${NormalRow({ key: "Activities:", value: "Participate in a charity run." })}
${NormalRow({ key: "Rewards:", value: "For every km you run, you’ll raise $1 for charity and earn 10,000 Alpha points." })}
${NormalRow({ key: "Prizes:", value: "Raise $1 for charity & earn 10K Alpha points for each km you run." })}
${LinkRow({ key: "Bitcoin L2:", value: "Alpha", link: GAME_LINK.ALPHA })}
</ul>
`,
Expand All @@ -180,8 +184,8 @@ const ActivitiesVer2 = React.memo(() => {
subTitle: " (Available on Monday)",
desc: `
<ul>
${NormalRow({ key: "Rewards:", value: undefined, mask: true })}
${NormalRow({ key: "Activities:", value: "Play fully on-chain games" })}
${NormalRow({ key: "Prizes:", value: undefined, mask: true })}
${NormalRow({ key: "Activities:", value: "Train your fully on-chain AI." })}
${LinkRow({ key: "Bitcoin L2:", value: "Eternal AI", link: GAME_LINK.AI })}
</ul>
`,
Expand All @@ -201,37 +205,51 @@ const ActivitiesVer2 = React.memo(() => {
const gameReport = numberReport.gameReport
if (gameReport && gameReport.total_game && gameReport.total_txs) {
component1 = ReportRow({
key: "Game plays",
key: "games played",
value: gameReport.total_game.toString(),
});
component2 = ReportRow({
key: "Tx",
value: gameReport.total_txs.toString(),
})
component2 = (
<Flex cursor="pointer" onClick={() => {
window.open("https://explorer.testnet.bitcoinarcade.xyz/", "_blank")
}}>
{ReportRow({
key: "transactions",
value: gameReport.total_txs.toString(),
})}
</Flex>
)
}
break;
}
case ActivityType.Naka: {
const nakaVolume = numberReport.nakaVolume
if (nakaVolume && nakaVolume.usd_volume) {
component1 = ReportRow({
key: "Vols",
value: nakaVolume.usd_volume.toString(),
maxDigit: 2,
prefix: "$"
});
component1 = (
<Flex cursor="pointer" onClick={() => {
window.open("https://explorer.nakachain.xyz/address/0x43eF235efF5d8Aa29D34bCB7AE42dCFA6A86477e", "_blank")
}}>
{
ReportRow({
key: "volume",
value: nakaVolume.usd_volume.toString(),
maxDigit: 2,
prefix: "$"
})
}
</Flex>
);
}
break;
}
case ActivityType.Modular: {
const modular = numberReport.modular
if (modular && modular.total_owner && modular.total_model) {
component1 = ReportRow({
key: "Builders",
key: "builders",
value: modular.total_owner.toString()
});
component2 = ReportRow({
key: "Builds",
key: "builds",
value: modular.total_model.toString()
});
}
Expand All @@ -241,11 +259,11 @@ const ActivitiesVer2 = React.memo(() => {
const alphaRun = numberReport.alphaRun
if (alphaRun && alphaRun.total_distance && alphaRun.total_reward) {
component1 = ReportRow({
key: "Km",
key: "km ran",
value: alphaRun.total_distance.toString()
});
component2 = ReportRow({
key: "Fund raised",
key: "charity raised",
value: new BigNumber(alphaRun.total_reward.toString()).div(1e8).times(btcPrice).toString(),
maxDigit: 2,
prefix: "$"
Expand All @@ -255,9 +273,13 @@ const ActivitiesVer2 = React.memo(() => {
}
}
if (!component1 && !component2) return <></>;
const isModular = type === ActivityType.Modular;

return (
<Flex alignItems="center" gap="8px">
<Flex alignItems="center" gap="8px" cursor={isModular ? "pointer" : "unset"} onClick={() => {
if(!isModular) return;
window.open(MODULAR_TW_LINK, "_blank")
}}>
{!!component1 && (
component1
)}
Expand All @@ -269,7 +291,7 @@ const ActivitiesVer2 = React.memo(() => {
)}
</Flex>
)
}, []);
}, [numberReport]);

const renderItem = (item: GameItemProps) => {
return (
Expand All @@ -286,9 +308,9 @@ const ActivitiesVer2 = React.memo(() => {
</div>
<div className={styles.container_item_media}>
{!!item.banner && (
!!item.link ?
(!!item.link || !!item.bannerLink) ?
(
<a href={item.link || ""} target='_blank'>
<a href={item.bannerLink || item.link || ""} target='_blank'>
<Image draggable={false} src={`public-sale/${item.banner}`} style={{ width: "100%" }} alt="banner"/>
</a>
) :
Expand All @@ -303,16 +325,16 @@ const ActivitiesVer2 = React.memo(() => {

return (
<Box className={styles.wrap}>
<Flex flexDir="column" gap="16px" className={styles.container}>
<Flex id="HEADER" flexDir="column" gap="8px" className={styles.container_header}>
<Flex flexDir="column" gap="20px" className={styles.container}>
<Flex id="HEADER" flexDir="column" className={styles.container_header}>
<Text color="white" fontSize={{ base: "18px", md: "24px" }} lineHeight="140%">
BITCOIN L2 HOPPING WEEKEND
BITCOIN L2 HOPPING WEEKEND.
</Text>
<Text color="white" fontSize={{ base: "14px", md: "16px" }} lineHeight="140%" opacity={0.7}>
Explore Bitcoin like never before. Hop from one Bitcoin L2 to another to play on-chain games, trade BRC-20 futures, run for charity, learn about modular architecture, and more!
<Text color="white" fontSize={{ base: "18px", md: "24px" }} lineHeight="140%" opacity={0.7}>
EXPLORE BITCOIN LIKE NEVER BEFORE.
</Text>
<Text color="white" fontSize={{ base: "14px", md: "16px" }} lineHeight="140%" opacity={0.7}>
Time: from now to 3:30 am UTC Monday, Feb 5
<Text color="white" fontSize={{ base: "14px", md: "16px" }} lineHeight="140%" opacity={0.7} mt="10px">
Hop from one Bitcoin L2 to another to play on-chain games, trade BRC-20 futures, run for charity, learn about modular architecture, and more! Events end on Monday, Feb 5, at 3:30 am UTC.
</Text>
</Flex>
<Flex flexDir="column" gap="20px">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
justify-content: space-between;
padding: 10px 16px;
border-bottom: 1px solid rgba(255, 255, 255, 0.15);
@include is-mobile {
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
gap: 8px;
}
}
&_content {
padding: 12px 12px 12px 34px;
Expand Down
5 changes: 3 additions & 2 deletions src/modules/PublicSale/dailyReward/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const DailyReward = () => {
<Flex direction={"column"} className={s.wrapper}>
<HourlyReward />
<Flex className={s.container}>
<Flex justifyContent={"space-between"} alignItems={"center"}>
<Text fontSize={"11px"} fontWeight={400} color={"rgba(255, 255, 255, 0.7)"}>Daily Reward</Text>
<Flex justifyContent={"space-between"} alignItems={"center"} gap={"4px"}>
<Text fontSize={"11px"} fontWeight={400} color={"rgba(255, 255, 255, 0.7)"}>RAFFLE</Text>
<Flex gap={'6px'} className={s.timeWrapper}>
<Countdown
className={s.time}
Expand All @@ -40,6 +40,7 @@ const DailyReward = () => {
.toString()}
hideIcon={true}
onRefreshEnd={() => setIsEnd(true)}
isHideSecond={true}
/>
</Flex>
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $time:10s; // including 1 flip
transition: all 0.3s;
position: relative;
//cursor: pointer;
width: 165px;
width: 178px;
//height: 99px;
//padding: 6px;

Expand Down
4 changes: 2 additions & 2 deletions src/modules/PublicSale/leaderBoardVisual/AvatarItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getUrlAvatarTwitter } from '@/utils/twitter';
import React, { forwardRef, ReactElement, useEffect, useMemo, useRef, useState } from 'react';
import Image from 'next/image';
import { ILeaderBoardPoint } from '@/interfaces/leader-board-point';
import { formatCurrency } from '@/utils/format';
import { formatCurrency, formatName2 } from '@/utils/format';
import { DotLottiePlayer } from '@dotlottie/react-player';
import { gsap } from 'gsap';
import { useAppSelector } from '@/stores/hooks';
Expand Down Expand Up @@ -122,7 +122,7 @@ const AvatarItem = forwardRef((props: IProps, ref: any) => {
<div className={s.meta}>
<p className={s.price} ref={refInertMoney}></p>
{
!isYou && <p className={s.name}>{data?.twitter_name}</p>
!isYou && <p className={s.name}>{formatName2(data?.twitter_name)}</p>
}
{
isYou && <p className={cx(s.name, s.isYou)}>You</p>
Expand Down
18 changes: 5 additions & 13 deletions src/modules/PublicSale/luckyMoney/LuckMoneyModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,11 @@ export default function LuckyMoneyModal({ envelopSrc }: Props) {

const saleSummary = await getPublicSaleSummary();

const content = `Welcome to the future of Bitcoin!\n\n$BVM is the 1st modular blockchain meta-protocol that allows launching Bitcoin L2 in a few clicks\n\nJoin the ${formatCurrency(
saleSummary.total_user || '0',
0,
0,
'BTC',
false,
)} early contributors who've committed $${formatCurrency(
saleSummary.total_usdt_value_not_boost || '0',
0,
0,
'BTC',
true,
)} to building Bitcoin's future with @BVMnetwork\n\n`;
const content = `Just got ${
reward?.bvm_amount || 0
} $BVM from the Red Packet giveaway at BVM public sale 🧧\n\n@BVMnetwork is the first modular blockchain metaprotocol that will power thousands of Bitcoin L2s!\n\nJoin me and the ${
saleSummary.total_user || '0'
} early contributors to build the Bitcoin's future with $BVM\n\n`;

setTimeout(() => {
return window.open(
Expand Down
17 changes: 4 additions & 13 deletions src/modules/PublicSale/raffleButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ const RaffleButton = ({ className }: any) => {
? window.open(programeInfo?.link, '_blank')
: undefined
}
alignItems={"center"}
>
<Text
className={s.text_text}
Expand All @@ -145,10 +146,10 @@ const RaffleButton = ({ className }: any) => {
fontWeight={500}
textTransform={"uppercase"}
>
Day {currentDay?.diffDay + 1} Raffle
PERCEPTRON #121
</Text>
<Flex gap={'6px'} className={s.timeWrapper}>
<Text className={s.time} color={"#FFFFFF"}>{programeInfo?.sub_title}</Text>
<Text className={s.time} color={"#FFFFFF"}>by Fingerprints DAO x Generative</Text>
</Flex>
</Flex>
<Flex gap={4} w={"100%"}>
Expand Down Expand Up @@ -229,18 +230,8 @@ const RaffleButton = ({ className }: any) => {
}}
cursor="pointer"
w={"100%"}
justifyContent={"center"}
>
<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_30591_7687">
<rect width="14" height="14" fill="white" transform="translate(5 5)"/>
</clipPath>
</defs>
</svg>
<Text lineHeight={'100%'} fontSize={'12px'}>
Tweet to enter
</Text>
Expand Down
20 changes: 8 additions & 12 deletions src/modules/PublicSale/raffleButton/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@
display: flex;
flex-direction: row;
align-items: center;
//justify-content: center;
//left: 0;
//right: 0;
//margin-left: auto;
//margin-right: auto;
width: fit-content;
justify-content: center;
width: 100%;
margin-bottom: 8px;
}

Expand All @@ -61,14 +57,14 @@
background-repeat: no-repeat;
padding: 4px;
align-items: flex-start;
width: 80px;
height: 80px;
width: 165px;
height: 165px;

> img {
min-width: 72px;
min-height: 72px;
max-width: 72px;
max-height: 72px;
min-width: 157px;
min-height: 157px;
max-width: 157px;
max-height: 157px;
}
}
}
Expand Down
Loading

0 comments on commit 1a50703

Please sign in to comment.