Skip to content

Commit 1aab6cd

Browse files
committed
fix(suite): fix typography style of link and blur urls
1 parent 686e102 commit 1aab6cd

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

packages/suite/src/components/suite/FormattedNftAmount.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { SignValue } from '@suite-common/suite-types';
44
import { isNftMultitokenTransfer } from '@suite-common/wallet-utils';
55
import { TokenTransfer } from '@trezor/connect';
66
import { Box, Column, Row, Text } from '@trezor/components';
7-
import { spacings } from '@trezor/theme';
7+
import { spacings, TypographyStyle } from '@trezor/theme';
88

99
import { HiddenPlaceholder, Sign, Translation } from 'src/components/suite';
1010
// importing directly, otherwise unit tests fail, seems to be a styled-components issue
@@ -19,6 +19,7 @@ export interface FormattedNftAmountProps {
1919
className?: string;
2020
isWithLink?: boolean;
2121
alignMultitoken?: 'flex-end' | 'flex-start';
22+
linkTypographyStyle?: TypographyStyle;
2223
}
2324

2425
export const FormattedNftAmount = ({
@@ -27,15 +28,16 @@ export const FormattedNftAmount = ({
2728
className,
2829
isWithLink,
2930
alignMultitoken = 'flex-end',
31+
linkTypographyStyle,
3032
}: FormattedNftAmountProps) => {
3133
const theme = useTheme();
3234
const { translationString } = useTranslation();
3335
const { selectedAccount } = useSelector(state => state.wallet);
3436
const { network } = selectedAccount;
3537

3638
const symbolComponent = transfer.symbol ? (
37-
<Text maxWidth={120} ellipsisLineCount={1}>
38-
{transfer.symbol}
39+
<Text ellipsisLineCount={1}>
40+
<BlurUrls text={transfer.symbol} />
3941
</Text>
4042
) : null;
4143

@@ -70,7 +72,7 @@ export const FormattedNftAmount = ({
7072
href={`${network?.explorer.nft}/${transfer.contract}/${token.id}`}
7173
color={theme.textSecondaryHighlight}
7274
variant="underline"
73-
typographyStyle="label"
75+
typographyStyle={linkTypographyStyle}
7476
>
7577
<Text maxWidth={145} ellipsisLineCount={1}>
7678
{token.id}
@@ -104,7 +106,7 @@ export const FormattedNftAmount = ({
104106
}
105107
color={theme.textSecondaryHighlight}
106108
variant="underline"
107-
typographyStyle="label"
109+
typographyStyle={linkTypographyStyle}
108110
>
109111
<Row gap={spacings.zero}>
110112
<Text maxWidth={145} ellipsisLineCount={1}>

packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/AmountDetails.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ export const AmountDetails = ({ tx, isTestnet }: AmountDetailsProps) => {
185185
withLink={true}
186186
withSign={true}
187187
alignMultitoken="flex-start"
188+
linkTypographyStyle="hint"
188189
/>
189190
</Text>
190191
</Table.Cell>

packages/suite/src/components/suite/modals/ReduxModal/UserContextModal/TxDetailModal/AdvancedTxDetails/IODetails/IODetails.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ const EthereumSpecificBalanceDetailsRow = ({
208208
transfer={transfer}
209209
isWithLink
210210
alignMultitoken="flex-start"
211+
linkTypographyStyle="label"
211212
/>
212213
) : (
213214
formatAmount(transfer.amount, transfer.decimals)

packages/suite/src/components/wallet/AmountComponent.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { isNftTokenTransfer, formatAmount, getTxOperation } from '@suite-common/wallet-utils';
22
import { TokenTransfer } from '@trezor/connect';
3+
import { TypographyStyle } from '@trezor/theme';
34

45
import { FormattedNftAmount } from 'src/components/suite/FormattedNftAmount';
56
import { FormattedCryptoAmount } from 'src/components/suite/FormattedCryptoAmount';
@@ -9,13 +10,15 @@ type AmountComponentProps = {
910
withLink?: boolean;
1011
withSign?: boolean;
1112
alignMultitoken?: 'flex-end' | 'flex-start';
13+
linkTypographyStyle?: TypographyStyle;
1214
};
1315

1416
export const AmountComponent = ({
1517
transfer,
1618
withLink = false,
1719
withSign = false,
1820
alignMultitoken,
21+
linkTypographyStyle,
1922
}: AmountComponentProps): React.ReactNode => {
2023
const operation = getTxOperation(transfer.type);
2124

@@ -26,6 +29,7 @@ export const AmountComponent = ({
2629
isWithLink={withLink}
2730
signValue={withSign ? operation : null}
2831
alignMultitoken={alignMultitoken}
32+
linkTypographyStyle={linkTypographyStyle}
2933
/>
3034
);
3135
}

0 commit comments

Comments
 (0)