From ec3c5c9727fb74d55e056ab0ed75070f8f7aa7a4 Mon Sep 17 00:00:00 2001 From: Alexandre Chabrolin <9203826+chabroA@users.noreply.github.com> Date: Wed, 12 Jan 2022 17:58:42 +0100 Subject: [PATCH] Add proper modal for fund flow --- src/renderer/components/DeviceAction/index.js | 12 +++++++++--- src/renderer/components/DeviceAction/rendering.js | 8 +++++--- static/i18n/en/app.json | 4 ++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/renderer/components/DeviceAction/index.js b/src/renderer/components/DeviceAction/index.js index ee69f44d9e..5147b73a9e 100644 --- a/src/renderer/components/DeviceAction/index.js +++ b/src/renderer/components/DeviceAction/index.js @@ -28,7 +28,7 @@ import { renderListingApps, renderWarningOutdated, renderSwapDeviceConfirmationV2, - renderSellDeviceConfirmation, + renderSecureTransferDeviceConfirmation, } from "./rendering"; type OwnProps = { @@ -173,7 +173,13 @@ const DeviceAction = ({ // sell case 0x01: - return renderSellDeviceConfirmation({ modelId, type }); + // fund + case 0x02: + return renderSecureTransferDeviceConfirmation({ + exchangeType: exchangeType === 0x01 ? "sell" : "fund", + modelId, + type, + }); default: return
{"Confirm exchange on your device"}
; @@ -197,7 +203,7 @@ const DeviceAction = ({ } if (initSellRequested && !initSellResult && !initSellError) { - return renderSellDeviceConfirmation({ modelId, type }); + return renderSecureTransferDeviceConfirmation({ exchangeType: "sell", modelId, type }); } if (allowOpeningRequestedWording || requestOpenApp) { diff --git a/src/renderer/components/DeviceAction/rendering.js b/src/renderer/components/DeviceAction/rendering.js index c68868e976..a86e7a29ac 100644 --- a/src/renderer/components/DeviceAction/rendering.js +++ b/src/renderer/components/DeviceAction/rendering.js @@ -733,21 +733,23 @@ export const renderSwapDeviceConfirmationV2 = ({ ); }; -export const renderSellDeviceConfirmation = ({ +export const renderSecureTransferDeviceConfirmation = ({ + exchangeType, modelId, type, }: { + exchangeType: "sell" | "fund", modelId: DeviceModelId, type: "light" | "dark", }) => ( <> - + {renderVerifyUnwrapped({ modelId, type })} - + diff --git a/static/i18n/en/app.json b/static/i18n/en/app.json index 00b0bdbbac..5f79768f3c 100644 --- a/static/i18n/en/app.json +++ b/static/i18n/en/app.json @@ -1505,6 +1505,10 @@ "sell": { "notice": "Verify the Sell details on your device before sending it. The addresses are exchanged securely so you don’t have to verify them.", "confirm": "Confirm Sell transaction" + }, + "fund": { + "notice": "Verify the Fund details on your device before sending it. The addresses are exchanged securely so you don't have to verify them.", + "confirm": "Confirm Fund transaction" } }, "manager": {