diff --git a/storybook/pages/ErrorTagPage.qml b/storybook/pages/ErrorTagPage.qml index 259012c89d..ece7fbb81b 100644 --- a/storybook/pages/ErrorTagPage.qml +++ b/storybook/pages/ErrorTagPage.qml @@ -49,7 +49,7 @@ SplitView { TextField { Layout.fillWidth: true id: ctrlText - text: "Insufficient funds to pay gas fees" + text: "Not enough ETH to pay gas fees" } } RowLayout { @@ -58,7 +58,7 @@ SplitView { TextField { Layout.fillWidth: true id: ctrlButtonText - text: "Buy ETH" + text: "Add ETH" } } RowLayout { diff --git a/storybook/qmlTests/tests/tst_BuyCryptoModal.qml b/storybook/qmlTests/tests/tst_BuyCryptoModal.qml index 1b738401e1..3f663eba0e 100644 --- a/storybook/qmlTests/tests/tst_BuyCryptoModal.qml +++ b/storybook/qmlTests/tests/tst_BuyCryptoModal.qml @@ -193,7 +193,7 @@ Item { verify(!!selectParamsPanel) // title should not change - verify(controlUnderTest.stackTitle, qsTr("Buy assets for %1").arg(!!controlUnderTest.selectedAccountEntry.item ? controlUnderTest.selectedAccountEntry.item.name: "")) + verify(controlUnderTest.stackTitle, qsTr("Ways to buy assets %1").arg(!!controlUnderTest.selectedAccountEntry.item ? controlUnderTest.selectedAccountEntry.item.name: "")) compare(controlUnderTest.rightButtons.length, 2) verify(controlUnderTest.rightButtons[0].visible) @@ -310,7 +310,7 @@ Item { // Launch modal launchPopup() - verify(controlUnderTest.stackTitle, qsTr("Buy assets for %1").arg(!!controlUnderTest.selectedAccountEntry.item ? controlUnderTest.selectedAccountEntry.item.name: "")) + verify(controlUnderTest.stackTitle, qsTr("Ways to buy assets for %1").arg(!!controlUnderTest.selectedAccountEntry.item ? controlUnderTest.selectedAccountEntry.item.name: "")) // // find tab bar // const tabBar = findChild(controlUnderTest, "tabBar") diff --git a/storybook/qmlTests/tests/tst_ErrorTag.qml b/storybook/qmlTests/tests/tst_ErrorTag.qml index 83c1485abb..e7774713f7 100644 --- a/storybook/qmlTests/tests/tst_ErrorTag.qml +++ b/storybook/qmlTests/tests/tst_ErrorTag.qml @@ -12,7 +12,7 @@ Item { id: componentUnderTest ErrorTag { anchors.centerIn: parent - text: "Insufficient funds to pay gas fees" + text: "Not enough ETH to pay gas fees" } } @@ -49,7 +49,7 @@ Item { verify(!!controlUnderTest) waitForRendering(controlUnderTest) const origWidth = controlUnderTest.width - controlUnderTest.buttonText = "Buy crypto" + controlUnderTest.buttonText = "Add assets" controlUnderTest.buttonVisible = true waitForRendering(controlUnderTest) const widthWithButton = controlUnderTest.width @@ -61,7 +61,7 @@ Item { function test_buttonClick() { verify(!!controlUnderTest) - controlUnderTest.buttonText = "Buy crypto" + controlUnderTest.buttonText = "Add assets" controlUnderTest.buttonVisible = true const button = findChild(controlUnderTest, "rightComponentButton") verify(!!button) diff --git a/storybook/qmlTests/tests/tst_SwapModal.qml b/storybook/qmlTests/tests/tst_SwapModal.qml index d7b45f1866..ef0a41ef98 100644 --- a/storybook/qmlTests/tests/tst_SwapModal.qml +++ b/storybook/qmlTests/tests/tst_SwapModal.qml @@ -684,7 +684,7 @@ Item { compare(root.swapAdaptor.swapOutputData.approvalNeeded, false) compare(root.swapAdaptor.swapOutputData.hasError, true) verify(errorTag.visible) - verify(errorTag.text, qsTr("Insufficient funds to pay gas fees")) + verify(errorTag.text, qsTr("Not enough ETH to pay gas fees")) verify(!signButton.interactive) compare(signButton.text, qsTr("Swap")) @@ -1314,7 +1314,7 @@ Item { let errortext = amountEnteredGreaterThanMaxBalance ? qsTr("Insufficient funds for swap"): qsTr("An error has occured, please try again") compare(errorTag.visible, amountEnteredGreaterThanMaxBalance) compare(errorTag.text, root.swapAdaptor.errorMessage) - compare(errorTag.buttonText, root.swapAdaptor.isTokenBalanceInsufficient ? qsTr("Buy crypto") : qsTr("Buy ETH")) + compare(errorTag.buttonText, root.swapAdaptor.isTokenBalanceInsufficient ? qsTr("Add assets") : qsTr("Add ETH")) compare(errorTag.buttonVisible, amountEnteredGreaterThanMaxBalance) } diff --git a/ui/app/AppLayouts/Wallet/WalletLayout.qml b/ui/app/AppLayouts/Wallet/WalletLayout.qml index 7857e5e62a..a6b278ee79 100644 --- a/ui/app/AppLayouts/Wallet/WalletLayout.qml +++ b/ui/app/AppLayouts/Wallet/WalletLayout.qml @@ -367,7 +367,6 @@ Item { onLaunchBuyCryptoModal: { d.buyFormData.selectedWalletAddress = d.getSelectedOrFirstNonWatchedAddress() d.buyFormData.selectedNetworkChainId = StatusQUtils.ModelUtils.getByKey(RootStore.filteredFlatModel, "layer", 1, "chainId") - d.buyFormData.selectedTokenKey = Constants.ethToken if(!!walletStore.currentViewedHoldingTokensKey && walletStore.currentViewedHoldingType === Constants.TokenType.ERC20) { d.buyFormData.selectedTokenKey = walletStore.currentViewedHoldingTokensKey } diff --git a/ui/app/AppLayouts/Wallet/popups/buy/BuyCryptoModal.qml b/ui/app/AppLayouts/Wallet/popups/buy/BuyCryptoModal.qml index 88b94a7bbe..769725f81b 100644 --- a/ui/app/AppLayouts/Wallet/popups/buy/BuyCryptoModal.qml +++ b/ui/app/AppLayouts/Wallet/popups/buy/BuyCryptoModal.qml @@ -88,7 +88,7 @@ StatusStackModal { readonly property ModelEntry selectedTokenEntry: ModelEntry { sourceModel: root.plainTokensBySymbolModel key: "key" - value: root.buyCryptoInputParamsForm.selectedTokenKey + value: root.buyCryptoInputParamsForm.selectedTokenKey || Constants.ethToken } readonly property ModelEntry selectedProviderEntry: ModelEntry { @@ -140,7 +140,7 @@ StatusStackModal { width: 560 height: 515 padding: Theme.xlPadding - stackTitle: qsTr("Buy assets for %1").arg(!!d.selectedAccountEntry.item ? d.selectedAccountEntry.item.name: "") + stackTitle: !!root.buyCryptoInputParamsForm.selectedTokenKey ? qsTr("Ways to buy %1 for %2").arg(d.selectedTokenEntry.item.name).arg(!!d.selectedAccountEntry.item ? d.selectedAccountEntry.item.name: ""): qsTr("Ways to buy assets for %1").arg(!!d.selectedAccountEntry.item ? d.selectedAccountEntry.item.name: "") rightButtons: [d.buyButton, finishButton] finishButton: StatusButton { text: qsTr("Done") diff --git a/ui/app/AppLayouts/Wallet/popups/swap/SwapModal.qml b/ui/app/AppLayouts/Wallet/popups/swap/SwapModal.qml index 12ac1ea1fa..f78e34d05d 100644 --- a/ui/app/AppLayouts/Wallet/popups/swap/SwapModal.qml +++ b/ui/app/AppLayouts/Wallet/popups/swap/SwapModal.qml @@ -310,13 +310,15 @@ StatusDialog { Layout.alignment: Qt.AlignHCenter Layout.topMargin: Theme.smallPadding text: root.swapAdaptor.errorMessage - buttonText: root.swapAdaptor.isTokenBalanceInsufficient ? qsTr("Buy crypto") : qsTr("Buy ETH") + buttonText: root.swapAdaptor.isTokenBalanceInsufficient ? qsTr("Add assets") : qsTr("Add ETH") buttonVisible: visible && (root.swapAdaptor.isTokenBalanceInsufficient || root.swapAdaptor.isEthBalanceInsufficient) onButtonClicked: { // value dont update correctly if not done from here d.buyFormData.selectedWalletAddress = root.swapInputParamsForm.selectedAccountAddress d.buyFormData.selectedNetworkChainId = root.swapInputParamsForm.selectedNetworkChainId - d.buyFormData.selectedTokenKey =root.swapInputParamsForm.fromTokensKey + d.buyFormData.selectedTokenKey = root.swapAdaptor.isTokenBalanceInsufficient ? + root.swapInputParamsForm.fromTokensKey : + Constants.ethToken Global.openBuyCryptoModalRequested(d.buyFormData) } } diff --git a/ui/app/AppLayouts/Wallet/popups/swap/SwapModalAdaptor.qml b/ui/app/AppLayouts/Wallet/popups/swap/SwapModalAdaptor.qml index c1f5321cff..b54fe7e549 100644 --- a/ui/app/AppLayouts/Wallet/popups/swap/SwapModalAdaptor.qml +++ b/ui/app/AppLayouts/Wallet/popups/swap/SwapModalAdaptor.qml @@ -178,7 +178,7 @@ QObject { if (isBalanceInsufficientForSwap) { return qsTr("Insufficient funds for swap") } else if (isBalanceInsufficientForFees) { - return qsTr("Insufficient funds to pay gas fees") + return qsTr("Not enough ETH to pay gas fees") } else if (root.swapOutputData.hasError) { // TOOD #15874: Unify with WalletUtils router error code handling switch (root.swapOutputData.errCode) {