From 824a8fd151ec1bd49d987513b33f0c7ce46c58ac Mon Sep 17 00:00:00 2001 From: Thomas Starzynski Date: Sun, 11 Aug 2024 19:37:16 +0200 Subject: [PATCH 1/2] add link to radix-dashboard to pairInfo --- src/app/components/PriceChart.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/app/components/PriceChart.tsx b/src/app/components/PriceChart.tsx index e1614891..f4d95fe3 100644 --- a/src/app/components/PriceChart.tsx +++ b/src/app/components/PriceChart.tsx @@ -14,6 +14,8 @@ import * as tailwindConfig from "../../../tailwind.config"; import { shortenString } from "../utils"; import { CopyIcon } from "./CopyIcon"; import { TokenInfo } from "state/pairSelectorSlice"; +import Link from "next/link"; +import { FiExternalLink } from "react-icons/fi"; interface PriceChartProps { data: OHLCVData[]; @@ -381,11 +383,13 @@ export function Info() { label={t("pair_resource")} address={pairInfo.address} shortenLength={{ min: 8, max: 20 }} + radixDashboardUrl={`https://dashboard.radixdlt.com/component/${pairInfo.address}`} /> @@ -403,12 +407,14 @@ interface LabelAndAddressProps { label: string; address: string; shortenLength?: { min: number; max: number }; + radixDashboardUrl: string; } function LabelAndAddress({ label, address, shortenLength, + radixDashboardUrl, }: LabelAndAddressProps) { const minLength = shortenLength?.min || 8; const maxLength = shortenLength?.max || 20; @@ -424,6 +430,13 @@ function LabelAndAddress({ {shortenString(address, minLength, maxLength, "...")} + + + @@ -447,6 +460,7 @@ function CoinInfo({ token }: { token: TokenInfo }) { label={t("resource")} address={address} shortenLength={{ min: 8, max: 10 }} + radixDashboardUrl={`https://dashboard.radixdlt.com/resource/${address}`} /> From eb870bf29616c022862209914422f7086443fefe Mon Sep 17 00:00:00 2001 From: Thomas Starzynski Date: Sun, 11 Aug 2024 19:46:22 +0200 Subject: [PATCH 2/2] add fix for stokenet --- src/app/components/PriceChart.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app/components/PriceChart.tsx b/src/app/components/PriceChart.tsx index f4d95fe3..6c68de2a 100644 --- a/src/app/components/PriceChart.tsx +++ b/src/app/components/PriceChart.tsx @@ -383,13 +383,17 @@ export function Info() { label={t("pair_resource")} address={pairInfo.address} shortenLength={{ min: 8, max: 20 }} - radixDashboardUrl={`https://dashboard.radixdlt.com/component/${pairInfo.address}`} + radixDashboardUrl={`https://${ + process.env.NEXT_PUBLIC_NETWORK === "stokenet" ? "stokenet-" : "" + }dashboard.radixdlt.com/component/${pairInfo.address}`} /> @@ -460,7 +464,9 @@ function CoinInfo({ token }: { token: TokenInfo }) { label={t("resource")} address={address} shortenLength={{ min: 8, max: 10 }} - radixDashboardUrl={`https://dashboard.radixdlt.com/resource/${address}`} + radixDashboardUrl={`https://${ + process.env.NEXT_PUBLIC_NETWORK === "stokenet" ? "stokenet-" : "" + }dashboard.radixdlt.com/resource/${address}`} />