From 97fc242e696548e37ea1f5cd05ac68bbbb9a2b66 Mon Sep 17 00:00:00 2001 From: Aliu Salaudeen Date: Tue, 9 Apr 2024 16:54:02 +0100 Subject: [PATCH 1/8] done updating cmc-token-details api --- src/app/dashboard/page.tsx | 15 ++++++++------- src/components/dashboard/IQButton.tsx | 5 +++-- src/pages/api/cmc-token-details.ts | 2 +- src/services/iqPrice/index.ts | 10 +++++----- src/utils/dashboard-utils.ts | 10 +++++----- 5 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 65e7b62c..681b32d7 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -68,7 +68,7 @@ const Home: NextPage = () => { startDate: stakeStartDate, endDate: stakeEndDate, }) - const stakeGraphData = stakeData?.map((dt) => ({ + const stakeGraphData = stakeData?.map(dt => ({ amt: parseFloat(dt.amount), name: new Date(dt.created).toISOString().slice(0, 10), })) @@ -106,7 +106,7 @@ const Home: NextPage = () => { startDate, endDate, }) - const treasuryGraphData = treasuryData?.map((dt) => ({ + const treasuryGraphData = treasuryData?.map(dt => ({ amt: parseFloat(dt.totalValue), name: new Date(dt.created).toISOString().slice(0, 10), })) @@ -162,7 +162,8 @@ const Home: NextPage = () => { }) }) - Promise.resolve(IQTokenData).then((data) => { + Promise.resolve(IQTokenData).then(data => { + console.log({ data }) setMarketData(data) }) } @@ -229,7 +230,7 @@ const Home: NextPage = () => { graphTitle="IQ Price" height={120} > - {GRAPH_PERIODS.map((btn) => { + {GRAPH_PERIODS.map(btn => { return ( { graphTitle="IQ Staked Over Time" height={200} > - {CUSTOM_GRAPH_PERIODS.map((btn) => { + {CUSTOM_GRAPH_PERIODS.map(btn => { return ( { /> - {holders.map((item) => ( + {holders.map(item => ( { height={200} isTreasuryPage > - {CUSTOM_GRAPH_PERIODS.map((btn) => { + {CUSTOM_GRAPH_PERIODS.map(btn => { return ( { const SIG_FIGS = 4 - const { data, isLoading, error } = useGetIqPriceQuery() - const iqPrice = data?.response + const { data, isLoading, error } = useGetIqPriceQuery('IQ') + console.log(data) + const iqPrice = 0.00123 return ( <>