From 2038749688f9552fb9dc5fc174f35db3529a88de Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Sun, 10 Nov 2024 09:37:37 +0100 Subject: [PATCH] Update HomePage graph labels for localnet --- src/app/pages/HomePage/Graph/Graph/index.tsx | 46 +++++++++----------- src/locales/en/translation.json | 4 +- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/app/pages/HomePage/Graph/Graph/index.tsx b/src/app/pages/HomePage/Graph/Graph/index.tsx index d7e9ece69..421c31f88 100644 --- a/src/app/pages/HomePage/Graph/Graph/index.tsx +++ b/src/app/pages/HomePage/Graph/Graph/index.tsx @@ -11,7 +11,7 @@ import { useMemo, useState, } from 'react' -import { RouteUtils } from '../../../../utils/route-utils' +import { RouteUtils, isLocalnet } from '../../../../utils/route-utils' import { useScreenSize } from '../../../../hooks/useScreensize' import { Layer } from '../../../../../oasis-nexus/api' import { Network } from '../../../../../types/network' @@ -42,6 +42,22 @@ interface GraphStyledProps extends GraphBaseProps { hoveredLayer: Layer | null } +const LayerNotEnabledLabel = ({ network }: { network: Network }) => { + const { t } = useTranslation() + const isLocal = isLocalnet(network) + + return ( + <> + + {isLocal ? t('home.not') : t('home.coming')} + + + {isLocal ? t('home.enabled') : t('home.soon')} + + + ) +} + const GraphStyled = styled('svg', { shouldForwardProp: prop => !(['disabled', 'transparent', 'selectedArea', 'hoveredLayer'] as (keyof GraphStyledProps)[]).includes( @@ -604,12 +620,7 @@ const GraphCmp: ForwardRefRenderFunction = ( )} {!isMobile && hoveredLayer === Layer.emerald && disabledMap[Layer.emerald] && ( - - {t('home.coming')} - - - {t('home.soon')} - + )} @@ -660,12 +671,7 @@ const GraphCmp: ForwardRefRenderFunction = ( )} {!isMobile && hoveredLayer === Layer.sapphire && disabledMap[Layer.sapphire] && ( - - {t('home.coming')} - - - {t('home.soon')} - + )} @@ -737,12 +743,7 @@ const GraphCmp: ForwardRefRenderFunction = ( )} {!isMobile && hoveredLayer === Layer.consensus && disabledMap[Layer.consensus] && ( - - {t('home.coming')} - - - {t('home.soon')} - + )} @@ -786,12 +787,7 @@ const GraphCmp: ForwardRefRenderFunction = ( )} {!isMobile && hoveredLayer === Layer.cipher && disabledMap[Layer.cipher] && ( - - {t('home.coming')} - - - {t('home.soon')} - + )} diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 2b8f2f866..0c25d934e 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -582,7 +582,9 @@ }, "selectedNetwork": "Selected network", "coming": "Coming", - "soon": "soon" + "soon": "soon", + "not": "Not", + "enabled": "enabled" }, "paratimes": { "activeNodes": "{{nodes}} active",