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
|
2023-01-08 22:23:51 +00:00
|
|
|
|
property var amountToSend
|
|
|
|
|
property var requiredGasInEth
|
2022-07-01 11:24:32 +00:00
|
|
|
|
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) {}
|
2023-01-08 22:23:51 +00:00
|
|
|
|
property var getCryptoCurrencyAmount: function(cryptoValue) {}
|
2022-10-17 10:17:25 +00:00
|
|
|
|
property bool interactive: true
|
2022-12-09 09:10:05 +00:00
|
|
|
|
property bool isBridgeTx: false
|
2022-11-25 09:13:02 +00:00
|
|
|
|
property bool showUnpreferredNetworks: preferredToggleButton.checked
|
2022-12-19 13:02:56 +00:00
|
|
|
|
property int errorType: Constants.NoError
|
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-12-14 21:06:14 +00:00
|
|
|
|
asset.color: Theme.palette.directColor1
|
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 {
|
2022-12-01 15:48:44 +00:00
|
|
|
|
id: preferredToggleButton
|
2022-07-01 11:24:32 +00:00
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
|
Layout.preferredHeight: 22
|
2022-12-01 15:48:44 +00:00
|
|
|
|
verticalPadding: -1
|
|
|
|
|
checkable: true
|
2022-07-01 11:24:32 +00:00
|
|
|
|
size: StatusBaseButton.Size.Small
|
2022-12-01 15:48:44 +00:00
|
|
|
|
icon.name: checked ? "show" : "hide"
|
|
|
|
|
icon.height: 16
|
|
|
|
|
icon.width: 16
|
|
|
|
|
text: checked ? qsTr("Hide Unpreferred Networks"): qsTr("Show Unpreferred Networks")
|
|
|
|
|
onToggled: if(!checked) store.addUnpreferredChainsToDisabledChains()
|
2022-12-09 09:10:05 +00:00
|
|
|
|
visible: !isBridgeTx
|
2022-07-01 11:24:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
Loader {
|
|
|
|
|
id: networksLoader
|
|
|
|
|
Layout.topMargin: Style.current.padding
|
|
|
|
|
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
|
2022-11-15 11:22:03 +00:00
|
|
|
|
reCalculateSuggestedRoute: function() {
|
|
|
|
|
root.reCalculateSuggestedRoute()
|
|
|
|
|
}
|
2022-12-01 15:48:44 +00:00
|
|
|
|
showPreferredChains: preferredToggleButton.checked
|
2022-10-17 10:17:25 +00:00
|
|
|
|
bestRoutes: root.bestRoutes
|
|
|
|
|
weiToEth: root.weiToEth
|
2023-01-08 22:23:51 +00:00
|
|
|
|
getCryptoCurrencyAmount: root.getCryptoCurrencyAmount
|
2022-10-17 10:17:25 +00:00
|
|
|
|
interactive: root.interactive
|
2022-12-19 13:02:56 +00:00
|
|
|
|
errorType: root.errorType
|
|
|
|
|
isLoading: root.isLoading
|
2022-07-01 11:24:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|