2024-05-01 16:15:42 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
import QtQml.Models 2.14
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Popups.Dialog 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
2024-05-06 20:22:43 +00:00
|
|
|
import "PairWCModal"
|
2024-05-01 16:15:42 +00:00
|
|
|
|
|
|
|
StatusDialog {
|
|
|
|
id: root
|
|
|
|
|
2024-05-31 09:34:59 +00:00
|
|
|
objectName: "pairWCModal"
|
|
|
|
|
2024-05-01 16:15:42 +00:00
|
|
|
width: 480
|
|
|
|
implicitHeight: 633
|
|
|
|
|
2024-05-06 20:22:43 +00:00
|
|
|
property bool isPairing: false
|
|
|
|
|
|
|
|
signal pair(string uri)
|
|
|
|
|
2024-05-01 16:15:42 +00:00
|
|
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
|
|
|
|
|
|
|
title: qsTr("Connect a dApp via WalletConnect")
|
|
|
|
|
|
|
|
padding: 20
|
|
|
|
|
|
|
|
contentItem: ColumnLayout {
|
|
|
|
StatusBaseText {
|
|
|
|
text: "WalletConnect URI"
|
|
|
|
}
|
|
|
|
|
|
|
|
WCUriInput {
|
|
|
|
id: uriInput
|
2024-05-06 20:22:43 +00:00
|
|
|
|
|
|
|
onTextChanged: root.isPairing = false
|
2024-05-01 16:15:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Spacer
|
2024-05-06 20:22:43 +00:00
|
|
|
Item { Layout.fillHeight: true }
|
2024-05-01 16:15:42 +00:00
|
|
|
|
|
|
|
StatusLinkText {
|
|
|
|
text: qsTr("How to copy the dApp URI")
|
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
Layout.margins: 18
|
|
|
|
|
|
|
|
normalColor: linkColor
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
console.warn("TODO: open help...")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
footer: StatusDialogFooter {
|
|
|
|
id: footer
|
|
|
|
rightButtons: ObjectModel {
|
|
|
|
StatusButton {
|
|
|
|
height: 44
|
|
|
|
text: qsTr("Done")
|
|
|
|
|
2024-05-06 20:22:43 +00:00
|
|
|
enabled: uriInput.valid && !root.isPairing && uriInput.text.length > 0
|
2024-05-01 16:15:42 +00:00
|
|
|
|
|
|
|
onClicked: root.pair(uriInput.text)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|