From 8310b551fbcbf551411a70aa6f598cc783767380 Mon Sep 17 00:00:00 2001 From: ryanml Date: Thu, 16 Sep 2021 09:52:42 -0700 Subject: [PATCH] Adding "Enable smart contract data" step to Ledger Instructions (Confirmation Screen) (#12115) --- app/_locales/en/messages.json | 3 + .../confirm-transaction-base.component.js | 58 ++++++++----------- 2 files changed, 28 insertions(+), 33 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 75c12fc61..09e48d287 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -1183,6 +1183,9 @@ "ledgerLiveDialogHeader": { "message": "Prior to clicking confirm:" }, + "ledgerLiveDialogStepFour": { + "message": "Enable smart contract data on your Ledger device" + }, "ledgerLiveDialogStepOne": { "message": "Enable Use Ledger Live under Settings > Advanced" }, diff --git a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js index 0c0b39513..6714f0a9d 100644 --- a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -403,45 +403,37 @@ export default class ConfirmTransactionBase extends Component { ) : null; + const renderLedgerLiveStep = (text, show = true) => { + return ( + show && ( + + {text} + + ) + ); + }; + const ledgerInstructionField = isLedgerAccount ? (
- - {t('ledgerLiveDialogHeader')} - - {!isFirefox && ( - - {`- ${t('ledgerLiveDialogStepOne')}`} - + {renderLedgerLiveStep(t('ledgerLiveDialogHeader'))} + {renderLedgerLiveStep( + `- ${t('ledgerLiveDialogStepOne')}`, + !isFirefox, + )} + {renderLedgerLiveStep(`- ${t('ledgerLiveDialogStepTwo')}`)} + {renderLedgerLiveStep(`- ${t('ledgerLiveDialogStepThree')}`)} + {renderLedgerLiveStep( + `- ${t('ledgerLiveDialogStepFour')}`, + Boolean(txData.txParams?.data), )} - - {`- ${t('ledgerLiveDialogStepTwo')}`} - - - {`- ${t('ledgerLiveDialogStepThree')}`} -