diff --git a/src/constants/titleTokenType.ts b/src/constants/titleTokenType.ts index a62ec1a4..a6e1aaf9 100644 --- a/src/constants/titleTokenType.ts +++ b/src/constants/titleTokenType.ts @@ -1,5 +1,5 @@ -import { TokenType } from '@/domain' import { TOKEN_PATHS } from '@/constants/images' +import { ContractType } from '@/domain/repositories/DeploymentRepository' export interface TitleMapProps { title: string @@ -8,7 +8,7 @@ export interface TitleMapProps { imgProps: { width: number; height: number } } -export const TITLE_MAP_TOKEN: Record = { +export const TITLE_MAP_TOKEN: Record = { psp22: { title: 'TOKEN | PSP22', subtitle: 'Standard smart contract for a fungible token', @@ -26,5 +26,11 @@ export const TITLE_MAP_TOKEN: Record = { subtitle: 'Standard smart contract for a Multi Token', imgPath: TOKEN_PATHS.psp37, imgProps: { width: 45, height: 39 } + }, + custom: { + title: 'CUSTOM', + subtitle: 'Standard smart contract for a custom Token', + imgPath: TOKEN_PATHS.psp37, + imgProps: { width: 45, height: 39 } } } diff --git a/src/view/ContractView/ContractsTable/ContractsTable.tsx b/src/view/ContractView/ContractsTable/ContractsTable.tsx index 2ccf094b..96276f65 100644 --- a/src/view/ContractView/ContractsTable/ContractsTable.tsx +++ b/src/view/ContractView/ContractsTable/ContractsTable.tsx @@ -10,7 +10,6 @@ import { import { CopyToClipboardButton, TokenIconSvg } from '@/components' import { isoToReadableDate, truncateAddress } from '@/utils/formatString' -import { TokenType } from '@/domain' import { ContractTableItem } from '@/domain/wizard/ContractTableItem' import { MonoTypography } from '@/components' import { StyledTableContainer, TokenWrapper } from './styled' @@ -26,8 +25,6 @@ export interface ContractsTableProps { contracts: ContractTableItem[] } -type ContractType = keyof typeof TITLE_MAP_TOKEN - function ContractTableRow({ contract, setOpenModal @@ -35,7 +32,7 @@ function ContractTableRow({ contract: ContractTableItem setOpenModal: React.Dispatch> }) { - const typeMap = TITLE_MAP_TOKEN[contract.type as ContractType] + const typeMap = TITLE_MAP_TOKEN[contract.type] return ( @@ -51,7 +48,7 @@ function ContractTableRow({ - + {typeMap.title} diff --git a/src/view/components/TokenIconSvg/index.tsx b/src/view/components/TokenIconSvg/index.tsx index 6616441d..347b6102 100644 --- a/src/view/components/TokenIconSvg/index.tsx +++ b/src/view/components/TokenIconSvg/index.tsx @@ -1,16 +1,17 @@ -import { TokenType, tokenTypes } from '@/domain/TokenType' +import { tokenTypes } from '@/domain/TokenType' import Image from 'next/image' import { TITLE_MAP_TOKEN, TitleMapProps } from '@/constants/titleTokenType' import { calculateNewDimensions } from '@/utils/images' +import { ContractType } from '@/domain/repositories/DeploymentRepository' interface Props { - label: TokenType + label: ContractType } const MAX_SIZE = 25 type MapSmallIconSize = { - [K in TokenType]: TitleMapProps['imgProps'] + [K in ContractType]: TitleMapProps['imgProps'] } const mapSmallIconSize: MapSmallIconSize = tokenTypes diff --git a/src/view/components/WalletConnectButton/AccountSelect/index.tsx b/src/view/components/WalletConnectButton/AccountSelect/index.tsx index e228768d..051a630d 100644 --- a/src/view/components/WalletConnectButton/AccountSelect/index.tsx +++ b/src/view/components/WalletConnectButton/AccountSelect/index.tsx @@ -3,10 +3,7 @@ import { shortNameLonger, truncateAddress } from '@/utils/formatString' import CircleIcon from '@mui/icons-material/Circle' import PowerSettingsNewRoundedIcon from '@mui/icons-material/PowerSettingsNewRounded' import { OPTION_FOR_DISCONNECTING } from '@/context/NetworkAccountsContext' -import { - WalletAccount, - WalletLogoProps -} from '@/infrastructure/useink/walletTypes' +import { WalletAccount } from '@/infrastructure/useink/walletTypes' import { StyledMenuItem, StyledSelect } from './styled' interface AccountSelectProps {