mirror of
https://github.com/hanzonet/explore.git
synced 2026-10-30 18:16:57 +00:00
* Migrate to the props with consistent full naming in the API for address hash entity and multiple props for L2-rollups Fixes #2686 * fix test
28 lines
651 B
TypeScript
28 lines
651 B
TypeScript
import { chakra } from '@chakra-ui/react';
|
|
import React from 'react';
|
|
|
|
import { route } from 'nextjs-routes';
|
|
|
|
import config from 'configs/app';
|
|
|
|
import * as TokenEntity from './TokenEntity';
|
|
|
|
const rollupFeature = config.features.rollup;
|
|
|
|
const TokenEntityL1 = (props: TokenEntity.EntityProps) => {
|
|
if (!rollupFeature.isEnabled) {
|
|
return null;
|
|
}
|
|
|
|
const defaultHref = rollupFeature.parentChain.baseUrl + route({
|
|
pathname: '/token/[hash]',
|
|
query: { hash: props.token.address_hash },
|
|
});
|
|
|
|
return (
|
|
<TokenEntity.default { ...props } href={ props.href ?? defaultHref } isExternal/>
|
|
);
|
|
};
|
|
|
|
export default chakra(TokenEntityL1);
|