From c13ee1091da9eb41e3ebe66f5208aa3bb41d230d Mon Sep 17 00:00:00 2001 From: iamacook Date: Wed, 8 Dec 2021 11:41:54 +0100 Subject: [PATCH 1/3] chore: Use native token symbol + adjust text --- src/components/App/ReceiveModal.tsx | 2 +- src/components/TransactionsFees/index.tsx | 4 ++-- src/routes/CreateSafePage/steps/ReviewNewSafeStep.tsx | 4 ++-- .../screens/ContractInteraction/NativeCoinValue/index.tsx | 2 +- .../SendModal/screens/ContractInteraction/Review/index.tsx | 2 +- .../screens/ContractInteraction/ReviewCustomTx/index.tsx | 2 +- .../screens/ContractInteraction/SendCustomTx/index.tsx | 2 +- .../safe/components/Transactions/TxList/MultiSendDetails.tsx | 2 +- .../components/Transactions/TxList/modals/ApproveTxModal.tsx | 3 +-- 9 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/components/App/ReceiveModal.tsx b/src/components/App/ReceiveModal.tsx index dd1b7d5801..ee4d06d4a9 100644 --- a/src/components/App/ReceiveModal.tsx +++ b/src/components/App/ReceiveModal.tsx @@ -104,7 +104,7 @@ const ReceiveModal = ({ onClose, safeAddress, safeName }: Props): ReactElement = This is the address of your Safe. Deposit funds by scanning the QR code or copying the address below. Only send{' '} - {chainInfo.nativeCurrency.name} and assets to this address (e.g. ETH, ERC20, ERC721)! + {chainInfo.nativeCurrency.symbol} and assets to this address (e.g. ETH, ERC20, ERC721)! diff --git a/src/components/TransactionsFees/index.tsx b/src/components/TransactionsFees/index.tsx index a6440641a7..7850e67b4d 100644 --- a/src/components/TransactionsFees/index.tsx +++ b/src/components/TransactionsFees/index.tsx @@ -43,8 +43,8 @@ export const TransactionFees = ({ Make sure you have{' '} {gasCostFormatted} - {' '} - (fee price) {nativeCurrency.name} in this wallet to fund this confirmation. + + {` ${nativeCurrency.symbol}`} in this wallet to fund the associated transaction fee. )} diff --git a/src/routes/CreateSafePage/steps/ReviewNewSafeStep.tsx b/src/routes/CreateSafePage/steps/ReviewNewSafeStep.tsx index 07584eab1d..b54f7c2a0f 100644 --- a/src/routes/CreateSafePage/steps/ReviewNewSafeStep.tsx +++ b/src/routes/CreateSafePage/steps/ReviewNewSafeStep.tsx @@ -134,8 +134,8 @@ function ReviewNewSafeStep(): ReactElement | null { You're about to create a new Safe on and will have to confirm a transaction with your - currently connected wallet. The creation will cost approximately {gasCostFormatted} {nativeCurrency.name}. The - exact amount will be determined by your wallet. + currently connected wallet. The creation will cost approximately {gasCostFormatted} {nativeCurrency.symbol}. + The exact amount will be determined by your wallet. diff --git a/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/NativeCoinValue/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/NativeCoinValue/index.tsx index 41c57c85a5..eab33a09e2 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/NativeCoinValue/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/NativeCoinValue/index.tsx @@ -56,7 +56,7 @@ export const NativeCoinValue = ({ onSetMax }: NativeCoinValueProps): React.React component={TextField} disabled={disabled} inputAdornment={{ - endAdornment: {nativeCurrency.name}, + endAdornment: {nativeCurrency.symbol}, disabled, }} name="value" diff --git a/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/Review/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/Review/index.tsx index 72fc43aa0c..76c328bb94 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/Review/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/Review/index.tsx @@ -179,7 +179,7 @@ const ContractInteractionReview = ({ onClose, onPrev, tx }: Props): React.ReactE {tx.value || 0} - {' ' + nativeCurrency.name} + {' ' + nativeCurrency.symbol} diff --git a/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/ReviewCustomTx/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/ReviewCustomTx/index.tsx index c1699c3da9..26978f31c9 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/ReviewCustomTx/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/ReviewCustomTx/index.tsx @@ -135,7 +135,7 @@ const ReviewCustomTx = ({ onClose, onPrev, tx }: Props): ReactElement => { Ether {tx.value || 0} - {' ' + nativeCurrency.name} + {' ' + nativeCurrency.symbol} diff --git a/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/SendCustomTx/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/SendCustomTx/index.tsx index 24112765bf..49c7d13d93 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/SendCustomTx/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/SendCustomTx/index.tsx @@ -110,7 +110,7 @@ const SendCustomTx = ({ initialValues, isABI, onClose, onNext, switchMethod }: P {nativeCurrency.name}, + endAdornment: {nativeCurrency.symbol}, }} name="value" placeholder="Value*" diff --git a/src/routes/safe/components/Transactions/TxList/MultiSendDetails.tsx b/src/routes/safe/components/Transactions/TxList/MultiSendDetails.tsx index 0915d91b71..69b91eb81d 100644 --- a/src/routes/safe/components/Transactions/TxList/MultiSendDetails.tsx +++ b/src/routes/safe/components/Transactions/TxList/MultiSendDetails.tsx @@ -63,7 +63,7 @@ export const MultiSendDetails = ({ txData }: { txData: TransactionData }): React const { data, value, to } = valuesDecoded[index] const actionTitle = `Action ${index + 1} ${dataDecoded ? `(${dataDecoded.method})` : ''}` const amount = value ? fromTokenUnit(value, nativeCurrency.decimals) : 0 - const title = `Send ${amount} ${nativeCurrency.name} to:` + const title = `Send ${amount} ${nativeCurrency.symbol} to:` if (dataDecoded) { // Backend decoded data diff --git a/src/routes/safe/components/Transactions/TxList/modals/ApproveTxModal.tsx b/src/routes/safe/components/Transactions/TxList/modals/ApproveTxModal.tsx index 2043c7c99f..9f9eb31a58 100644 --- a/src/routes/safe/components/Transactions/TxList/modals/ApproveTxModal.tsx +++ b/src/routes/safe/components/Transactions/TxList/modals/ApproveTxModal.tsx @@ -56,8 +56,7 @@ const getModalTitleAndDescription = ( if (thresholdReached) { modalInfo.title = 'Execute transaction' - modalInfo.description = - 'This action will execute this transaction. A separate Transaction will be performed to submit the execution.' + modalInfo.description = 'This action will execute this transaction.' } else { modalInfo.title = 'Approve Transaction' modalInfo.description = From 91bc146ad361c00d2ada8b24776a7cfc97c1ab2d Mon Sep 17 00:00:00 2001 From: iamacook Date: Wed, 8 Dec 2021 12:08:14 +0100 Subject: [PATCH 2/3] fix: Tests + remove all mentions of 'ERC1155' --- src/logic/safe/store/actions/__tests__/fetchSafe.test.ts | 3 +-- src/logic/safe/store/actions/__tests__/utils.test.ts | 2 -- src/logic/safe/store/actions/mocks/safeInformation.ts | 4 ++-- src/routes/CreateSafePage/CreateSafePage.test.tsx | 8 ++++---- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/logic/safe/store/actions/__tests__/fetchSafe.test.ts b/src/logic/safe/store/actions/__tests__/fetchSafe.test.ts index 6401429705..3ab8d5bf93 100644 --- a/src/logic/safe/store/actions/__tests__/fetchSafe.test.ts +++ b/src/logic/safe/store/actions/__tests__/fetchSafe.test.ts @@ -72,7 +72,7 @@ describe('buildSafe', () => { nonce: 492, currentVersion: '1.1.1', needsUpdate: false, - featuresEnabled: ['ERC721', 'ERC1155', 'SAFE_APPS', 'CONTRACT_INTERACTION'], + featuresEnabled: ['ERC721', 'SAFE_APPS', 'CONTRACT_INTERACTION'], }) }) it.skip('should return a Partial SafeRecord with only `address` and `name` keys if it fails to recover info', async () => { @@ -131,7 +131,6 @@ describe('fetchSafe', () => { 'CONTRACT_INTERACTION', 'DOMAIN_LOOKUP', 'EIP1559', - 'ERC1155', 'ERC721', 'SAFE_APPS', 'SAFE_TX_GAS_OPTIONAL', diff --git a/src/logic/safe/store/actions/__tests__/utils.test.ts b/src/logic/safe/store/actions/__tests__/utils.test.ts index 26d0b8ea01..ffc90ca04c 100644 --- a/src/logic/safe/store/actions/__tests__/utils.test.ts +++ b/src/logic/safe/store/actions/__tests__/utils.test.ts @@ -152,7 +152,6 @@ describe('extractRemoteSafeInfo', () => { 'CONTRACT_INTERACTION', 'DOMAIN_LOOKUP', 'EIP1559', - 'ERC1155', 'ERC721', 'SAFE_APPS', 'SAFE_TX_GAS_OPTIONAL', @@ -185,7 +184,6 @@ describe('extractRemoteSafeInfo', () => { 'CONTRACT_INTERACTION', 'DOMAIN_LOOKUP', 'EIP1559', - 'ERC1155', 'ERC721', 'SAFE_APPS', 'SAFE_TX_GAS_OPTIONAL', diff --git a/src/logic/safe/store/actions/mocks/safeInformation.ts b/src/logic/safe/store/actions/mocks/safeInformation.ts index 2d485f6e09..f219869b19 100644 --- a/src/logic/safe/store/actions/mocks/safeInformation.ts +++ b/src/logic/safe/store/actions/mocks/safeInformation.ts @@ -168,7 +168,7 @@ export const localSafesInfo = { nonce: 492, currentVersion: '1.1.1', needsUpdate: false, - featuresEnabled: ['ERC721', 'ERC1155', 'SAFE_APPS', 'CONTRACT_INTERACTION'], + featuresEnabled: ['ERC721', 'SAFE_APPS', 'CONTRACT_INTERACTION'], collectiblesTag: '1634550387', txQueuedTag: '1634550387', txHistoryTag: '1633430459', @@ -247,7 +247,7 @@ export const inMemoryPartialSafeInformation = { nonce: 492, currentVersion: '1.3.0', needsUpdate: false, - featuresEnabled: ['ERC721', 'ERC1155', 'SAFE_APPS', 'CONTRACT_INTERACTION', 'SAFE_TX_GAS_OPTIONAL'], + featuresEnabled: ['ERC721', 'SAFE_APPS', 'CONTRACT_INTERACTION', 'SAFE_TX_GAS_OPTIONAL'], collectiblesTag: '1634550387', txQueuedTag: '1634550387', txHistoryTag: '1633430459', diff --git a/src/routes/CreateSafePage/CreateSafePage.test.tsx b/src/routes/CreateSafePage/CreateSafePage.test.tsx index 28e9e6f20f..84c3c410df 100644 --- a/src/routes/CreateSafePage/CreateSafePage.test.tsx +++ b/src/routes/CreateSafePage/CreateSafePage.test.tsx @@ -675,7 +675,7 @@ describe('', () => { expect(estimateGasForDeployingSafeSpy).toHaveBeenCalledWith(addresses, owners, userAccount, mockedDateValue) await waitFor(() => - expect(screen.getByText('The creation will cost approximately 0.02302 Ether', { exact: false })), + expect(screen.getByText('The creation will cost approximately 0.02302 ETH', { exact: false })), ) }) @@ -732,7 +732,7 @@ describe('', () => { expect(estimateGasForDeployingSafeSpy).toHaveBeenCalledWith(addresses, owners, userAccount, mockedDateValue) await waitFor(() => - expect(screen.getByText('The creation will cost approximately 0.02302 Ether', { exact: false })), + expect(screen.getByText('The creation will cost approximately 0.02302 ETH', { exact: false })), ) }) @@ -794,7 +794,7 @@ describe('', () => { expect(estimateGasForDeployingSafeSpy).toHaveBeenCalledWith(addresses, owners, userAccount, mockedDateValue) await waitFor(() => - expect(screen.getByText('The creation will cost approximately 0.02302 Ether', { exact: false })), + expect(screen.getByText('The creation will cost approximately 0.02302 ETH', { exact: false })), ) }) @@ -856,7 +856,7 @@ describe('', () => { expect(estimateGasForDeployingSafeSpy).toHaveBeenCalledWith(addresses, owners, userAccount, mockedDateValue) await waitFor(() => - expect(screen.getByText('The creation will cost approximately 0.02302 Ether', { exact: false })), + expect(screen.getByText('The creation will cost approximately 0.02302 ETH', { exact: false })), ) }) }) From 166d703cc106e3998b14c0135ddbf4e4d1d0cd37 Mon Sep 17 00:00:00 2001 From: katspaugh <381895+katspaugh@users.noreply.github.com> Date: Wed, 8 Dec 2021 17:55:57 +0100 Subject: [PATCH 3/3] Make native symbol bold --- src/components/TransactionsFees/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/TransactionsFees/index.tsx b/src/components/TransactionsFees/index.tsx index 7850e67b4d..3bffdb4887 100644 --- a/src/components/TransactionsFees/index.tsx +++ b/src/components/TransactionsFees/index.tsx @@ -40,11 +40,12 @@ export const TransactionFees = ({ connected wallet.{' '} {!isOffChainSignature && ( <> - Make sure you have{' '} + Make sure you have - {gasCostFormatted} + {' '} + {gasCostFormatted} {nativeCurrency.symbol}{' '} - {` ${nativeCurrency.symbol}`} in this wallet to fund the associated transaction fee. + in this wallet to fund the associated transaction fee. )}