From 9c950fc5c417620888a3d59865b9a260c20845e8 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 29 Aug 2024 15:50:53 +0800 Subject: [PATCH 1/2] update epoch3 --- src/components/DashboardS2/Tabs/EcoDApps.tsx | 2 +- .../DashboardS2/Tabs/SectorHeader.tsx | 30 +++++++++---------- src/constants/epoch.ts | 1 + src/pages/DashboardS2/index2.tsx | 23 +++++++------- src/pages/Leaderboard/index.tsx | 2 +- vite.config.ts | 4 +-- 6 files changed, 33 insertions(+), 29 deletions(-) diff --git a/src/components/DashboardS2/Tabs/EcoDApps.tsx b/src/components/DashboardS2/Tabs/EcoDApps.tsx index 591d1fbb..72a00022 100644 --- a/src/components/DashboardS2/Tabs/EcoDApps.tsx +++ b/src/components/DashboardS2/Tabs/EcoDApps.tsx @@ -1206,7 +1206,7 @@ export default function EcoDApps({ ], }, { - category: "gamefi", + category: "other", iconURL: "/img/icon-skyrangers.png", name: "Sky Rangers", link: "https://statics.skyrangers.io/", diff --git a/src/components/DashboardS2/Tabs/SectorHeader.tsx b/src/components/DashboardS2/Tabs/SectorHeader.tsx index e14a4cdd..bd79a964 100644 --- a/src/components/DashboardS2/Tabs/SectorHeader.tsx +++ b/src/components/DashboardS2/Tabs/SectorHeader.tsx @@ -49,19 +49,19 @@ export default function SectorHeader({ holding: [ { tvl: 0, - zkl: 500000, + zkl: 100000, }, { tvl: 200000000, - zkl: 1000000, + zkl: 200000, }, { tvl: 500000000, - zkl: 2000000, + zkl: 500000, }, { tvl: 1000000000, - zkl: 3000000, + zkl: 1000000, }, ], spotdex: [ @@ -71,15 +71,15 @@ export default function SectorHeader({ }, { tvl: 5000000, - zkl: 500000, + zkl: 200000, }, { tvl: 25000000, - zkl: 1000000, + zkl: 500000, }, { tvl: 50000000, - zkl: 1500000, + zkl: 1000000, }, ], perpdex: [ @@ -89,15 +89,15 @@ export default function SectorHeader({ }, { tvl: 100000000, - zkl: 500000, + zkl: 200000, }, { tvl: 500000000, - zkl: 1000000, + zkl: 500000, }, { tvl: 2000000000, - zkl: 2000000, + zkl: 1000000, }, ], lending: [ @@ -107,15 +107,15 @@ export default function SectorHeader({ }, { tvl: 10000000, - zkl: 350000, + zkl: 200000, }, { tvl: 50000000, - zkl: 700000, + zkl: 500000, }, { tvl: 200000000, - zkl: 1500000, + zkl: 1000000, }, ], }; @@ -128,7 +128,7 @@ export default function SectorHeader({ } = { gamefi: { zkl: 10000, - max: 1000000, + max: 500000, }, other: { zkl: 50000, @@ -136,7 +136,7 @@ export default function SectorHeader({ }, nativeboost: { zkl: 50000, - max: 500000, + max: 5000000, }, }; diff --git a/src/constants/epoch.ts b/src/constants/epoch.ts index 46ca22e5..0d23e108 100644 --- a/src/constants/epoch.ts +++ b/src/constants/epoch.ts @@ -5,4 +5,5 @@ export const epochList = [ season: 2, }, { name: "Epoch Two", season: 3 }, + { name: "Epoch Three", season: 4 }, ]; diff --git a/src/pages/DashboardS2/index2.tsx b/src/pages/DashboardS2/index2.tsx index 5448d748..aa8b4d41 100644 --- a/src/pages/DashboardS2/index2.tsx +++ b/src/pages/DashboardS2/index2.tsx @@ -306,11 +306,11 @@ export default function Dashboard() { name: "Lending", category: "lending", }, - { - iconURL: "/img/icon-sector-6.svg", - name: "GameFi", - category: "gamefi", - }, + // { + // iconURL: "/img/icon-sector-6.svg", + // name: "GameFi", + // category: "gamefi", + // }, { iconURL: "/img/icon-sector-7.svg", name: "Others", @@ -478,10 +478,10 @@ export default function Dashboard() { name: "Lending Points", category: "lending", }, - { - name: "GameFi Points", - category: "gamefi", - }, + // { + // name: "GameFi Points", + // category: "gamefi", + // }, { name: "Others Points", category: "other", @@ -633,9 +633,12 @@ export default function Dashboard() {
Epoch One (From May 30th to July 15th)
-
+
Epoch Two (From July 16th to Aug 31st)
+
+ Epoch Three (From Step 1) +
diff --git a/src/pages/Leaderboard/index.tsx b/src/pages/Leaderboard/index.tsx index 1fddb035..c1d07005 100644 --- a/src/pages/Leaderboard/index.tsx +++ b/src/pages/Leaderboard/index.tsx @@ -484,7 +484,7 @@ export default function Leaderboard() { iconURL: "/img/icon-sector-4.svg", }, { name: "Lending", category: "lending", iconURL: "/img/icon-sector-5.svg" }, - { name: "GameFi", category: "gamefi" }, + // { name: "GameFi", category: "gamefi" }, { name: "Other", category: "other", iconURL: "/img/icon-sector-7.svg" }, ]; diff --git a/vite.config.ts b/vite.config.ts index 9bc30499..80419bc0 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/, ""), }, From adb6f6503ecacc6058c819b3b9c67b2db449ba9f Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 1 Sep 2024 00:36:58 +0800 Subject: [PATCH 2/2] update epoch3 --- src/api/index.ts | 11 ++- src/components/DashboardS2/Tabs/EcoDApps.tsx | 7 +- src/pages/DashboardS2/index2.tsx | 95 +++++++++++++------- src/pages/Leaderboard/index.tsx | 94 ++++++++++++++----- 4 files changed, 147 insertions(+), 60 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index e96ed85b..c6abca28 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -807,10 +807,13 @@ interface NovaProjectTotalPointsResponse { data: NovaProjectTotalPoints[]; } -export const getNovaProjectTotalPoints = - (): Promise => { - return http.get(`${BASE_URL_LRT_POINTS}/nova/project/points`); - }; +export const getNovaProjectTotalPoints = (params: { + season: number; +}): Promise => { + return http.get(`${BASE_URL_LRT_POINTS}/nova/project/points`, { + params, + }); +}; export interface CategoryZKLItem { name: string; diff --git a/src/components/DashboardS2/Tabs/EcoDApps.tsx b/src/components/DashboardS2/Tabs/EcoDApps.tsx index 72a00022..3a3cd0a0 100644 --- a/src/components/DashboardS2/Tabs/EcoDApps.tsx +++ b/src/components/DashboardS2/Tabs/EcoDApps.tsx @@ -585,12 +585,14 @@ export default function EcoDApps({ tvlCategoryMilestone, holdingPoints, novaCategoryTotalPoints, + season, }: { tabActive?: { category: string; name: string; iconURL: string; }; + season: number; novaCategoryUserPoints: NovaCategoryUserPoints[]; tvlCategoryMilestone: TvlCategoryMilestone[]; holdingPoints?: NovaPointsListItem; @@ -612,7 +614,8 @@ export default function EcoDApps({ >([]); const getProjectTotalPoints = async () => { - const { data } = await getNovaProjectTotalPoints(); + console.log("season", season); + const { data } = await getNovaProjectTotalPoints({ season }); if (data) { setProjectTotalPoints(data); } @@ -620,7 +623,7 @@ export default function EcoDApps({ useEffect(() => { getProjectTotalPoints(); - }, []); + }, [season]); const getTotalPointsByProject = useCallback( (project: string) => { diff --git a/src/pages/DashboardS2/index2.tsx b/src/pages/DashboardS2/index2.tsx index aa8b4d41..4c3cc83c 100644 --- a/src/pages/DashboardS2/index2.tsx +++ b/src/pages/DashboardS2/index2.tsx @@ -425,7 +425,7 @@ export default function Dashboard() { console.log("getTvlCategory", res); setTvlCategoryMilestone(res?.data || []); }; - const [epochActive, setEpochActive] = useState(1); + const [epochActive, setEpochActive] = useState(2); const season = useMemo(() => { if (tabs2Active === 99) { @@ -457,36 +457,68 @@ export default function Dashboard() { }; const novaPointsList = useMemo(() => { - const categorys = [ - { - name: "Assets Points", - category: "holding", - }, - { - name: "Native Boost Points", - category: "nativeboost", - }, - { - name: "Spot DEX Points", - category: "spotdex", - }, - { - name: "Perp DEX Points", - category: "perpdex", - }, - { - name: "Lending Points", - category: "lending", - }, - // { - // name: "GameFi Points", - // category: "gamefi", - // }, - { - name: "Others Points", - category: "other", - }, - ]; + const categorys = + epochActive === 2 + ? [ + { + name: "Assets Points", + category: "holding", + }, + { + name: "Native Boost Points", + category: "nativeboost", + }, + { + name: "Spot DEX Points", + category: "spotdex", + }, + { + name: "Perp DEX Points", + category: "perpdex", + }, + { + name: "Lending Points", + category: "lending", + }, + // { + // name: "GameFi Points", + // category: "gamefi", + // }, + { + name: "Others Points", + category: "other", + }, + ] + : [ + { + name: "Assets Points", + category: "holding", + }, + { + name: "Native Boost Points", + category: "nativeboost", + }, + { + name: "Spot DEX Points", + category: "spotdex", + }, + { + name: "Perp DEX Points", + category: "perpdex", + }, + { + name: "Lending Points", + category: "lending", + }, + { + name: "GameFi Points", + category: "gamefi", + }, + { + name: "Others Points", + category: "other", + }, + ]; const arr = categorys.map((c) => { const userCategoryData = novaCategoryUserPointsTotal.find( @@ -768,6 +800,7 @@ export default function Dashboard() { )} {tabs2Active !== 0 && tabs2Active !== 99 && ( store.airdrop); const [tabActive, setTabActive] = useState(0); - const [epochActive, setEpochActive] = useState(1); + const [epochActive, setEpochActive] = useState(2); const [selfData, setSelfData] = useState(null); const [categoryList, setCategoryList] = useState([]); + const tabs = useMemo(() => { + return epochActive === 2 + ? [ + { + name: "Holding", + category: "holding", + iconURL: "/img/icon-sector-1.svg", + }, + { + name: "Boosted", + category: "nativeboost", + iconURL: "/img/icon-sector-2.svg", + }, + { + name: "Spot DEX", + category: "spotdex", + iconURL: "/img/icon-sector-3.svg", + }, + { + name: "Perp DEX", + category: "perpdex", + iconURL: "/img/icon-sector-4.svg", + }, + { + name: "Lending", + category: "lending", + iconURL: "/img/icon-sector-5.svg", + }, + // { name: "GameFi", category: "gamefi" }, + { + name: "Other", + category: "other", + iconURL: "/img/icon-sector-7.svg", + }, + ] + : [ + { + name: "Holding", + category: "holding", + iconURL: "/img/icon-sector-1.svg", + }, + { + name: "Boosted", + category: "nativeboost", + iconURL: "/img/icon-sector-2.svg", + }, + { + name: "Spot DEX", + category: "spotdex", + iconURL: "/img/icon-sector-3.svg", + }, + { + name: "Perp DEX", + category: "perpdex", + iconURL: "/img/icon-sector-4.svg", + }, + { + name: "Lending", + category: "lending", + iconURL: "/img/icon-sector-5.svg", + }, + { name: "GameFi", category: "gamefi" }, + { + name: "Other", + category: "other", + iconURL: "/img/icon-sector-7.svg", + }, + ]; + }, [epochActive]); + const getCategoryListFunc = async (category: string) => { try { const { data } = await getCategoryList(category, {