status-desktop/ui/app/AppLayouts/Profile/Sections/Ens/ENSDetails.qml

96 lines
2.5 KiB
QML
Raw Normal View History

2020-08-06 19:45:57 +00:00
import QtQuick 2.14
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.14
import "../../../../../imports"
import "../../../../../shared"
import "../../../../../shared/status/core"
import "../../../../../shared/status"
2020-08-06 19:45:57 +00:00
Item {
property string username: ""
property string walletAddress: "-"
property string key: "-"
2020-08-07 16:27:41 +00:00
signal backBtnClicked();
2020-08-06 19:45:57 +00:00
StyledText {
id: sectionTitle
text: username
anchors.left: parent.left
anchors.leftMargin: 24
anchors.top: parent.top
anchors.topMargin: 24
font.weight: Font.Bold
font.pixelSize: 20
}
Component {
id: loadingImageComponent
StatusLoadingIndicator {}
2020-08-06 19:45:57 +00:00
}
Loader {
id: loadingImg
active: false
sourceComponent: loadingImageComponent
anchors.right: parent.right
anchors.rightMargin: Style.current.padding
anchors.top: parent.top
anchors.topMargin: Style.currentPadding
}
Connections {
target: profileModel.ens
onDetailsObtained: {
if(username != ensName) return;
walletAddressLbl.text = address;
walletAddressLbl.textToCopy = address;
keyLbl.text = pubkey.substring(0, 20) + "..." + pubkey.substring(pubkey.length - 20);
keyLbl.textToCopy = pubkey;
walletAddressLbl.visible = true;
keyLbl.visible = true;
}
onLoading: {
loadingImg.active = isLoading
if(!isLoading) return;
walletAddressLbl.visible = false;
keyLbl.visible = false;
}
}
TextWithLabel {
id: walletAddressLbl
2020-08-26 15:52:26 +00:00
//% "Wallet address"
label: qsTrId("wallet-address")
2020-08-06 19:45:57 +00:00
visible: false
text: ""
textToCopy: ""
anchors.left: parent.left
anchors.leftMargin: 24
anchors.top: sectionTitle.bottom
anchors.topMargin: 24
}
TextWithLabel {
id: keyLbl
visible: false
2020-08-26 15:52:26 +00:00
//% "Key"
label: qsTrId("key")
2020-08-06 19:45:57 +00:00
text: ""
textToCopy: ""
anchors.left: parent.left
anchors.leftMargin: 24
anchors.top: walletAddressLbl.bottom
anchors.topMargin: 24
}
StatusButton {
2020-08-06 19:45:57 +00:00
anchors.bottom: parent.bottom
anchors.bottomMargin: Style.current.padding
anchors.horizontalCenter: parent.horizontalCenter
2020-08-26 15:52:26 +00:00
//% "Back"
text: qsTrId("back")
2020-08-07 16:27:41 +00:00
onClicked: backBtnClicked()
2020-08-06 19:45:57 +00:00
}
}