Skip to content

Commit

Permalink
fix pr typos
Browse files Browse the repository at this point in the history
  • Loading branch information
bogos committed Oct 5, 2023
1 parent 3ba497d commit 60b5787
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
10 changes: 8 additions & 2 deletions src/constants/titleTokenType.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -8,7 +8,7 @@ export interface TitleMapProps {
imgProps: { width: number; height: number }
}

export const TITLE_MAP_TOKEN: Record<TokenType, TitleMapProps> = {
export const TITLE_MAP_TOKEN: Record<ContractType, TitleMapProps> = {
psp22: {
title: 'TOKEN | PSP22',
subtitle: 'Standard smart contract for a fungible token',
Expand All @@ -26,5 +26,11 @@ export const TITLE_MAP_TOKEN: Record<TokenType, TitleMapProps> = {
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 }
}
}
7 changes: 2 additions & 5 deletions src/view/ContractView/ContractsTable/ContractsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -26,16 +25,14 @@ export interface ContractsTableProps {
contracts: ContractTableItem[]
}

type ContractType = keyof typeof TITLE_MAP_TOKEN

function ContractTableRow({
contract,
setOpenModal
}: {
contract: ContractTableItem
setOpenModal: React.Dispatch<React.SetStateAction<boolean>>
}) {
const typeMap = TITLE_MAP_TOKEN[contract.type as ContractType]
const typeMap = TITLE_MAP_TOKEN[contract.type]
return (
<TableRow sx={{ '&:last-child td, &:last-child th': { border: 0 } }}>
<TableCell component="th" scope="row">
Expand All @@ -51,7 +48,7 @@ function ContractTableRow({
</TableCell>
<TableCell component="th" scope="row">
<TokenWrapper>
<TokenIconSvg label={contract.type as ContractType} />
<TokenIconSvg label={contract.type} />
{typeMap.title}
</TokenWrapper>
</TableCell>
Expand Down
7 changes: 4 additions & 3 deletions src/view/components/TokenIconSvg/index.tsx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 60b5787

Please sign in to comment.