Skip to content

Commit 5011b1a

Browse files
fix(ui-gas): polish text and buttonicon for gas toast
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d5cf9e4 commit 5011b1a

2 files changed

Lines changed: 11 additions & 16 deletions

File tree

app/components/Views/confirmations/components/gas/gas-fee-token-toast/gas-fee-token-toast.test.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,10 @@ describe('GasFeeTokenToast', () => {
156156
expect(mockShowToast).toHaveBeenCalledWith(
157157
expect.objectContaining({
158158
labelOptions: [
159-
{ label: "You're paying this network fee with ", isBold: false },
160-
{ label: matchingTokenSymbol, isBold: true },
161-
{ label: '.', isBold: false },
159+
{
160+
label: `You're paying this network fee with ${matchingTokenSymbol}.`,
161+
isBold: true,
162+
},
162163
],
163164
variant: ToastVariants.Network,
164165
networkImageSource: { uri: matchingTokenImage },

app/components/Views/confirmations/components/gas/gas-fee-token-toast/gas-fee-token-toast.tsx

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useContext, useEffect, useRef } from 'react';
22
import {
33
ToastContext,
44
ToastVariants,
5+
ButtonIconVariant,
56
} from '../../../../../../component-library/components/Toast';
67
import { strings } from '../../../../../../../locales/i18n';
78
import { TransactionType } from '@metamask/transaction-controller';
@@ -13,7 +14,6 @@ import {
1314
} from '../../../hooks/gas/useGasFeeToken';
1415
import { useTransactionMetadataRequest } from '../../../hooks/transactions/useTransactionMetadataRequest';
1516
import { IconName } from '../../../../../../component-library/components/Icons/Icon';
16-
import { ButtonVariants } from '../../../../../../component-library/components/Buttons/Button';
1717
import { useTokenWithBalance } from '../../../hooks/tokens/useTokenWithBalance';
1818
import { getNetworkImageSource } from '../../../../../../util/networks';
1919
import { hasTransactionType } from '../../../utils/transaction';
@@ -52,9 +52,10 @@ export function GasFeeTokenToast() {
5252

5353
toast.showToast({
5454
labelOptions: [
55-
{ label: strings('gas_fee_token_toast.message'), isBold: false },
56-
{ label: `${gasFeeToken.symbol}`, isBold: true },
57-
{ label: '.', isBold: false },
55+
{
56+
label: `${strings('gas_fee_token_toast.message')}${gasFeeToken.symbol}.`,
57+
isBold: true,
58+
},
5859
],
5960
variant: ToastVariants.Network,
6061
hasNoTimeout: false,
@@ -63,18 +64,11 @@ export function GasFeeTokenToast() {
6364
? { uri: tokenSelected.image }
6465
: networkImageSource,
6566
closeButtonOptions: {
66-
variant: ButtonVariants.Primary,
67-
endIconName: IconName.Close,
68-
label: undefined,
67+
variant: ButtonIconVariant.Icon,
68+
iconName: IconName.Close,
6969
onPress: () => {
7070
toast?.closeToast();
7171
},
72-
style: {
73-
backgroundColor: 'transparent',
74-
paddingHorizontal: 4,
75-
paddingVertical: 10,
76-
height: 20,
77-
},
7872
},
7973
});
8074
}, [

0 commit comments

Comments
 (0)