diff --git a/packages/gui/src/components/offers/OfferSummary.tsx b/packages/gui/src/components/offers/OfferSummary.tsx index cd9a2d460b..082ccb69ec 100644 --- a/packages/gui/src/components/offers/OfferSummary.tsx +++ b/packages/gui/src/components/offers/OfferSummary.tsx @@ -14,7 +14,7 @@ import { useTheme } from '@mui/material/styles'; import styled from 'styled-components'; import useAssetIdName from '../../hooks/useAssetIdName'; import OfferExchangeRate from './OfferExchangeRate'; -import OfferSummaryRow from './OfferSummaryRow'; +import { OfferSummaryTokenRow } from './OfferSummaryRow'; const StyledWarningText = styled(Typography)` color: ${StateColor.WARNING}; @@ -134,7 +134,8 @@ export default function OfferSummary(props: Props) { {entries.map(([assetId, amount], index) => ( - ); } - -/* ========================================================================== */ - -type Props = { - assetId: string; - amount: number; - rowNumber?: number; -}; - -export default function OfferSummaryRow(props: Props) { - const { assetId, amount, rowNumber } = props; - const { lookupByAssetId } = useAssetIdName(); - const assetIdInfo = lookupByAssetId(assetId); - const displayAmount = assetIdInfo - ? formatAmountForWalletType(amount as number, assetIdInfo.walletType) - : mojoToCATLocaleString(amount); - const displayName = assetIdInfo?.displayName ?? t`Unknown CAT`; - const showMojoAmount = - assetIdInfo?.walletType === WalletType.STANDARD_WALLET && - shouldShowMojoAmount(amount); - - return ( - - - - {rowNumber !== undefined && ( - {`${rowNumber})`} - )} - - {displayAmount} {displayName} - - - - {showMojoAmount && ( - - - - )} - - - - - - Name - - {assetIdInfo?.walletType === WalletType.CAT && ( - - Search on Tail Database - - )} - - - {assetIdInfo?.name} - - {assetIdInfo?.walletType === WalletType.CAT && ( - - Asset ID - - {assetId.toLowerCase()} - - - - )} - - - - ); -}