2022-11-23 17:58:22 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
2023-01-08 22:23:51 +00:00
|
|
|
import shared.stores 1.0
|
|
|
|
|
2022-11-23 17:58:22 +00:00
|
|
|
import "../controls"
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: root
|
|
|
|
|
2023-01-08 22:23:51 +00:00
|
|
|
property var gasFiatAmount
|
2022-11-23 17:58:22 +00:00
|
|
|
property bool isLoading: false
|
|
|
|
property var bestRoutes
|
|
|
|
property var store
|
2023-01-08 22:23:51 +00:00
|
|
|
property var currencyStore: store.currencyStore
|
2024-03-26 11:57:03 +00:00
|
|
|
property var selectedAsset
|
2022-12-19 13:02:56 +00:00
|
|
|
property int errorType: Constants.NoError
|
2022-11-23 17:58:22 +00:00
|
|
|
|
|
|
|
radius: 13
|
|
|
|
color: Theme.palette.indirectColor1
|
2024-02-12 16:44:35 +00:00
|
|
|
implicitHeight: columnLayout.height + feesIcon.height
|
2022-11-23 17:58:22 +00:00
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
id: feesLayout
|
|
|
|
spacing: 10
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.margins: Style.current.padding
|
|
|
|
|
|
|
|
StatusRoundIcon {
|
|
|
|
id: feesIcon
|
|
|
|
Layout.alignment: Qt.AlignTop
|
|
|
|
radius: 8
|
|
|
|
asset.name: "fees"
|
2022-12-14 21:06:14 +00:00
|
|
|
asset.color: Theme.palette.directColor1
|
2022-11-23 17:58:22 +00:00
|
|
|
}
|
|
|
|
Column {
|
2023-09-25 12:39:54 +00:00
|
|
|
id: columnLayout
|
2022-11-23 17:58:22 +00:00
|
|
|
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
|
|
|
|
Layout.preferredWidth: root.width - feesIcon.width - Style.current.xlPadding
|
2023-01-27 13:16:42 +00:00
|
|
|
spacing: isLoading ? 4 : 0
|
2022-11-23 17:58:22 +00:00
|
|
|
Item {
|
|
|
|
width: parent.width
|
|
|
|
height: childrenRect.height
|
|
|
|
StatusBaseText {
|
|
|
|
id: text
|
|
|
|
anchors.left: parent.left
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.weight: Font.Medium
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
text: qsTr("Fees")
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
}
|
|
|
|
StatusBaseText {
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
id: totalFeesAdvanced
|
2023-02-17 12:56:31 +00:00
|
|
|
text: root.isLoading ? "..." : root.currencyStore.formatCurrencyAmount(root.gasFiatAmount, root.currencyStore.currentCurrency)
|
2022-11-23 17:58:22 +00:00
|
|
|
font.pixelSize: 15
|
|
|
|
color: Theme.palette.directColor1
|
2023-08-15 18:21:51 +00:00
|
|
|
visible: !!root.bestRoutes && root.bestRoutes !== undefined && root.bestRoutes.count > 0
|
2022-11-23 17:58:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
GasSelector {
|
|
|
|
id: gasSelector
|
|
|
|
width: parent.width
|
2023-01-08 22:23:51 +00:00
|
|
|
getGasEthValue: root.currencyStore.getGasEthValue
|
|
|
|
getFiatValue: root.currencyStore.getFiatValue
|
2023-02-17 12:56:31 +00:00
|
|
|
formatCurrencyAmount: root.currencyStore.formatCurrencyAmount
|
2023-01-08 22:23:51 +00:00
|
|
|
currentCurrency: root.currencyStore.currentCurrency
|
2022-12-19 13:02:56 +00:00
|
|
|
visible: root.errorType === Constants.NoError && !root.isLoading
|
2022-11-23 17:58:22 +00:00
|
|
|
bestRoutes: root.bestRoutes
|
2024-03-26 11:57:03 +00:00
|
|
|
selectedAsset: root.selectedAsset
|
2023-08-15 18:21:51 +00:00
|
|
|
getNetworkName: root.store.getNetworkName
|
2022-11-23 17:58:22 +00:00
|
|
|
}
|
|
|
|
GasValidator {
|
|
|
|
id: gasValidator
|
|
|
|
width: parent.width
|
|
|
|
isLoading: root.isLoading
|
2022-12-19 13:02:56 +00:00
|
|
|
errorType: root.errorType
|
2022-11-23 17:58:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|