Commit 8c974a46 authored by Max Alekseenko's avatar Max Alekseenko

move components

parent 50db854a
......@@ -6,18 +6,18 @@ import config from 'configs/app';
import type { IconName } from 'ui/shared/IconSvg';
import IconSvg from 'ui/shared/IconSvg';
export enum LinkButtonVariants {
export enum ContractListButtonVariants {
ALL_CONTRACTS = 'all contracts',
VERIFIED_CONTRACTS = 'verified contracts',
}
const values = {
[LinkButtonVariants.ALL_CONTRACTS]: {
[ContractListButtonVariants.ALL_CONTRACTS]: {
icon: 'contracts' as IconName,
iconColor: 'gray.500',
tooltip: `Total number of contracts deployed by the protocol on ${ config.chain.name }`,
},
[LinkButtonVariants.VERIFIED_CONTRACTS]: {
[ContractListButtonVariants.VERIFIED_CONTRACTS]: {
icon: 'contracts_verified' as IconName,
iconColor: 'green.500',
tooltip: `Number of verified contracts on ${ config.chain.name }`,
......@@ -27,10 +27,10 @@ const values = {
interface Props {
children: string;
onClick: (event: MouseEvent) => void;
variant: LinkButtonVariants;
variant: ContractListButtonVariants;
}
const LinkButton = ({ children, onClick, variant }: Props) => {
const ContractListButton = ({ children, onClick, variant }: Props) => {
const { icon, iconColor, tooltip } = values[variant];
return (
<Tooltip
......@@ -54,4 +54,4 @@ const LinkButton = ({ children, onClick, variant }: Props) => {
);
};
export default LinkButton;
export default ContractListButton;
......@@ -9,9 +9,9 @@ import * as mixpanel from 'lib/mixpanel/index';
import IconSvg from 'ui/shared/IconSvg';
import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile';
import AppSecurityReport from '../AppSecurityReport';
import ContractListButton, { ContractListButtonVariants } from '../ContractListButton';
import AppLink from './AppLink';
import AppSecurityReport from './AppSecurityReport';
import LinkButton, { LinkButtonVariants } from './LinkButton';
import MoreInfoButton from './MoreInfoButton';
type Props = {
......@@ -99,8 +99,12 @@ const ListItem = ({ app, onInfoClick, isFavorite, onFavoriteClick, isLoading, on
<Flex alignItems="center">
<Flex flex={ 1 } gap={ 3 } alignItems="center">
<AppSecurityReport id={ id } securityReport={ securityReport } showContractList={ showContractList }/>
<LinkButton onClick={ showAllContracts } variant={ LinkButtonVariants.ALL_CONTRACTS }>{ totalContractsNumber }</LinkButton>
<LinkButton onClick={ showVerifiedContracts } variant={ LinkButtonVariants.VERIFIED_CONTRACTS }>{ verifiedNumber }</LinkButton>
<ContractListButton onClick={ showAllContracts } variant={ ContractListButtonVariants.ALL_CONTRACTS }>
{ totalContractsNumber }
</ContractListButton>
<ContractListButton onClick={ showVerifiedContracts } variant={ ContractListButtonVariants.VERIFIED_CONTRACTS }>
{ verifiedNumber }
</ContractListButton>
</Flex>
{ !isLoading && (
<MoreInfoButton onClick={ handleInfoClick }/>
......
......@@ -8,9 +8,9 @@ import { ContractListTypes } from 'types/client/marketplace';
import * as mixpanel from 'lib/mixpanel/index';
import IconSvg from 'ui/shared/IconSvg';
import AppSecurityReport from '../AppSecurityReport';
import ContractListButton, { ContractListButtonVariants } from '../ContractListButton';
import AppLink from './AppLink';
import AppSecurityReport from './AppSecurityReport';
import LinkButton, { LinkButtonVariants } from './LinkButton';
import MoreInfoButton from './MoreInfoButton';
type Props = {
......@@ -86,12 +86,14 @@ const TableItem = ({
<AppSecurityReport id={ id } securityReport={ securityReport } showContractList={ showContractList } isLarge/>
</Td>
<Td verticalAlign="middle">
<LinkButton onClick={ showAllContracts } variant={ LinkButtonVariants.ALL_CONTRACTS }>
<ContractListButton onClick={ showAllContracts } variant={ ContractListButtonVariants.ALL_CONTRACTS }>
{ totalContractsNumber }
</LinkButton>
</ContractListButton>
</Td>
<Td verticalAlign="middle">
<LinkButton onClick={ showVerifiedContracts } variant={ LinkButtonVariants.VERIFIED_CONTRACTS }>{ verifiedNumber }</LinkButton>
<ContractListButton onClick={ showVerifiedContracts } variant={ ContractListButtonVariants.VERIFIED_CONTRACTS }>
{ verifiedNumber }
</ContractListButton>
</Td>
<Td verticalAlign="middle" isNumeric>
<MoreInfoButton onClick={ handleInfoClick }/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment