From 3024795c36a314cf0651c4a404b012b7abe8ddb1 Mon Sep 17 00:00:00 2001 From: Harsh Date: Mon, 17 Jul 2023 10:58:44 +0530 Subject: [PATCH 01/11] feature:(ui-ux): added dashboard stats --- src/api/LatestDataApi.ts | 29 +++++- src/api/types.ts | 37 +++++++ src/components/GroupStatisticCard.tsx | 118 ++++++++++++++++++----- src/components/TokenStatsDisplay.tsx | 106 +++++--------------- src/components/TransactionsLineChart.tsx | 104 ++++++++++++++++++++ src/components/commons/StatisticCard.tsx | 61 ++++++++---- src/pages/index.tsx | 9 +- 7 files changed, 336 insertions(+), 128 deletions(-) create mode 100644 src/components/TransactionsLineChart.tsx diff --git a/src/api/LatestDataApi.ts b/src/api/LatestDataApi.ts index 9e7e76d2..c9deafef 100644 --- a/src/api/LatestDataApi.ts +++ b/src/api/LatestDataApi.ts @@ -14,7 +14,13 @@ import { MAIN_LATEST_TRANSACTION_URL, wrapResponse, } from "./index"; -import { BlockProps, RawTransactionI } from "./types"; +import { + BlockProps, + ChartDataProps, + DashboardStatsProps, + RawTransactionI, + SmartContractStatsProps, +} from "./types"; const MAX_ROW = 5; @@ -78,4 +84,25 @@ export default { }; }); }, + getDashboardStats: async ( + network: NetworkConnection + ): Promise => { + const baseUrl = getBaseUrl(network); + const res = await fetch(`${baseUrl}/api/v2/stats`); + return wrapResponse(res); + }, + getSmartContractStats: async ( + network: NetworkConnection + ): Promise => { + const baseUrl = getBaseUrl(network); + const res = await fetch(`${baseUrl}/api/v2/smart-contracts/counters`); + return wrapResponse(res); + }, + getTxnChartsData: async ( + network: NetworkConnection + ): Promise => { + const baseUrl = getBaseUrl(network); + const res = await fetch(`${baseUrl}/api/v2/stats/charts/transactions`); + return wrapResponse(res); + }, }; diff --git a/src/api/types.ts b/src/api/types.ts index 88d3da45..e63ca87b 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -239,3 +239,40 @@ export interface RawTransactionV1 { result: RawTransactionI | null; status: string; } + +export interface DashboardStatsProps { + average_block_time: number; + coin_price: string; + gas_prices: { + average: number; + fast: number; + slow: number; + }; + average: number; + fast: number; + slow: number; + gas_used_today: string; + market_cap: string; + network_utilization_percentage: number; + static_gas_price: string | null; + total_addresses: string; + total_blocks: string; + total_gas_used: string; + total_transactions: string; + transactions_today: string; +} + +export interface SmartContractStatsProps { + new_smart_contracts_24h: string; + new_verified_smart_contracts_24h: string; + smart_contracts: string; + verified_smart_contracts: string; +} +export interface ChartDataI { + date: string; + tx_count: number; +} + +export interface ChartDataProps { + chart_data: ChartDataI[]; +} diff --git a/src/components/GroupStatisticCard.tsx b/src/components/GroupStatisticCard.tsx index 3104ccd1..f9b48f27 100644 --- a/src/components/GroupStatisticCard.tsx +++ b/src/components/GroupStatisticCard.tsx @@ -1,34 +1,108 @@ -import React from "react"; +import { useState, useEffect } from "react"; import StatisticCard from "@components/commons/StatisticCard"; +import clsx from "clsx"; +import LatestDataApi from "@api/LatestDataApi"; +import { useNetwork } from "@contexts/NetworkContext"; +import BigNumber from "bignumber.js"; +import { DashboardStatsProps, SmartContractStatsProps } from "@api/types"; + +export default function GroupStatisticCard() { + const { connection } = useNetwork(); + const [isLoading, setIsLoading] = useState(false); + const [dashboardStats, setDashboardStats] = useState(); + const [smartContractStats, setSmartContractStats] = + useState(); + + const fetchStats = async () => { + setIsLoading(true); + const dashStats = await LatestDataApi.getDashboardStats(connection); + setDashboardStats(dashStats); + const scStats = await LatestDataApi.getSmartContractStats(connection); + setSmartContractStats(scStats); + setIsLoading(false); + }; + + useEffect(() => { + fetchStats(); + }, []); -function GroupStatisticCard() { const groupStatsCardContent = [ { - title: "24h total value locked", - body: "3232400000", - footer: "+2.34%", - testId: "24h-total-value-locked", + title: "Blocks", + value: new BigNumber(dashboardStats?.total_blocks ?? 0), + // convert milliseconds to seconds + footer: `Avg. speed: ${new BigNumber( + dashboardStats?.average_block_time ?? 0 + ) + .dividedBy(1000) + .toFixed(1)} sec`, + testId: "blocks", + }, + { + title: "Transactions", + value: new BigNumber(dashboardStats?.total_transactions ?? 0), + footer: `Today: ${new BigNumber( + dashboardStats?.transactions_today ?? 0 + )} transactions`, + testId: "transactions", }, { - title: "24h transactions", - body: "32324000000", - footer: "-0.02%", - testId: "24h-total-transactions", + title: "Contracts", + value: new BigNumber(smartContractStats?.smart_contracts ?? 0), + footer: `${new BigNumber( + smartContractStats?.verified_smart_contracts ?? 0 + ) + .multipliedBy(smartContractStats?.smart_contracts ?? 0) + .dividedBy(1000) + .toFixed(2)}% verified`, + testId: "contracts", + }, + { + title: "Tokens", + value: new BigNumber(smartContractStats?.smart_contracts ?? 0), + footer: "", + testId: "tokens", }, ]; + return ( -
- {groupStatsCardContent.map((card) => ( - - ))} +
+
+
+ + Gas Tracker: + + + {dashboardStats?.gas_prices.average} + +
+
+ + Daily transactions: + + + {dashboardStats?.transactions_today} + +
+
+
+ {groupStatsCardContent.map((card) => ( + + ))} +
); } - -export default GroupStatisticCard; diff --git a/src/components/TokenStatsDisplay.tsx b/src/components/TokenStatsDisplay.tsx index 6fc6daa1..1f617e74 100644 --- a/src/components/TokenStatsDisplay.tsx +++ b/src/components/TokenStatsDisplay.tsx @@ -1,9 +1,8 @@ -import clsx from "clsx"; -import TokenStatsApi from "@api/TokenStatsApi"; -import { useUnitSuffix } from "hooks/useUnitSuffix"; -import { DMX_TOKEN_SYMBOL } from "shared/constants"; -import TrendLineChart, { LineData } from "./TrendLineChart"; -import GradientCardContainer from "./commons/GradientCardContainer"; +import { useState, useEffect } from "react"; +import LatestDataApi from "@api/LatestDataApi"; +import { useNetwork } from "@contexts/NetworkContext"; +import { ChartDataI } from "@api/types"; +import TransactionsLineChart from "./TransactionsLineChart"; export interface TokenStats { tokenPrice: number; @@ -14,87 +13,32 @@ export interface TokenStats { } export default function TokenStatsDisplay(): JSX.Element { - const stats: TokenStats = TokenStatsApi.useTokenStats(); - const priceHistory = TokenStatsApi.useTokenPriceHistory(); + const { connection } = useNetwork(); + const [chartData, setChartData] = useState([]); - const trendLineData: LineData[] = priceHistory.map((data) => ({ - value: data.price, - })); + const fetchStats = async () => { + const data = await LatestDataApi.getTxnChartsData(connection); + setChartData(data.chart_data); + }; - return ( -
- -
-
- -
-
- -
-
- -
-
-
-
- ); -} + useEffect(() => { + fetchStats(); + }, []); -function TokenPriceSection({ data }: { data: TokenStats }) { return ( - <> -
-
-
-
- DefiMetaChain Token -
-
- {DMX_TOKEN_SYMBOL} -
-
-
-
- ${data.tokenPrice} -
-
- {data.percentChange >= 0 ? "+" : ""} - {data.percentChange}% -
+
+
+
+ + {" "} + Transaction history + + in 30 days
+
+ +
- - ); -} - -function DetailsSection({ data }: { data: TokenStats }) { - const circulation = useUnitSuffix(data.circulation); - const last24hVolume = useUnitSuffix(data.last24hVolume); - const marketCap = useUnitSuffix(data.marketCap); - return ( -
- - - -
- ); -} - -function DetailRow({ label, value }: { label: string; value: string }) { - const labelStyle = "text-white-700 md:pr-2"; - const valueStyle = "text-right text-white-50"; - return ( -
-
{label}
-
{value}
); } diff --git a/src/components/TransactionsLineChart.tsx b/src/components/TransactionsLineChart.tsx new file mode 100644 index 00000000..30cb76f3 --- /dev/null +++ b/src/components/TransactionsLineChart.tsx @@ -0,0 +1,104 @@ +import { ChartDataI } from "@api/types"; +import { + LineChart, + Line, + ResponsiveContainer, + XAxis, + YAxis, + Tooltip, + CartesianGrid, +} from "recharts"; +import dayjs from "dayjs"; +import NumericFormat from "./commons/NumericFormat"; + +function CustomizedTickX(props) { + const { x, y, payload } = props; + return ( + + + + {dayjs(payload.value).format("MMM d")} + + + + ); +} + +function CustomizedTickY(props) { + const { x, y, payload } = props; + const formatter = Intl.NumberFormat("en", { notation: "compact" }); + return ( + + + + {formatter.format(payload.value)} + + + + ); +} + +function CustomTooltip({ active, payload, label }) { + if (active && payload && payload.length) { + return ( +
+
+ {dayjs(label).format("MMM d, YYYY")} +
+ {payload.map((pld) => ( +
+ Transactions: + +
+ ))} +
+ ); + } + return null; +} + +export default function TransactionsLineChart({ + data, +}: { + data: ChartDataI[]; +}) { + return ( + + + } + /> + } + /> + + + + + + ); +} diff --git a/src/components/commons/StatisticCard.tsx b/src/components/commons/StatisticCard.tsx index 18ff82c7..1547c3e5 100644 --- a/src/components/commons/StatisticCard.tsx +++ b/src/components/commons/StatisticCard.tsx @@ -1,38 +1,61 @@ import React from "react"; -import clsx from "clsx"; -import { useUnitSuffix } from "hooks/useUnitSuffix"; +import { IconType } from "react-icons"; +import BigNumber from "bignumber.js"; import GradientCardContainer from "./GradientCardContainer"; +import NumericFormat from "./NumericFormat"; interface StatsCardProps { title: string; - body: string; footer: string; + value: BigNumber; + icon?: IconType; + iconClass?: string; testId: string; + isLoading: boolean; } -function StatisticCard({ title, body, footer, testId }: StatsCardProps) { - const valueToUnitSuffix = useUnitSuffix(body); - +export default function StatisticCard({ + title, + value, + footer, + testId, + icon: Icon, + iconClass, + isLoading, +}: StatsCardProps) { return ( - -
-
+ +
+
{title}
-
- {valueToUnitSuffix} +
+ {isLoading ? ( +
+
+
+ ) : ( + + )}
-
+ {isLoading ? ( +
+
+
+ ) : ( + <> + {footer} + {Icon && } + )} - > - {footer}
); } - -export default StatisticCard; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 2971bba1..b6410e6a 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,11 +1,11 @@ -// import GroupStatisticCard from "@components/GroupStatisticCard"; -// import TokenStatsDisplay from "@components/TokenStatsDisplay"; import HomeTitle from "@components/HomeTitle"; import { SearchBar } from "layouts/components/searchbar/SearchBar"; import { GetServerSidePropsResult, InferGetServerSidePropsType } from "next"; import { RowData } from "@components/types"; import LatestDataTable from "@components/LatestDataTable"; import LatestDataApi from "@api/LatestDataApi"; +import GroupStatisticCard from "@components/GroupStatisticCard"; +import TokenStatsDisplay from "@components/TokenStatsDisplay"; export default function Home({ latestTransactions, @@ -17,9 +17,8 @@ export default function Home({
- {/* */} - {/* */} - {/* TODO: Add blocks and txs summary card */} + + Date: Mon, 17 Jul 2023 11:26:25 +0530 Subject: [PATCH 02/11] added fullBorder in GradientCardContainer --- src/components/commons/GradientCardContainer.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/commons/GradientCardContainer.tsx b/src/components/commons/GradientCardContainer.tsx index b40ec8a6..5c25536d 100644 --- a/src/components/commons/GradientCardContainer.tsx +++ b/src/components/commons/GradientCardContainer.tsx @@ -4,9 +4,14 @@ import React from "react"; interface GradientCardProps { children?: JSX.Element; className?: string; + fullBorder?: boolean; } -function GradientCardContainer({ children, className }: GradientCardProps) { +function GradientCardContainer({ + children, + className, + fullBorder, +}: GradientCardProps) { return (
-
+
{children}
From 4c38b8af933a8ee448689e8c9360fd5a481a0f8f Mon Sep 17 00:00:00 2001 From: Harsh Date: Mon, 17 Jul 2023 17:27:22 +0530 Subject: [PATCH 03/11] minor fixes and ui pudate --- src/components/GroupStatisticCard.tsx | 126 ++++++++++++++--------- src/components/commons/StatisticCard.tsx | 26 ++--- 2 files changed, 88 insertions(+), 64 deletions(-) diff --git a/src/components/GroupStatisticCard.tsx b/src/components/GroupStatisticCard.tsx index f9b48f27..38d2fd9d 100644 --- a/src/components/GroupStatisticCard.tsx +++ b/src/components/GroupStatisticCard.tsx @@ -1,10 +1,12 @@ import { useState, useEffect } from "react"; import StatisticCard from "@components/commons/StatisticCard"; import clsx from "clsx"; +import { MdCheckCircle } from "react-icons/md"; import LatestDataApi from "@api/LatestDataApi"; import { useNetwork } from "@contexts/NetworkContext"; import BigNumber from "bignumber.js"; import { DashboardStatsProps, SmartContractStatsProps } from "@api/types"; +import NumericFormat from "./commons/NumericFormat"; export default function GroupStatisticCard() { const { connection } = useNetwork(); @@ -12,7 +14,7 @@ export default function GroupStatisticCard() { const [dashboardStats, setDashboardStats] = useState(); const [smartContractStats, setSmartContractStats] = useState(); - + const unit = "fi"; const fetchStats = async () => { setIsLoading(true); const dashStats = await LatestDataApi.getDashboardStats(connection); @@ -26,45 +28,6 @@ export default function GroupStatisticCard() { fetchStats(); }, []); - const groupStatsCardContent = [ - { - title: "Blocks", - value: new BigNumber(dashboardStats?.total_blocks ?? 0), - // convert milliseconds to seconds - footer: `Avg. speed: ${new BigNumber( - dashboardStats?.average_block_time ?? 0 - ) - .dividedBy(1000) - .toFixed(1)} sec`, - testId: "blocks", - }, - { - title: "Transactions", - value: new BigNumber(dashboardStats?.total_transactions ?? 0), - footer: `Today: ${new BigNumber( - dashboardStats?.transactions_today ?? 0 - )} transactions`, - testId: "transactions", - }, - { - title: "Contracts", - value: new BigNumber(smartContractStats?.smart_contracts ?? 0), - footer: `${new BigNumber( - smartContractStats?.verified_smart_contracts ?? 0 - ) - .multipliedBy(smartContractStats?.smart_contracts ?? 0) - .dividedBy(1000) - .toFixed(2)}% verified`, - testId: "contracts", - }, - { - title: "Tokens", - value: new BigNumber(smartContractStats?.smart_contracts ?? 0), - footer: "", - testId: "tokens", - }, - ]; - return (
@@ -92,16 +55,81 @@ export default function GroupStatisticCard() { "grid lg:grid-cols-4 gap-6" )} > - {groupStatsCardContent.map((card) => ( - + + {`Avg. speed: ${new BigNumber( + dashboardStats?.average_block_time ?? 0 + ) + .dividedBy(1000) + .toFixed(1)} sec`} + + + + + + + + + + + + + + + + + - ))} +
); diff --git a/src/components/commons/StatisticCard.tsx b/src/components/commons/StatisticCard.tsx index 1547c3e5..75a1817a 100644 --- a/src/components/commons/StatisticCard.tsx +++ b/src/components/commons/StatisticCard.tsx @@ -1,28 +1,24 @@ -import React from "react"; -import { IconType } from "react-icons"; +import React, { PropsWithChildren } from "react"; import BigNumber from "bignumber.js"; import GradientCardContainer from "./GradientCardContainer"; import NumericFormat from "./NumericFormat"; interface StatsCardProps { title: string; - footer: string; value: BigNumber; - icon?: IconType; - iconClass?: string; testId: string; isLoading: boolean; + suffix?: string; } export default function StatisticCard({ title, value, - footer, + children, + suffix, testId, - icon: Icon, - iconClass, isLoading, -}: StatsCardProps) { +}: PropsWithChildren) { return (
@@ -39,20 +35,20 @@ export default function StatisticCard({ value={value} thousandSeparator decimalScale={0} + suffix={suffix} className="text-white-50 text-2xl font-semibold" /> )}
-
+
{isLoading ? ( -
+
) : ( - <> - {footer} - {Icon && } - +
+ {children} +
)}
From 498954fe22db16a14202ca4789b0996badce0a5f Mon Sep 17 00:00:00 2001 From: Harsh R <53080940+fullstackninja864@users.noreply.github.com> Date: Tue, 18 Jul 2023 08:42:51 +0530 Subject: [PATCH 04/11] Update src/components/GroupStatisticCard.tsx Co-authored-by: Lyka Labrada --- src/components/GroupStatisticCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/GroupStatisticCard.tsx b/src/components/GroupStatisticCard.tsx index 38d2fd9d..326680bf 100644 --- a/src/components/GroupStatisticCard.tsx +++ b/src/components/GroupStatisticCard.tsx @@ -87,7 +87,7 @@ export default function GroupStatisticCard() { From d711dabdbb6a155984a0939bc4208810d32f9312 Mon Sep 17 00:00:00 2001 From: Harsh R <53080940+fullstackninja864@users.noreply.github.com> Date: Tue, 18 Jul 2023 08:43:14 +0530 Subject: [PATCH 05/11] Update src/components/GroupStatisticCard.tsx Co-authored-by: Lyka Labrada --- src/components/GroupStatisticCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/GroupStatisticCard.tsx b/src/components/GroupStatisticCard.tsx index 326680bf..399347a2 100644 --- a/src/components/GroupStatisticCard.tsx +++ b/src/components/GroupStatisticCard.tsx @@ -97,7 +97,7 @@ export default function GroupStatisticCard() { smartContractStats?.verified_smart_contracts ?? 0 ) .multipliedBy(smartContractStats?.smart_contracts ?? 0) - .dividedBy(1000) + .dividedBy(100) .toFixed(2)} thousandSeparator suffix="% verified" From 7ffb33faf80f8569f8e7716ecb286352e1ea4adc Mon Sep 17 00:00:00 2001 From: Harsh Date: Tue, 18 Jul 2023 08:50:53 +0530 Subject: [PATCH 06/11] lint issue fixed --- src/components/GroupStatisticCard.tsx | 4 +++- tailwind.config.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/GroupStatisticCard.tsx b/src/components/GroupStatisticCard.tsx index 399347a2..88a5fcff 100644 --- a/src/components/GroupStatisticCard.tsx +++ b/src/components/GroupStatisticCard.tsx @@ -87,7 +87,9 @@ export default function GroupStatisticCard() { diff --git a/tailwind.config.js b/tailwind.config.js index a987e5b7..03b280f3 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -159,5 +159,5 @@ module.exports = { xxs: ["10px", "12px"], }, }, - } + }, }; From 954cf9afd53917e8b2be0312f063caadb3299354 Mon Sep 17 00:00:00 2001 From: Harsh R <53080940+fullstackninja864@users.noreply.github.com> Date: Wed, 19 Jul 2023 14:35:11 +0530 Subject: [PATCH 07/11] Update src/components/GroupStatisticCard.tsx --- src/components/GroupStatisticCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/GroupStatisticCard.tsx b/src/components/GroupStatisticCard.tsx index 88a5fcff..b2471b40 100644 --- a/src/components/GroupStatisticCard.tsx +++ b/src/components/GroupStatisticCard.tsx @@ -14,7 +14,7 @@ export default function GroupStatisticCard() { const [dashboardStats, setDashboardStats] = useState(); const [smartContractStats, setSmartContractStats] = useState(); - const unit = "fi"; + const unit = "gwei"; const fetchStats = async () => { setIsLoading(true); const dashStats = await LatestDataApi.getDashboardStats(connection); From ed445962aeb726f5433a2f29d1b9422e5964c952 Mon Sep 17 00:00:00 2001 From: Harsh Date: Thu, 20 Jul 2023 08:56:14 +0530 Subject: [PATCH 08/11] used global constant for unit constant --- src/components/GroupStatisticCard.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/GroupStatisticCard.tsx b/src/components/GroupStatisticCard.tsx index b2471b40..1432dbfa 100644 --- a/src/components/GroupStatisticCard.tsx +++ b/src/components/GroupStatisticCard.tsx @@ -6,6 +6,7 @@ import LatestDataApi from "@api/LatestDataApi"; import { useNetwork } from "@contexts/NetworkContext"; import BigNumber from "bignumber.js"; import { DashboardStatsProps, SmartContractStatsProps } from "@api/types"; +import { GWEI_SYMBOL } from "shared/constants"; import NumericFormat from "./commons/NumericFormat"; export default function GroupStatisticCard() { @@ -14,7 +15,6 @@ export default function GroupStatisticCard() { const [dashboardStats, setDashboardStats] = useState(); const [smartContractStats, setSmartContractStats] = useState(); - const unit = "gwei"; const fetchStats = async () => { setIsLoading(true); const dashStats = await LatestDataApi.getDashboardStats(connection); @@ -113,21 +113,21 @@ export default function GroupStatisticCard() { title="Gas price" value={new BigNumber(dashboardStats?.gas_prices.average ?? 0)} testId="gas-price" - suffix={` ${unit}`} + suffix={` ${GWEI_SYMBOL}`} isLoading={isLoading} > From 42a4069f5966f95cc482cda7abed40c1ff750a43 Mon Sep 17 00:00:00 2001 From: Harsh Date: Thu, 20 Jul 2023 14:28:05 +0530 Subject: [PATCH 09/11] fixed dates issue --- src/components/TransactionsLineChart.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/TransactionsLineChart.tsx b/src/components/TransactionsLineChart.tsx index 30cb76f3..1499c288 100644 --- a/src/components/TransactionsLineChart.tsx +++ b/src/components/TransactionsLineChart.tsx @@ -20,7 +20,7 @@ function CustomizedTickX(props) { textAnchor="middle" className="text-dark-700 text-xs -tracking-[0.12px]" > - {dayjs(payload.value).format("MMM d")} + {dayjs(payload.value).format("MMM D")} @@ -49,7 +49,7 @@ function CustomTooltip({ active, payload, label }) { return (
- {dayjs(label).format("MMM d, YYYY")} + {dayjs(label).format("MMM D, YYYY")}
{payload.map((pld) => (
From 1f084a9662da1497215b473add92b411df66efef Mon Sep 17 00:00:00 2001 From: Harsh Date: Thu, 20 Jul 2023 14:36:33 +0530 Subject: [PATCH 10/11] reverse the txn data for proper chart formation --- src/components/TokenStatsDisplay.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TokenStatsDisplay.tsx b/src/components/TokenStatsDisplay.tsx index 1f617e74..6f40b888 100644 --- a/src/components/TokenStatsDisplay.tsx +++ b/src/components/TokenStatsDisplay.tsx @@ -18,7 +18,7 @@ export default function TokenStatsDisplay(): JSX.Element { const fetchStats = async () => { const data = await LatestDataApi.getTxnChartsData(connection); - setChartData(data.chart_data); + setChartData(data.chart_data?.reverse()); }; useEffect(() => { From a5ec49146583a07a0938927945415a4e366e9728 Mon Sep 17 00:00:00 2001 From: Harsh Date: Mon, 24 Jul 2023 10:44:36 +0530 Subject: [PATCH 11/11] removed txn count and gas price from graph footer --- src/components/GroupStatisticCard.tsx | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/components/GroupStatisticCard.tsx b/src/components/GroupStatisticCard.tsx index 1432dbfa..172b3b83 100644 --- a/src/components/GroupStatisticCard.tsx +++ b/src/components/GroupStatisticCard.tsx @@ -29,25 +29,7 @@ export default function GroupStatisticCard() { }, []); return ( -
-
-
- - Gas Tracker: - - - {dashboardStats?.gas_prices.average} - -
-
- - Daily transactions: - - - {dashboardStats?.transactions_today} - -
-
+