From 044edab73f72b561bcbc8bd51348628ed5055b0e Mon Sep 17 00:00:00 2001 From: Eugene P Date: Mon, 13 May 2024 14:29:52 +0300 Subject: [PATCH] fix: add label to nova landing (#1476) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: add label to nova landing Signed-off-by: Eugene Panteleymonchuk * fix: add label to nova landing Signed-off-by: Eugene Panteleymonchuk --------- Signed-off-by: Eugene Panteleymonchuk Co-authored-by: Begoña Álvarez de la Cruz --- client/src/app/App.tsx | 2 +- client/src/app/AppUtils.tsx | 3 ++- client/src/app/routes/nova/landing/Landing.tsx | 4 ++-- client/src/helpers/nova/networkInfo.ts | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/src/app/App.tsx b/client/src/app/App.tsx index 66de60d32..8c938996e 100644 --- a/client/src/app/App.tsx +++ b/client/src/app/App.tsx @@ -63,7 +63,7 @@ const App: React.FC> = ({ scrollToTop(); if (networkConfig?.protocolVersion === NOVA) { - populateNetworkInfoNova(networkConfig.network); + populateNetworkInfoNova(networkConfig.network, networkConfig.label); } const body = document.querySelector("body"); diff --git a/client/src/app/AppUtils.tsx b/client/src/app/AppUtils.tsx index d79d91c36..71137b95a 100644 --- a/client/src/app/AppUtils.tsx +++ b/client/src/app/AppUtils.tsx @@ -177,7 +177,7 @@ export const getFaviconHelmet = (isShimmer: boolean) => { ); }; -export const populateNetworkInfoNova = (networkName: string) => { +export const populateNetworkInfoNova = (networkName: string, networkLabel: string) => { const nodeService = ServiceFactory.get("node-info-nova"); if (nodeService) { const nodeInfo: InfoResponse = nodeService.get(networkName); @@ -193,6 +193,7 @@ export const populateNetworkInfoNova = (networkName: string) => { setNetworkInfoNova({ name: networkName, + label: networkLabel, tokenInfo: nodeInfo?.baseToken ?? {}, manaInfo: MANA_INFO_DEFAULT, protocolVersion: protocolInfo?.parameters.version ?? -1, diff --git a/client/src/app/routes/nova/landing/Landing.tsx b/client/src/app/routes/nova/landing/Landing.tsx index 2d869d243..2a92065fd 100644 --- a/client/src/app/routes/nova/landing/Landing.tsx +++ b/client/src/app/routes/nova/landing/Landing.tsx @@ -12,7 +12,7 @@ import { formatAmount } from "~/helpers/stardust/valueFormatHelper"; import "./Landing.scss"; const Landing: React.FC = () => { - const { name: network, tokenInfo } = useNetworkInfoNova((s) => s.networkInfo); + const { name: network, tokenInfo, label: networkLabel } = useNetworkInfoNova((s) => s.networkInfo); const { chronicleAnalyticStats } = useChronicleAnalytics(); const { validatorStats } = useValidatorStats(); const { blocksPerSecond, confirmationRate } = useNetworkStats(network); @@ -65,7 +65,7 @@ const Landing: React.FC = () => { return (
- +
diff --git a/client/src/helpers/nova/networkInfo.ts b/client/src/helpers/nova/networkInfo.ts index 3fd8a6476..8d4087129 100644 --- a/client/src/helpers/nova/networkInfo.ts +++ b/client/src/helpers/nova/networkInfo.ts @@ -12,6 +12,7 @@ export const MANA_INFO_DEFAULT = { interface INetworkInfo { name: string; + label: string; tokenInfo: BaseTokenResponse; manaInfo: BaseTokenResponse; protocolVersion: number; @@ -28,6 +29,7 @@ interface NetworkInfoState { export const useNetworkInfoNova = create((set) => ({ networkInfo: { name: "", + label: "", tokenInfo: { name: "", tickerSymbol: "",