feat(MintToken): Created sign mint token transaction popup

New popup created.

Part of #9802.
This commit is contained in:
Noelia 2023-03-21 17:03:11 +01:00 committed by Noelia
parent e751f8c658
commit 6bd8a18d93
2 changed files with 127 additions and 0 deletions

View File

@ -0,0 +1,126 @@
import QtQuick 2.14
import QtQuick.Layouts 1.14
import QtQml.Models 2.14
import StatusQ.Core 0.1
import StatusQ.Controls 0.1
import StatusQ.Components 0.1
import StatusQ.Popups.Dialog 0.1
import StatusQ.Core.Theme 0.1
import utils 1.0
StatusDialog {
id: root
property alias accountName: accountText.text
property alias feeText: feeText.text
property alias isFeeLoading: feeLoading.visible
property string collectibleName
property string networkName
signal signTransactionClicked()
signal cancelClicked()
QtObject {
id: d
property int minTextWidth: 50
}
title: qsTr("Sign transaction - Mint %1 token").arg(root.collectibleName)
implicitWidth: 520 // by design
topPadding: 2 * Style.current.padding // by design
bottomPadding: topPadding
contentItem: ColumnLayout {
id: column
spacing: Style.current.padding
RowLayout {
id: accountRow
Layout.fillWidth: true
StatusBaseText {
Layout.maximumWidth: accountRow.width - accountRow.spacing - accountText.implicitWidth
Layout.minimumWidth: d.minTextWidth
text: qsTr("Account:")
horizontalAlignment: Text.AlignLeft
font.pixelSize: Style.current.primaryTextFontSize
elide: Text.ElideMiddle
}
StatusBaseText {
id: accountText
Layout.fillWidth: true
Layout.minimumWidth: d.minTextWidth
horizontalAlignment: Text.AlignRight
elide: Text.ElideRight
font.pixelSize: Style.current.primaryTextFontSize
}
}
RowLayout {
id: feeRow
Layout.fillWidth: true
StatusBaseText {
Layout.maximumWidth: feeRow.width - feeRow.spacing - (root.isFeeLoading ? feeLoading.implicitWidth : feeText.implicitWidth)
Layout.minimumWidth: d.minTextWidth
text: qsTr("%1 transaction fee:").arg(root.networkName)
horizontalAlignment: Text.AlignLeft
font.pixelSize: Style.current.primaryTextFontSize
elide: Text.ElideMiddle
}
// Filler
Item {
visible: feeLoading.visible
Layout.fillWidth: true
}
StatusDotsLoadingIndicator {
id: feeLoading
}
StatusBaseText {
id: feeText
visible: !feeLoading.visible
Layout.fillWidth: true
Layout.minimumWidth: d.minTextWidth
horizontalAlignment: Text.AlignRight
color: Theme.palette.baseColor1
elide: Text.ElideRight
font.pixelSize: Style.current.primaryTextFontSize
}
}
}
footer: StatusDialogFooter {
spacing: Style.current.padding
rightButtons: ObjectModel {
StatusButton {
text: qsTr("Cancel")
type: StatusBaseButton.Type.Danger
onClicked: {
root.cancelClicked()
root.close()
}
}
StatusButton {
enabled: !root.isFeeLoading
icon.name: "password"
text: qsTr("Sign transaction")
onClicked: {
root.signTransactionClicked()
root.close()
}
}
}
}
}

View File

@ -1,2 +1,3 @@
CreateChannelPopup 1.0 CreateChannelPopup.qml
CommunityTokenPermissionsPopup 1.0 CommunityTokenPermissionsPopup.qml
SignMintTokenTransactionPopup 1.0 SignMintTokenTransactionPopup.qml