2024-05-13 17:23:01 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2024-05-15 21:22:13 +00:00
|
|
|
import StatusQ.Core.Utils 0.1 as SQUtils
|
2024-05-13 17:23:01 +00:00
|
|
|
import StatusQ.Popups.Dialog 0.1
|
|
|
|
|
2024-05-15 21:22:13 +00:00
|
|
|
import shared.popups.send.controls 1.0
|
|
|
|
|
2024-05-13 17:23:01 +00:00
|
|
|
StatusDialog {
|
|
|
|
id: root
|
|
|
|
|
2024-05-15 21:22:13 +00:00
|
|
|
/* This should be the only property which should be used to input
|
|
|
|
parameters to the modal when being launched from elsewhere */
|
|
|
|
required property SwapInputParamsForm swapInputParamsForm
|
|
|
|
required property SwapModalAdaptor swapAdaptor
|
|
|
|
|
|
|
|
objectName: "swapModal"
|
|
|
|
title: qsTr("Swap")
|
2024-05-13 17:23:01 +00:00
|
|
|
|
|
|
|
bottomPadding: 16
|
|
|
|
padding: 0
|
|
|
|
|
|
|
|
background: StatusDialogBackground {
|
|
|
|
implicitHeight: 846
|
|
|
|
implicitWidth: 556
|
|
|
|
color: Theme.palette.baseColor3
|
|
|
|
}
|
|
|
|
|
2024-05-15 21:22:13 +00:00
|
|
|
header: AccountsModalHeader {
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: -height - 18
|
|
|
|
control.popup.width: 512
|
|
|
|
model: root.swapAdaptor.nonWatchAccounts
|
|
|
|
getNetworkShortNames: root.swapAdaptor.getNetworkShortNames
|
|
|
|
formatCurrencyAmount: root.swapAdaptor.formatCurrencyAmount
|
|
|
|
/* TODO: once the Account Header is reworked we simply should be
|
|
|
|
able to use an index and not this logic of selectedAccount being set */
|
|
|
|
selectedAccount: root.swapAdaptor.getSelectedAccount(root.swapInputParamsForm.selectedAccountIndex)
|
|
|
|
onSelectedIndexChanged: {
|
|
|
|
root.swapInputParamsForm.selectedAccountIndex = selectedIndex
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// This is a temporary placeholder while each of the components are being added.
|
2024-05-13 17:23:01 +00:00
|
|
|
contentItem: Column {
|
|
|
|
spacing: 5
|
|
|
|
StatusBaseText {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2024-05-15 21:22:13 +00:00
|
|
|
text: qsTr("This area is a temporary placeholder")
|
2024-05-13 17:23:01 +00:00
|
|
|
font.bold: true
|
|
|
|
}
|
|
|
|
StatusBaseText {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2024-05-15 21:22:13 +00:00
|
|
|
text: qsTr("Selected network: %1").arg(swapInputParamsForm.selectedNetworkChainId)
|
2024-05-13 17:23:01 +00:00
|
|
|
}
|
|
|
|
StatusBaseText {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2024-05-15 21:22:13 +00:00
|
|
|
text: qsTr("Selected from token: %1").arg(swapInputParamsForm.fromTokensKey)
|
2024-05-13 17:23:01 +00:00
|
|
|
}
|
|
|
|
StatusBaseText {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2024-05-15 21:22:13 +00:00
|
|
|
text: qsTr("from token amount: %1").arg(swapInputParamsForm.fromTokenAmount)
|
2024-05-13 17:23:01 +00:00
|
|
|
}
|
|
|
|
StatusBaseText {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2024-05-15 21:22:13 +00:00
|
|
|
text: qsTr("Selected to token: %1").arg(swapInputParamsForm.toTokenKey)
|
2024-05-13 17:23:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|