2022-07-01 11:24:32 +00:00
|
|
|
|
import QtQuick 2.13
|
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
|
|
|
|
|
import "../controls"
|
|
|
|
|
|
|
|
|
|
ColumnLayout {
|
2022-10-17 10:17:25 +00:00
|
|
|
|
id: root
|
2022-07-01 11:24:32 +00:00
|
|
|
|
|
|
|
|
|
property var store
|
|
|
|
|
property var selectedAccount
|
|
|
|
|
property double amountToSend: 0
|
|
|
|
|
property double requiredGasInEth: 0
|
|
|
|
|
property bool customMode: false
|
|
|
|
|
property var selectedAsset
|
2022-10-17 10:17:25 +00:00
|
|
|
|
property var bestRoutes
|
|
|
|
|
property bool isLoading: false
|
2022-07-01 11:24:32 +00:00
|
|
|
|
property bool errorMode: networksLoader.item ? networksLoader.item.errorMode : false
|
2022-10-17 10:17:25 +00:00
|
|
|
|
property var weiToEth: function(wei) {}
|
|
|
|
|
property bool interactive: true
|
2022-07-01 11:24:32 +00:00
|
|
|
|
|
2022-10-17 10:17:25 +00:00
|
|
|
|
signal reCalculateSuggestedRoute()
|
2022-07-01 11:24:32 +00:00
|
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
|
spacing: 10
|
|
|
|
|
|
|
|
|
|
StatusRoundIcon {
|
|
|
|
|
Layout.alignment: Qt.AlignTop
|
|
|
|
|
radius: 8
|
2022-08-11 11:55:08 +00:00
|
|
|
|
asset.name: "flash"
|
2022-07-01 11:24:32 +00:00
|
|
|
|
}
|
|
|
|
|
ColumnLayout {
|
|
|
|
|
Layout.alignment: Qt.AlignTop
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
RowLayout {
|
|
|
|
|
Layout.maximumWidth: 410
|
|
|
|
|
StatusBaseText {
|
|
|
|
|
Layout.maximumWidth: 410
|
|
|
|
|
font.pixelSize: 15
|
|
|
|
|
font.weight: Font.Medium
|
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
|
text: qsTr("Networks")
|
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
}
|
|
|
|
|
StatusButton {
|
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
|
Layout.preferredHeight: 22
|
2022-09-13 07:37:09 +00:00
|
|
|
|
verticalPadding: 0
|
2022-07-01 11:24:32 +00:00
|
|
|
|
size: StatusBaseButton.Size.Small
|
|
|
|
|
icon.name: "hide"
|
|
|
|
|
text: qsTr("Show Unpreferred Networks")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
StatusBaseText {
|
|
|
|
|
Layout.maximumWidth: 410
|
|
|
|
|
font.pixelSize: 15
|
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
|
text: qsTr("The networks where the receipient will receive tokens. Amounts calculated automatically for the lowest cost.")
|
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
|
}
|
2022-10-17 10:17:25 +00:00
|
|
|
|
BalanceExceeded {
|
|
|
|
|
id: balanceExceeded
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
|
Layout.topMargin: Style.current.bigPadding
|
|
|
|
|
transferPossible: root.store.disabledChainIdsToList.length > 0 || root.store.disabledChainIdsFromList.length > 0 ? true : root.bestRoutes ? root.bestRoutes.length > 0 : false
|
|
|
|
|
amountToSend: root.amountToSend
|
|
|
|
|
isLoading: root.isLoading
|
|
|
|
|
}
|
2022-07-01 11:24:32 +00:00
|
|
|
|
Loader {
|
|
|
|
|
id: networksLoader
|
|
|
|
|
Layout.topMargin: Style.current.padding
|
2022-10-17 10:17:25 +00:00
|
|
|
|
active: !balanceExceeded.visible
|
2022-07-01 11:24:32 +00:00
|
|
|
|
visible: active
|
|
|
|
|
sourceComponent: NetworkCardsComponent {
|
2022-10-17 10:17:25 +00:00
|
|
|
|
store: root.store
|
|
|
|
|
selectedAccount: root.selectedAccount
|
|
|
|
|
allNetworks: root.store.allNetworks
|
|
|
|
|
amountToSend: root.amountToSend
|
|
|
|
|
customMode: root.customMode
|
|
|
|
|
requiredGasInEth: root.requiredGasInEth
|
|
|
|
|
selectedAsset: root.selectedAsset
|
|
|
|
|
onReCalculateSuggestedRoute: root.reCalculateSuggestedRoute()
|
|
|
|
|
bestRoutes: root.bestRoutes
|
|
|
|
|
weiToEth: root.weiToEth
|
|
|
|
|
interactive: root.interactive
|
2022-07-01 11:24:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|