Skip to content

Commit

Permalink
feat: eco support non-intergrate chains
Browse files Browse the repository at this point in the history
  • Loading branch information
vvvvvv1vvvvvv committed Nov 15, 2024
1 parent 33c9a92 commit 6265d3c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/ui/component/Ecology/EcologyNavBar.tsx
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
8 changes: 8 additions & 0 deletions src/ui/views/Ecology/constants.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const EcoChains = [
{
id: 20240603,
name: 'DBK Chain',
logo:
'https://static.debank.com/image/chain/logo_url/dbk/1255de5a9316fed901d14c069ac62f39.png',
},
];

0 comments on commit 6265d3c

Please sign in to comment.