From 6265d3cffaa56299af27e03895598dbc14c651df Mon Sep 17 00:00:00 2001 From: vvvvvv1vvvvvv Date: Fri, 15 Nov 2024 15:00:02 +0800 Subject: [PATCH] feat: eco support non-intergrate chains --- src/ui/component/Ecology/EcologyNavBar.tsx | 15 +++++++-------- src/ui/views/Ecology/constants.tsx | 8 ++++++++ 2 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 src/ui/views/Ecology/constants.tsx diff --git a/src/ui/component/Ecology/EcologyNavBar.tsx b/src/ui/component/Ecology/EcologyNavBar.tsx index 703bf680af8..6695afcf490 100644 --- a/src/ui/component/Ecology/EcologyNavBar.tsx +++ b/src/ui/component/Ecology/EcologyNavBar.tsx @@ -1,23 +1,22 @@ -import { findChain } from '@/utils/chain'; import clsx from 'clsx'; import React, { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useHistory } from 'react-router-dom'; import { ReactComponent as RcIconBack } from 'ui/assets/icon-back-cc.svg'; +import { EcoChains } from 'ui/views/Ecology/constants'; interface Props { className?: string; style?: React.CSSProperties; chainId: number; } + +const findChain = (id: number) => { + return EcoChains.find((chain) => chain.id === id); +}; + export const EcologyNavBar = ({ className, style, chainId }: Props) => { - const chain = useMemo( - () => - findChain({ - id: chainId, - }), - [chainId] - ); + const chain = useMemo(() => findChain(chainId), [chainId]); const history = useHistory(); const { t } = useTranslation(); diff --git a/src/ui/views/Ecology/constants.tsx b/src/ui/views/Ecology/constants.tsx new file mode 100644 index 00000000000..1da73735000 --- /dev/null +++ b/src/ui/views/Ecology/constants.tsx @@ -0,0 +1,8 @@ +export const EcoChains = [ + { + id: 20240603, + name: 'DBK Chain', + logo: + 'https://static.debank.com/image/chain/logo_url/dbk/1255de5a9316fed901d14c069ac62f39.png', + }, +];