refactor(Communities): use `StatusModal` in `TransferOwnershipPopup`

Closes #2889
This commit is contained in:
Pascal Precht 2021-07-16 15:07:38 +02:00 committed by Iuri Matias
parent 4dab6f9239
commit d4e56ab6ef
1 changed files with 63 additions and 57 deletions

View File

@ -1,81 +1,87 @@
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtGraphicalEffects 1.13
import QtQuick.Dialogs 1.3 import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import StatusQ.Popups 0.1
import "../../../../imports" import "../../../../imports"
import "../../../../shared" import "../../../../shared"
import "../../../../shared/status"
ModalPopup { StatusModal {
id: popup
property string privateKey property string privateKey
id: popup header.title: qsTr("Transfer ownership")
height: 504
//% "Transfer ownership"
title: qsTrId("transfer-ownership")
onClosed: { onClosed: {
popup.destroy(); popup.destroy();
} }
Item { content: Item {
anchors.fill: parent width: popup.width
height: Math.max(300, content.height + 32)
Column {
id: content
anchors.top: parent.top
anchors.topMargin: 16
anchors.horizontalCenter: parent.horizontalCenter
Input { width: popup.width - 32
property string elidedPkey: popup.privateKey.substring(0, 15) + "..." + popup.privateKey.substring(popup.privateKey.length - 16) spacing: 16
id: pKeyInput Input {
//% "Community private key" property string elidedPkey: popup.privateKey.substring(0, 15) + "..." + popup.privateKey.substring(popup.privateKey.length - 16)
label: qsTrId("community-key")
text: elidedPkey id: pKeyInput
textField.onFocusChanged: { width: parent.width
if (textField.focus) {
pKeyInput.text = popup.privateKey label: qsTr("Community private key")
} else { text: elidedPkey
pKeyInput.text = elidedPkey textField.onFocusChanged: {
if (textField.focus) {
pKeyInput.text = popup.privateKey
} else {
pKeyInput.text = elidedPkey
}
} }
copyToClipboard: true
textToCopy: popup.privateKey
} }
copyToClipboard: true StatusBaseText {
textToCopy: popup.privateKey id: infoText1
} text: qsTr("You should keep it safe and only share it with people you trust to take ownership of your community")
wrapMode: Text.WordWrap
width: parent.width
font.pixelSize: 13
color: Theme.palette.baseColor1
}
StyledText { StatusBaseText {
id: infoText1 id: infoText2
//% "You should keep it safe and only share it with people you trust to take ownership of your community" text: qsTr("You can also use this key to import your community on another device")
text: qsTrId("you-should-keep-it-safe-and-only-share-it-with-people-you-trust-to-take-ownership-of-your-community") wrapMode: Text.WordWrap
anchors.top: pKeyInput.bottom width: parent.width
wrapMode: Text.WordWrap font.pixelSize: 13
anchors.topMargin: Style.current.padding color: Theme.palette.baseColor1
width: parent.width }
font.pixelSize: 13
color: Style.current.secondaryText
}
StyledText {
id: infoText2
//% "You can also use this key to import your community on another device"
text: qsTrId("you-can-also-use-this-key-to-import-your-community-on-another-device")
anchors.top: infoText1.bottom
wrapMode: Text.WordWrap
anchors.topMargin: Style.current.bigPadding
width: parent.width
font.pixelSize: 13
color: Style.current.secondaryText
} }
} }
footer: StatusRoundButton { leftButtons: [
id: btnBack StatusRoundButton {
anchors.left: parent.left icon.name: "arrow-right"
icon.name: "arrow-right" icon.height: 16
icon.width: 20 icon.width: 20
icon.height: 16 rotation: 180
rotation: 180 onClicked: {
onClicked: { popup.close()
popup.close() }
} }
} ]
} }