fix: make gas selector visible in transaction modals

Fixes #2434.  Modals that were affected by this issue were
- RegisterENSModal (for registeing an ens username)
- SetPubKeyModal (for changing the contact code of an already owned ens)
- StatusStickerPackPurchaseModal (for acquiring a sticker pack)
This commit is contained in:
Richard Ramos 2021-07-19 17:57:57 -04:00 committed by Iuri Matias
parent 0def782841
commit 6564bd8497
22 changed files with 77 additions and 47 deletions

View File

@ -8,10 +8,11 @@ import "../../../../../shared/status"
ModalPopup {
id: root
readonly property var asset: JSON.parse(walletModel.getStatusToken())
readonly property var asset: JSON.parse(walletModel.tokensView.getStatusToken())
property string ensUsername: ""
property string ensPrice: "10"
height: 504
//% "Authorize %1 %2"
title: qsTrId("authorize--1--2").arg(Utils.stripTrailingZeros(ensPrice)).arg(asset.symbol)
@ -48,8 +49,8 @@ ModalPopup {
id: stack
height: parent.height
anchors.fill: parent
anchors.leftMargin: Style.current.padding
anchors.rightMargin: Style.current.padding
initialItem: group1
isLastGroup: stack.currentGroup === group4
onGroupActivated: {
root.title = group.headerText
btnNext.text = group.footerText
@ -60,7 +61,7 @@ ModalPopup {
headerText: qsTrId("authorize--1--2").arg(Utils.stripTrailingZeros(root.ensPrice)).arg(root.asset.symbol)
//% "Continue"
footerText: qsTrId("continue")
showBackBtn: false
AccountSelector {
id: selectFromAccount
accounts: walletModel.accountsView.accounts
@ -90,12 +91,14 @@ ModalPopup {
}
GasSelector {
id: gasSelector
visible: false
anchors.top: selectFromAccount.bottom
anchors.topMargin: Style.current.bigPadding * 2
slowestGasPrice: parseFloat(walletModel.gasView.safeLowGasPrice)
fastestGasPrice: parseFloat(walletModel.gasView.fastestGasPrice)
getGasEthValue: walletModel.gasView.getGasEthValue
getFiatValue: walletModel.balanceView.getFiatValue
defaultCurrency: walletModel.balanceView.defaultCurrency
width: stack.width
property var estimateGas: Backpressure.debounce(gasSelector, 600, function() {
if (!(root.ensUsername !== "" && selectFromAccount.selectedAccount)) {
selectedGasLimit = 380000
@ -157,6 +160,23 @@ ModalPopup {
footer: Item {
width: parent.width
height: btnNext.height
StatusRoundButton {
id: btnBack
anchors.left: parent.left
icon.name: "arrow-right"
icon.width: 20
icon.height: 16
rotation: 180
visible: stack.currentGroup.showBackBtn
enabled: stack.currentGroup.isValid || stack.isLastGroup
onClicked: {
if (typeof stack.currentGroup.onBackClicked === "function") {
return stack.currentGroup.onBackClicked()
}
stack.back()
}
}
StatusButton {
id: btnNext

View File

@ -57,6 +57,9 @@ Item {
this.active = false // kill an opened instance
}
sourceComponent: SetPubKeyModal {
onOpened: {
walletModel.gasView.getGasPricePredictions()
}
onClosed: {
transactionDialog.closed()
}

View File

@ -95,7 +95,9 @@ ModalPopup {
}
GasSelector {
id: gasSelector
visible: false
visible: true
anchors.top: selectFromAccount.bottom
anchors.topMargin: Style.current.bigPadding * 2
slowestGasPrice: parseFloat(walletModel.gasView.safeLowGasPrice)
fastestGasPrice: parseFloat(walletModel.gasView.fastestGasPrice)
getGasEthValue: walletModel.gasView.getGasEthValue

View File

@ -33,12 +33,13 @@ Item {
this.active = false // kill an opened instance
}
sourceComponent: RegisterENSModal {
onOpened: {
walletModel.gasView.getGasPricePredictions()
}
onClosed: {
transactionDialog.closed()
}
ensUsername: username
width: 425
height: 425
}
}

View File

@ -4124,12 +4124,12 @@ Assets wont be sent yet.</source>
</message>
<message id="use-suggestions">
<location filename="../shared/GasSelector.qml" line="100"/>
<source>Use suggestionsUse custom</source>
<source>Use suggestions</source>
<translation type="unfinished"></translation>
</message>
<message id="use-custom">
<location filename="../shared/GasSelector.qml" line="100"/>
<source></source>
<source>Use custom</source>
<translation type="unfinished"></translation>
</message>
<message id="low">

View File

@ -4193,12 +4193,12 @@ Assets wont be sent yet.</source>
</message>
<message id="use-suggestions">
<location filename="../shared/GasSelector.qml" line="100"/>
<source>Use suggestionsUse custom</source>
<source>Use suggestions</source>
<translation type="unfinished"/>
</message>
<message id="use-custom">
<location filename="../shared/GasSelector.qml" line="100"/>
<source/>
<source>Use custom</source>
<translation type="unfinished"/>
</message>
<message id="low">

View File

@ -4191,12 +4191,12 @@ Assets wont be sent yet.</source>
</message>
<message id="use-suggestions">
<location filename="../shared/GasSelector.qml" line="100"/>
<source>Use suggestionsUse custom</source>
<source>Use suggestions</source>
<translation type="unfinished"/>
</message>
<message id="use-custom">
<location filename="../shared/GasSelector.qml" line="100"/>
<source/>
<source>Use custom</source>
<translation type="unfinished"/>
</message>
<message id="low">

View File

@ -4377,13 +4377,13 @@ Assets wont be sent yet.</translation>
</message>
<message id="use-suggestions">
<location filename="../shared/GasSelector.qml" line="100"/>
<source>Use suggestionsUse custom</source>
<translation>Use suggestionsUse custom</translation>
<source>Use suggestions</source>
<translation>Use suggestions</translation>
</message>
<message id="use-custom">
<location filename="../shared/GasSelector.qml" line="100"/>
<source/>
<translation>undefined</translation>
<source>Use custom</source>
<translation>Use custom</translation>
</message>
<message id="low">
<location filename="../shared/GasSelector.qml" line="121"/>

View File

@ -4191,12 +4191,12 @@ Assets wont be sent yet.</source>
</message>
<message id="use-suggestions">
<location filename="../shared/GasSelector.qml" line="100"/>
<source>Use suggestionsUse custom</source>
<source>Use suggestions</source>
<translation type="unfinished"/>
</message>
<message id="use-custom">
<location filename="../shared/GasSelector.qml" line="100"/>
<source/>
<source>Use custom</source>
<translation type="unfinished"/>
</message>
<message id="low">

View File

@ -4191,12 +4191,12 @@ Assets wont be sent yet.</source>
</message>
<message id="use-suggestions">
<location filename="../shared/GasSelector.qml" line="100"/>
<source>Use suggestionsUse custom</source>
<source>Use suggestions</source>
<translation type="unfinished"/>
</message>
<message id="use-custom">
<location filename="../shared/GasSelector.qml" line="100"/>
<source/>
<source>Use custom</source>
<translation type="unfinished"/>
</message>
<message id="low">

View File

@ -4183,12 +4183,12 @@ Assets wont be sent yet.</source>
</message>
<message id="use-suggestions">
<location filename="../shared/GasSelector.qml" line="100"/>
<source>Use suggestionsUse custom</source>
<source>Use suggestions</source>
<translation type="unfinished"/>
</message>
<message id="use-custom">
<location filename="../shared/GasSelector.qml" line="100"/>
<source/>
<source>Use custom</source>
<translation type="unfinished"/>
</message>
<message id="low">

View File

@ -4183,12 +4183,12 @@ Assets wont be sent yet.</source>
</message>
<message id="use-suggestions">
<location filename="../shared/GasSelector.qml" line="100"/>
<source>Use suggestionsUse custom</source>
<source>Use suggestions</source>
<translation type="unfinished"/>
</message>
<message id="use-custom">
<location filename="../shared/GasSelector.qml" line="100"/>
<source/>
<source>Use custom</source>
<translation type="unfinished"/>
</message>
<message id="low">

View File

@ -4183,12 +4183,12 @@ Assets wont be sent yet.</source>
</message>
<message id="use-suggestions">
<location filename="../shared/GasSelector.qml" line="100"/>
<source>Use suggestionsUse custom</source>
<source>Use suggestions</source>
<translation type="unfinished"/>
</message>
<message id="use-custom">
<location filename="../shared/GasSelector.qml" line="100"/>
<source/>
<source>Use custom</source>
<translation type="unfinished"/>
</message>
<message id="low">

View File

@ -4191,12 +4191,12 @@ Assets wont be sent yet.</source>
</message>
<message id="use-suggestions">
<location filename="../shared/GasSelector.qml" line="100"/>
<source>Use suggestionsUse custom</source>
<source>Use suggestions</source>
<translation type="unfinished"/>
</message>
<message id="use-custom">
<location filename="../shared/GasSelector.qml" line="100"/>
<source/>
<source>Use custom</source>
<translation type="unfinished"/>
</message>
<message id="low">

View File

@ -4191,12 +4191,12 @@ Assets wont be sent yet.</source>
</message>
<message id="use-suggestions">
<location filename="../shared/GasSelector.qml" line="100"/>
<source>Use suggestionsUse custom</source>
<source>Use suggestions</source>
<translation type="unfinished"/>
</message>
<message id="use-custom">
<location filename="../shared/GasSelector.qml" line="100"/>
<source/>
<source>Use custom</source>
<translation type="unfinished"/>
</message>
<message id="low">

View File

@ -4191,12 +4191,12 @@ Assets wont be sent yet.</source>
</message>
<message id="use-suggestions">
<location filename="../shared/GasSelector.qml" line="100"/>
<source>Use suggestionsUse custom</source>
<source>Use suggestions</source>
<translation type="unfinished"/>
</message>
<message id="use-custom">
<location filename="../shared/GasSelector.qml" line="100"/>
<source/>
<source>Use custom</source>
<translation type="unfinished"/>
</message>
<message id="low">

View File

@ -4191,12 +4191,12 @@ Assets wont be sent yet.</source>
</message>
<message id="use-suggestions">
<location filename="../shared/GasSelector.qml" line="100"/>
<source>Use suggestionsUse custom</source>
<source>Use suggestions</source>
<translation type="unfinished"/>
</message>
<message id="use-custom">
<location filename="../shared/GasSelector.qml" line="100"/>
<source/>
<source>Use custom</source>
<translation type="unfinished"/>
</message>
<message id="low">

View File

@ -4126,12 +4126,12 @@ Assets wont be sent yet.</source>
</message>
<message id="use-suggestions">
<location filename="../shared/GasSelector.qml" line="100"/>
<source>Use suggestionsUse custom</source>
<source>Use suggestions</source>
<translation type="unfinished"/>
</message>
<message id="use-custom">
<location filename="../shared/GasSelector.qml" line="100"/>
<source/>
<source>Use custom</source>
<translation type="unfinished"/>
</message>
<message id="low">

View File

@ -4191,12 +4191,12 @@ Assets wont be sent yet.</source>
</message>
<message id="use-suggestions">
<location filename="../shared/GasSelector.qml" line="100"/>
<source>Use suggestionsUse custom</source>
<source>Use suggestions</source>
<translation type="unfinished"/>
</message>
<message id="use-custom">
<location filename="../shared/GasSelector.qml" line="100"/>
<source/>
<source>Use custom</source>
<translation type="unfinished"/>
</message>
<message id="low">

View File

@ -4191,12 +4191,12 @@ Assets wont be sent yet.</source>
</message>
<message id="use-suggestions">
<location filename="../shared/GasSelector.qml" line="100"/>
<source>Use suggestionsUse custom</source>
<source>Use suggestions</source>
<translation type="unfinished"/>
</message>
<message id="use-custom">
<location filename="../shared/GasSelector.qml" line="100"/>
<source/>
<source>Use custom</source>
<translation type="unfinished"/>
</message>
<message id="low">

View File

@ -95,9 +95,11 @@ Item {
id: buttonAdvanced
anchors.verticalCenter: prioritytext.verticalCenter
anchors.right: parent.right
//% "Use suggestions"
//% "Use custom"
text: advancedMode ? qsTrId("use-suggestions") : qsTrId("use-custom")
text: advancedMode ?
//% "Use suggestions"
qsTrId("use-suggestions") :
//% "Use custom"
qsTrId("use-custom")
flat: true
font.pixelSize: 13
onClicked: advancedMode = !advancedMode

View File

@ -8,7 +8,7 @@ import "../../shared/status"
ModalPopup {
id: root
readonly property var asset: JSON.parse(walletModel.getStatusToken())
readonly property var asset: JSON.parse(walletModel.tokensView.getStatusToken())
property int stickerPackId: -1
property string packPrice
property bool showBackBtn: false
@ -99,7 +99,9 @@ ModalPopup {
}
GasSelector {
id: gasSelector
visible: false
visible: true
anchors.top: selectFromAccount.bottom
anchors.topMargin: Style.current.bigPadding * 2
slowestGasPrice: parseFloat(walletModel.gasView.safeLowGasPrice)
fastestGasPrice: parseFloat(walletModel.gasView.fastestGasPrice)
getGasEthValue: walletModel.gasView.getGasEthValue