diff --git a/public/img/s2/icon-spin-gradient.svg b/public/img/s2/icon-spin-gradient.svg new file mode 100644 index 00000000..e2530f35 --- /dev/null +++ b/public/img/s2/icon-spin-gradient.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/api/index.ts b/src/api/index.ts index 65033954..e96ed85b 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -3,15 +3,6 @@ import { user } from "@nextui-org/react"; import axios, { AxiosResponse } from "axios"; import qs from "qs"; -type Response = { - status: string; - message: string; - result?: any; - error?: any; - data?: any; - statusCode?: number; -}; - const isProd = import.meta.env.PROD; const apiBaseURL = import.meta.env.VITE_API_BASE_URL; @@ -23,6 +14,15 @@ export const BASE_URL_TWITTER = `${BASE_URL}/twitter`; export const BASE_URL_LRT_POINTS = `${BASE_URL}/lrt-points`; export const BASE_URL_QUEST = `${BASE_URL}/quest-api`; +export interface APIResponse { + status: string; + message: string; + result?: T; + error?: any; + data?: T; + statusCode?: number; +} + export type BindInviteCodeWithAddressParams = { address: string; code?: string | null; @@ -31,7 +31,7 @@ export type BindInviteCodeWithAddressParams = { }; export const bindInviteCodeWithAddress = ( data: BindInviteCodeWithAddressParams -): Promise => { +): Promise => { console.log(data); if (!data.code) { delete data.code; @@ -41,7 +41,7 @@ export const bindInviteCodeWithAddress = ( }); }; -export const checkInviteCode = (code: string): Promise => { +export const checkInviteCode = (code: string): Promise => { return http.get(`${BASE_URL_API}/invite/validCode`, { params: { code, @@ -49,13 +49,13 @@ export const checkInviteCode = (code: string): Promise => { }); }; -export const getRemainDrawCount = (address: string): Promise => { +export const getRemainDrawCount = (address: string): Promise => { return http.get(`${BASE_URL_API}/invite/draw/nft/remain`, { params: { address }, }); }; -export const drawTrademarkNFT = (address: string): Promise => { +export const drawTrademarkNFT = (address: string): Promise => { return http.post(`${BASE_URL_API}/invite/draw/nft`, { address, }); @@ -63,7 +63,7 @@ export const drawTrademarkNFT = (address: string): Promise => { export const getRemainMysteryboxDrawCount = ( address: string -): Promise => { +): Promise => { return http.get(`${BASE_URL_API}/invite/draw/mysterybox/remain`, { params: { address }, }); @@ -71,32 +71,32 @@ export const getRemainMysteryboxDrawCount = ( export const getRemainMysteryboxDrawCountV2 = ( address: string -): Promise => { +): Promise => { return http.get(`${BASE_URL_API}/invite/draw/mysterybox/v2/remain`, { params: { address }, }); }; // for mint box params -export const mintMysteryboxNFT = (address: string): Promise => { +export const mintMysteryboxNFT = (address: string): Promise => { return http.post(`${BASE_URL_API}/invite/mint/mysterybox`, { address, }); }; -export const mintMysteryboxNFTV2 = (address: string): Promise => { +export const mintMysteryboxNFTV2 = (address: string): Promise => { return http.post(`${BASE_URL_API}/invite/mint/mysterybox/v2`, { address, }); }; -export const openMysteryboxNFT = (address: string): Promise => { +export const openMysteryboxNFT = (address: string): Promise => { return http.post(`${BASE_URL_API}/invite/open/mysterybox`, { address, }); }; -export const openMysteryboxNFTV2 = (address: string): Promise => { +export const openMysteryboxNFTV2 = (address: string): Promise => { return http.post(`${BASE_URL_API}/invite/open/mysterybox/v2`, { address, }); @@ -104,7 +104,7 @@ export const openMysteryboxNFTV2 = (address: string): Promise => { export const getRemainMysteryboxOpenableCount = ( address: string -): Promise => { +): Promise => { return http.get(`${BASE_URL_API}/invite/open/mysterybox/remain`, { params: { address }, }); @@ -112,64 +112,64 @@ export const getRemainMysteryboxOpenableCount = ( export const getRemainMysteryboxOpenableCountV2 = ( address: string -): Promise => { +): Promise => { return http.get(`${BASE_URL_API}/invite/open/mysterybox/v2/remain`, { params: { address }, }); }; -export const getMintSignature = (address: string): Promise => { +export const getMintSignature = (address: string): Promise => { return http.get(`${BASE_URL_API}/invite/validate/nft`, { params: { address, projectId: "NOVA-SBT-1" }, }); }; -export const getInvite = (address: string): Promise => +export const getInvite = (address: string): Promise => http.get(`${BASE_URL_API}/invite/${address}`); -export const getReferrer = (address: string): Promise => +export const getReferrer = (address: string): Promise => http.get(`${BASE_URL_API}/referrer/${address}`); export const getDepositETHThreshold = (): Promise<{ ethAmount: number }> => http.get(`${BASE_URL_POINTS}/addressTokenTvl/getDepositEthThreshold`); -export const getAccounTvl = (address: string): Promise => +export const getAccounTvl = (address: string): Promise => http.get(`${BASE_URL_POINTS}/addressTokenTvl/getAccounTvl`, { params: { address }, }); -export const getAccountPoint = (address: string): Promise => +export const getAccountPoint = (address: string): Promise => http.get(`${BASE_URL_POINTS}/addressTokenTvl/getAccountPoint`, { params: { address }, }); -export const getTotalTvl = (): Promise => +export const getTotalTvl = (): Promise => http.get(`${BASE_URL_POINTS}/addressTokenTvl/getTotalTvl`); -export const getActiveAccounts = (): Promise => +export const getActiveAccounts = (): Promise => http.get(`${BASE_URL_API}/invite/getActiveAccounts`); -export const getAccountTvl = (address: string): Promise => +export const getAccountTvl = (address: string): Promise => http.get(`${BASE_URL_POINTS}/addressTokenTvl/getAccounTvl`, { params: { address, }, }); -export const getGroupTvl = (address: string): Promise => +export const getGroupTvl = (address: string): Promise => http.get(`${BASE_URL_POINTS}/addressTokenTvl/getGroupTvl`, { params: { address, }, }); -export const getTotalTvlByToken = (): Promise => +export const getTotalTvlByToken = (): Promise => http.get(`${BASE_URL_POINTS}/addressTokenTvl/getTotalTvlByToken`); -export const getReferralTvl = (address: string): Promise => +export const getReferralTvl = (address: string): Promise => http.get(`${BASE_URL_POINTS}/addressTokenTvl/getReferralTvl`, { params: { address }, }); -export const getAccountTwitter = (params: any): Promise => +export const getAccountTwitter = (params: any): Promise => http.post(`${BASE_URL_API}/invite/account/twitter`, params); export type SupportToken = { @@ -202,7 +202,7 @@ export const getAccountRefferalsTVL = ( address: string, page = 1, limit = 100 -): Promise => +): Promise => http.get(`${BASE_URL_POINTS}/addressTokenTvl/getAccountRefferalsTVL`, { params: { address, page, limit }, }); @@ -219,12 +219,12 @@ export type PageParams = { limit: number; }; -export const getAccountsRank = (params?: PageParams): Promise => +export const getAccountsRank = (params?: PageParams): Promise => http.get(`${BASE_URL_POINTS}/addressTokenTvl/getAccountsRank`, { params, }); -export const getAccountRank = (address: string): Promise => +export const getAccountRank = (address: string): Promise => http.get(`${BASE_URL_POINTS}/addressTokenTvl/getAccountRank`, { params: { address }, }); @@ -258,7 +258,7 @@ export const getExplorerTokenTvl = ( export const validTwitter = ( twitterHandler: string, address?: string -): Promise => { +): Promise => { return http.get(`${BASE_URL_API}/invite/validTwitter2`, { params: { twitterHandler, @@ -292,7 +292,7 @@ export type RegisterAccountParams = { export const registerAccount = ( data: RegisterAccountParams -): Promise => { +): Promise => { console.log(data); if (!data.code) { delete data.code; @@ -306,7 +306,7 @@ export const registerAccountByBridge = (data: { address: string; code: string; siganture: string; -}): Promise => +}): Promise => http.post(`${BASE_URL_API}/invite/register/account/byBridge`, { ...data }); export type AccessTokenParams = { @@ -346,17 +346,17 @@ export const getTwitterUser = ( }, }); -export const checkOkx = (address: string): Promise => +export const checkOkx = (address: string): Promise => http.get(`${BASE_URL_API}/invite/check/okx`, { params: { addressList: [address] }, }); -export const visitReward = (address: string): Promise => +export const visitReward = (address: string): Promise => http.get(`${BASE_URL_API}/invite/visit/reward`, { params: { address }, }); -export const okxVisitTask = (address: string): Promise => +export const okxVisitTask = (address: string): Promise => http.get(`${BASE_URL_API}/task/okx/visit/task`, { params: { address } }); export const getEigenlayerPoints = (address: string) => @@ -411,12 +411,12 @@ export const getRenzoPoints = (address: string): Promise => params: { address }, }); -export const getTradeMarkRank = (address: string): Promise => +export const getTradeMarkRank = (address: string): Promise => http.get(`${BASE_URL_API}/referrer/tradeMark/balance/rank`, { params: { address }, }); -export const getTopInviteAndRandom = (date?: string): Promise => +export const getTopInviteAndRandom = (date?: string): Promise => http.get(`${BASE_URL_API}/referrer/daily/topInviteAndRandom`, { params: { date }, }); @@ -469,15 +469,15 @@ export const getLinkswapNovaPoints = ( params: { address }, }); -export const getRoyaltyBooster = (address: string): Promise => +export const getRoyaltyBooster = (address: string): Promise => http.get(`${BASE_URL_POINTS}/addressTokenTvl/getAccountLoyaltyBooster`, { params: { address }, }); -export const getNFTLashin = (address: string): Promise => +export const getNFTLashin = (address: string): Promise => http.get(`${BASE_URL_API}/nft/user/recruitment`, { params: { address } }); -export const postNFTLashin = (address: string): Promise => +export const postNFTLashin = (address: string): Promise => http.post(`${BASE_URL_API}/nft/user/recruitment?address=${address}`); export interface RsethPointsResponse { @@ -504,7 +504,7 @@ export const getRsethPoints = (address: string): Promise => params: { address }, }); -export const getUserTvl = (address: string): Promise => +export const getUserTvl = (address: string): Promise => http.get(`${BASE_URL_API}/invite/user/tvl`, { params: { address }, }); @@ -512,7 +512,7 @@ export const getUserTvl = (address: string): Promise => export const bindTwitter = ( address: string, accessToken: string -): Promise => { +): Promise => { return http.post(`${BASE_URL_API}/invite/bind/twitter`, { address, accessToken, @@ -535,7 +535,7 @@ export const getNovaProjectPoints = ( params: { address, project }, }); -export const checkBridge = async (address: string): Promise => +export const checkBridge = async (address: string): Promise => http.get(`${BASE_URL_API}/invite/check/bridge`, { params: { address } }); export interface BridgePoints { @@ -548,23 +548,25 @@ export const getBridgePoints = (name: string): Promise => params: { name }, }); -export const checkWinnerAddress = (address: string): Promise => +export const checkWinnerAddress = (address: string): Promise => http.get(`${BASE_URL_API}/referrer/checkWinnerAddress`, { params: { address }, }); -export const getEcoRamain = (address: string): Promise => +export const getEcoRamain = (address: string): Promise => http.get(`${BASE_URL_API}/nft/ecology/nft/remain`, { params: { address }, }); -export const getEcoRank = (): Promise => +export const getEcoRank = (): Promise => http.get(`${BASE_URL_API}/nft/ecology/rank`); -export const postEcoDraw = (address: string): Promise => +export const postEcoDraw = (address: string): Promise => http.post(`${BASE_URL_API}/nft/ecology/nft/draw?address=${address}`); -export const getMemeMysteryboxReward = (address: string): Promise => +export const getMemeMysteryboxReward = ( + address: string +): Promise => http.get(`${BASE_URL_API}/meme/meme/mysterybox/reward`, { params: { address }, }); @@ -572,18 +574,18 @@ export const getMemeMysteryboxReward = (address: string): Promise => export const authLogin = (data: { address: string; signature: string; -}): Promise => +}): Promise => http.post(`${BASE_URL_API}/auth/login`, { ...data, }); -export const getPointsDetail = (): Promise => +export const getPointsDetail = (): Promise => http.get(`${BASE_URL_API}/referrer/points/detail`); -export const getMystery3Reamin = (address: string): Promise => +export const getMystery3Reamin = (address: string): Promise => http.get(`${BASE_URL_API}/nft/mystery3/remain`, { params: { address } }); -export const drawMystery3 = (address: string): Promise => +export const drawMystery3 = (address: string): Promise => http.post(`${BASE_URL_API}/nft/mystery3/draw?address=${address}`); export interface NovaCategoryUserPoints { @@ -698,7 +700,7 @@ export const getTvlCategoryMilestone = (): Promise => http.get(`${BASE_URL_LRT_POINTS}/tvl/category/milestone`); -export const modifyUsername = (userName: string): Promise => +export const modifyUsername = (userName: string): Promise => http.post(`${BASE_URL_API}/invite/modify/username`, { userName }); export interface CategoryListItem { @@ -735,12 +737,15 @@ export const getCategoryList = ( } ); -export const dailyOpen = (): Promise => +export const dailyOpen = (): Promise => http.post(`${BASE_URL_API}/invite/checkin/open`); export const dailySkipMint = (): Promise => http.post(`${BASE_URL_API}/invite/skip`); +export const protocolSkipMint = (projectName: string): Promise => + http.post(`${BASE_URL_API}/invite/project/skip?projectName=${projectName}`); + export interface DailyCheckinHistoryData { date: string; expired: boolean; @@ -822,3 +827,14 @@ interface CategoryZKLResponse { export const getCategoryZKL = (): Promise => { return http.get(`${BASE_URL_LRT_POINTS}/tvl/category/milestone/s2-1`); }; + +export interface PortocolSpinItem { + projectName: string; + remainSpinNum: number; +} + +export const getProtocolSpin = (): Promise> => + http.get(`${BASE_URL_API}/invite/protocol/spin`); + +export const openProtocolSpin = (projectName: string): Promise => + http.post(`${BASE_URL_API}/invite/protocol/open?projectName=${projectName}`); diff --git a/src/components/DashboardS2/DailyRoulette/DailyDrawModal.tsx b/src/components/DashboardS2/DailyRoulette/DailyDrawModal.tsx index 75c299ec..0e479693 100644 --- a/src/components/DashboardS2/DailyRoulette/DailyDrawModal.tsx +++ b/src/components/DashboardS2/DailyRoulette/DailyDrawModal.tsx @@ -12,7 +12,12 @@ import { import { UseDisclosureReturn } from "@nextui-org/use-disclosure"; import Marquee from "@/components/Marquee"; import { useRef, useState, useEffect, useCallback, useMemo } from "react"; -import { dailyOpen, dailySkipMint } from "@/api"; +import { + dailyOpen, + openProtocolSpin, + dailySkipMint, + protocolSkipMint, +} from "@/api"; import { sleep } from "@/utils"; import useNovaNFT, { MysteryboxMintParams, @@ -31,6 +36,8 @@ interface IProps { modalInstance: UseDisclosureReturn; onDrawed: () => void; remain?: number; + type?: "daily" | "protocol"; + projectName?: string; } export const PrizeItems = [ { @@ -77,7 +84,7 @@ const DailyDrawModal: React.FC = (props: IProps) => { const { updateFactor } = useUpdateNftBalanceStore(); const { sendTrademarkMintTx } = useNovaNFT(); - const { modalInstance, onDrawed, remain } = props; + const { modalInstance, onDrawed, remain, type, projectName } = props; const drawRef = useRef<{ start: (target: number) => void }>(); const [mintResult, setMintResult] = useState<{ name: string; @@ -110,7 +117,10 @@ const DailyDrawModal: React.FC = (props: IProps) => { modalInstance.onOpen(); } setSpinging(true); - const res = await dailyOpen(); + const res = + type === "protocol" && projectName + ? await openProtocolSpin(projectName) + : await dailyOpen(); const tokenId = res.result.tokenId as number; const prizeId = PRIZE_MAP[tokenId]; onDrawed(); // update remain times @@ -135,7 +145,7 @@ const DailyDrawModal: React.FC = (props: IProps) => { mintResultModal.onOpen(); } setSpinging(false); - if (!remain || remain <= 1) { + if (!remain && !mintParams) { modalInstance.onClose(); } }, [ @@ -160,7 +170,7 @@ const DailyDrawModal: React.FC = (props: IProps) => { onDrawed(); // update remain times after mint tx setMintParams(undefined); updateFactor(); - } catch (e) { + } catch (e: any) { console.log(e); setMintStatus(MintStatus.Failed); if (e.message) { @@ -182,7 +192,9 @@ const DailyDrawModal: React.FC = (props: IProps) => { ]); const handleSkip = async () => { - await dailySkipMint(); + type === "protocol" && projectName + ? await protocolSkipMint(projectName) + : await dailySkipMint(); setMintParams(undefined); mintResultModal.onClose(); onDrawed(); // update remain times after skip @@ -201,9 +213,11 @@ const DailyDrawModal: React.FC = (props: IProps) => { } else if (minting) { return "Start Minting"; } else { - return `Spin Your Daily Roulette (${remain})`; + return `Spin Your ${ + type === "protocol" ? "Protocol" : "Daily" + } Roulette (${remain})`; } - }, [isInvaidChain, minting, remain]); + }, [isInvaidChain, minting, remain, type]); return ( <> @@ -218,16 +232,15 @@ const DailyDrawModal: React.FC = (props: IProps) => { {() => ( <> - Daily Roulette + {type === "protocol" ? "Protocol Roulette" : "Daily Roulette"}

- On a daily basis, each user has x times of opportunity to - participate in a Roulette game on the campaign page. Users - have the probability to win trademarks and Lynks. The - minimum reward will be 1 Nova Points. + {type === "protocol" + ? "Congratulations! You now have the chance to spin the roulette and win rewards!" + : "On a daily basis, each user has x times of opportunity to participate in a Roulette game on the campaign page. Users have the probability to win trademarks and Lynks. The minimum reward will be 1 Nova Points."}

void; + onDrawed: () => void; }) => { - const { data, handleLink } = props; + const { data, handleLink, onDrawed } = props; const [isOpen, setIsOpen] = useState(false); + const modal = useDisclosure(); const allocatedTooltips = useMemo(() => { const protocolPoints = [ @@ -293,157 +300,206 @@ const EcoDApp = (props: { }; }, [data]); - return ( -
-
-
- -
-
{ - handleLink(data.link); - }} - > - {data.name} - -
-
{data.handler}
-
-
-
setIsOpen(!isOpen)} - > -
-
- - {data.rewards} - -
-
+ const handleSpinModal = (e: React.MouseEvent) => { + if (!data.remainSpinNum) { + return; + } + e.stopPropagation(); + modal.onOpen(); + }; -
- {data?.rewardsIcon?.map((item, index) => ( - + return ( + <> +
+
+
+ +
+
{ + handleLink(data.link); + }} + > + {data.name} - - ))} +
+
{data.handler}
+
-
+
setIsOpen(!isOpen)} + > +
+
+ + {data.rewards} + +
+
-
- -
- Your Allocated Points -
- {allocatedTooltips.yourPoints.map((item, index) => ( -
- {item.label} - {item.value} -
- ))} +
+ {data?.rewardsIcon?.map((item, index) => ( + + + + ))} +
+
-
- Protocol Allocated Points -
+
+ +
+ Your Allocated Points +
+ {allocatedTooltips.yourPoints.map((item, index) => ( +
+ {item.label} + {item.value} +
+ ))} - {allocatedTooltips.protocolPoints.map((item, index) => ( -
- {item.label} - {item.value} +
+ Protocol Allocated Points
- ))} -
- } - > -
- {formatNumberWithUnit( - data.holdingPoints.ecoPoints + - data.holdingPoints.referralPoints - )} - / - + + {allocatedTooltips.protocolPoints.map((item, index) => ( +
+ {item.label} + {item.value} +
+ ))} +
+ } + > +
{formatNumberWithUnit( - (data.totalPoints?.ecoPoints || 0) + - (data.totalPoints?.referralPoints || 0) + data.holdingPoints.ecoPoints + + data.holdingPoints.referralPoints )} - -
-
-
-
+ / + + {formatNumberWithUnit( + (data.totalPoints?.ecoPoints || 0) + + (data.totalPoints?.referralPoints || 0) + )} + +
+ +
+
-
- {/* Action: */} -
- How to earn - +
+ {data.projectName !== "orbiter" && + data.projectName !== "symbiosis" && + data.projectName !== "meson" ? ( + data.remainSpinNum === 0 ? ( + Spined + ) : ( +
+ + Spin +
+ ) + ) : ( + "" + )} +
+ +
+ {/* Action: */} +
+ How to earn + +
-
- {/*
*/} - {isOpen && ( - - {data.details.map((detail, index) => ( -
-
-
Booster
-
{detail.booster}
-
-
-
Description
-
- {detail.description} + {/*
*/} + {isOpen && ( + + {data.details.map((detail, index) => ( +
+
+
Booster
+
{detail.booster}
+
+
+
Description
+
+ {detail.description} - {detail?.descriptionTooltip && ( - - - - )} + {detail?.descriptionTooltip && ( + + + + )} +
-
-
+
Action
{detail.actionLinks ? ( @@ -494,11 +550,19 @@ const EcoDApp = (props: {
)}
-
- ))} - - )} -
+ ))} +
+ )} +
+ + ); }; @@ -561,6 +625,25 @@ export default function EcoDApps({ referralPoints: data?.refPoints || 0, }; }; + + const [spinList, setSpinList] = useState([]); + + const getSpin = async () => { + const { result } = await getProtocolSpin(); + console.log("getProtocolSpin", result); + if (result) { + setSpinList(result); + } + }; + + const getSpinByProject = (project: string) => { + const data = spinList.find((item) => item.projectName === project); + return { + project, + remainSpinNum: data?.remainSpinNum, + }; + }; + const ecoDAppsList = useMemo(() => { // const novaswap = geNovaCategoryUserPointsByProject("novaswap"); const izumi = geNovaCategoryUserPointsByProject("izumi"); @@ -593,6 +676,8 @@ export default function EcoDApps({ ], holdingPoints: getHoldingPointsByProject("nowaswap"), totalPoints: getTotalPointsByProject("novaswap"), + remainSpinNum: getSpinByProject("novaswap").remainSpinNum, + projectName: "novaswap", details: [ { booster: ( @@ -621,6 +706,8 @@ export default function EcoDApps({ ], holdingPoints: getHoldingPointsByProject("nowaswap"), totalPoints: getTotalPointsByProject("novaswap"), + remainSpinNum: getSpinByProject("novaswap").remainSpinNum, + projectName: "novaswap", details: [ { booster: ( @@ -657,9 +744,10 @@ export default function EcoDApps({ iconURL: "/img/icon-rewards-layerbank.svg", }, ], - holdingPoints: getHoldingPointsByProject("layerbank"), totalPoints: getTotalPointsByProject("layerbank"), + remainSpinNum: getSpinByProject("layerbank").remainSpinNum, + projectName: "layerbank", details: [ { booster: ( @@ -690,6 +778,8 @@ export default function EcoDApps({ ], holdingPoints: getHoldingPointsByProject("logx"), totalPoints: getTotalPointsByProject("logx"), + remainSpinNum: getSpinByProject("logx").remainSpinNum, + projectName: "logx", details: [ { booster: ( @@ -726,6 +816,8 @@ export default function EcoDApps({ rewards: "Up to 10x", holdingPoints: getHoldingPointsByProject("shoebill"), totalPoints: getTotalPointsByProject("shoebill"), + remainSpinNum: getSpinByProject("shoebill").remainSpinNum, + projectName: "shoebill", details: [ { booster: ( @@ -752,6 +844,8 @@ export default function EcoDApps({ rewards: "Up to 10x", holdingPoints: getHoldingPointsByProject("aqua"), totalPoints: getTotalPointsByProject("aqua"), + remainSpinNum: getSpinByProject("aqua").remainSpinNum, + projectName: "aqua", details: [ { booster: ( @@ -781,6 +875,8 @@ export default function EcoDApps({ rewards: "Up to 10x", holdingPoints: getHoldingPointsByProject("izumi"), totalPoints: getTotalPointsByProject("izumi"), + remainSpinNum: getSpinByProject("izumi").remainSpinNum, + projectName: "izumi", details: [ { booster: ( @@ -813,6 +909,8 @@ export default function EcoDApps({ rewards: "Up to 10x / Trading", holdingPoints: getHoldingPointsByProject("wagmi"), totalPoints: getTotalPointsByProject("wagmi"), + remainSpinNum: getSpinByProject("wagmi").remainSpinNum, + projectName: "wagmi", details: [ { booster: ( @@ -837,8 +935,8 @@ export default function EcoDApps({ }, { - category: zkdx?.category, - iconURL: "/img/icon-zkdx.svg" || "perpdex", + category: zkdx?.category || "perpdex", + iconURL: "/img/icon-zkdx.svg", name: "zkDX", link: "https://app.zkdx.io/stakingliquidity", handler: "@zkDXio", @@ -849,6 +947,8 @@ export default function EcoDApps({ rewards: "Up to 10x / Trading", holdingPoints: getHoldingPointsByProject("zkdx"), totalPoints: getTotalPointsByProject("zkdx"), + remainSpinNum: getSpinByProject("zkdx").remainSpinNum, + projectName: "zkdx", details: [ { booster: ( @@ -889,6 +989,8 @@ export default function EcoDApps({ rewards: "Interaction", holdingPoints: getHoldingPointsByProject("allspark"), totalPoints: getTotalPointsByProject("allspark"), + remainSpinNum: getSpinByProject("allspark").remainSpinNum, + projectName: "allspark", details: [ { booster: ( @@ -915,6 +1017,8 @@ export default function EcoDApps({ rewards: "Bridge", holdingPoints: getHoldingPointsByProject("rubic"), totalPoints: getTotalPointsByProject("rubic"), + remainSpinNum: getSpinByProject("rubic").remainSpinNum, + projectName: "rubic", details: [ { booster: ( @@ -941,6 +1045,8 @@ export default function EcoDApps({ rewards: "Up to 10x", holdingPoints: getHoldingPointsByProject("interport"), totalPoints: getTotalPointsByProject("interport"), + remainSpinNum: getSpinByProject("interport").remainSpinNum, + projectName: "interport", details: [ { booster: ( @@ -967,6 +1073,8 @@ export default function EcoDApps({ rewards: "Bridge", holdingPoints: getHoldingPointsByProject("orbiter"), totalPoints: getTotalPointsByProject("orbiter"), + remainSpinNum: getSpinByProject("orbiter").remainSpinNum, + projectName: "orbiter", details: [ { booster: `${orbiterBridgeNovaPoints} Nova Points`, @@ -991,6 +1099,8 @@ export default function EcoDApps({ rewards: "Bridge", holdingPoints: getHoldingPointsByProject("symbiosis"), totalPoints: getTotalPointsByProject("symbiosis"), + remainSpinNum: getSpinByProject("symbiosis").remainSpinNum, + projectName: "symbiosis", details: [ { booster: `${symbiosisBridgeNovaPoints} Nova Points`, @@ -1014,6 +1124,8 @@ export default function EcoDApps({ rewards: "Bridge", holdingPoints: getHoldingPointsByProject("meson"), totalPoints: getTotalPointsByProject("meson"), + remainSpinNum: getSpinByProject("meson").remainSpinNum, + projectName: "meson", details: [ { booster: `${mesonBridgeNovaPoints} Nova Points`, @@ -1036,6 +1148,8 @@ export default function EcoDApps({ rewards: "Trading", holdingPoints: getHoldingPointsByProject("eddy"), totalPoints: getTotalPointsByProject("eddy"), + remainSpinNum: getSpinByProject("eddy").remainSpinNum, + projectName: "eddy", details: [ { booster: ( @@ -1061,6 +1175,8 @@ export default function EcoDApps({ rewards: "20x Boost", holdingPoints: getHoldingPointsByProject("steer"), totalPoints: getTotalPointsByProject("steer"), + remainSpinNum: getSpinByProject("steer").remainSpinNum, + projectName: "steer", details: [ { booster: ( @@ -1089,6 +1205,8 @@ export default function EcoDApps({ rewards: "Interaction", holdingPoints: getHoldingPointsByProject("skyrangers"), totalPoints: getTotalPointsByProject("skyrangers"), + remainSpinNum: getSpinByProject("skyrangers").remainSpinNum, + projectName: "skyrangers", details: [ { booster: ( @@ -1129,6 +1247,10 @@ export default function EcoDApps({ warningModal.onOpen(); }; + useEffect(() => { + getSpin(); + }, []); + return ( Points Booster
Rewards
Allocated Points
+
+
+ Roulette + + + +
+
{ecoDAppsList.map((item, index) => ( - + ))}
diff --git a/src/pages/DashboardS2/index2.tsx b/src/pages/DashboardS2/index2.tsx index 1f3925cc..03e8c9b9 100644 --- a/src/pages/DashboardS2/index2.tsx +++ b/src/pages/DashboardS2/index2.tsx @@ -599,7 +599,7 @@ export default function Dashboard() { return ( -
+
{/* */} diff --git a/vite.config.ts b/vite.config.ts index 80419bc0..9bc30499 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -47,8 +47,8 @@ export default defineConfig({ port: 3001, proxy: { "/app-api": { - // target: "https://goerli.app.zklink.io", - target: "https://app-api.zklink.io", + target: "https://goerli.app.zklink.io", + // target: "https://app-api.zklink.io", changeOrigin: true, rewrite: (path) => path.replace(/^\/app-api/, ""), },