2022-03-07 09:33:38 +00:00
|
|
|
|
import QtQuick 2.13
|
|
|
|
|
|
2022-07-28 20:56:44 +00:00
|
|
|
|
|
2022-03-07 09:33:38 +00:00
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-07-19 13:45:27 +00:00
|
|
|
|
import StatusQ.Core.Utils 0.1
|
2022-07-28 20:56:44 +00:00
|
|
|
|
|
2022-03-07 09:33:38 +00:00
|
|
|
|
import utils 1.0
|
2022-07-28 20:56:44 +00:00
|
|
|
|
import shared.status 1.0
|
|
|
|
|
import shared.popups 1.0
|
|
|
|
|
import shared.controls 1.0
|
2022-03-07 09:33:38 +00:00
|
|
|
|
|
|
|
|
|
import "../../stores"
|
2022-03-10 17:01:17 +00:00
|
|
|
|
import "../../popups"
|
2022-03-07 09:33:38 +00:00
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
id: root
|
|
|
|
|
signal goBack
|
|
|
|
|
|
|
|
|
|
property WalletStore walletStore
|
2022-03-10 17:01:17 +00:00
|
|
|
|
property var emojiPopup
|
2023-04-17 11:36:40 +00:00
|
|
|
|
property var account
|
2022-03-07 09:33:38 +00:00
|
|
|
|
|
|
|
|
|
Column {
|
|
|
|
|
id: column
|
2022-05-07 11:45:15 +00:00
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
|
anchors.rightMargin: Style.current.padding
|
2022-03-07 09:33:38 +00:00
|
|
|
|
|
2022-07-19 13:45:27 +00:00
|
|
|
|
spacing: Style.current.bigPadding
|
|
|
|
|
|
2022-03-10 17:01:17 +00:00
|
|
|
|
Row {
|
2022-03-07 09:33:38 +00:00
|
|
|
|
id: header
|
2022-03-10 17:01:17 +00:00
|
|
|
|
spacing: Style.current.smallPadding
|
2022-03-07 09:33:38 +00:00
|
|
|
|
StatusSmartIdenticon {
|
|
|
|
|
id: accountImage
|
2022-08-10 09:23:06 +00:00
|
|
|
|
objectName: "walletAccountViewAccountImage"
|
2022-03-10 17:01:17 +00:00
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2022-08-11 11:55:08 +00:00
|
|
|
|
asset: StatusAssetSettings {
|
2022-03-10 17:01:17 +00:00
|
|
|
|
width: isLetterIdenticon ? 40 : 20
|
|
|
|
|
height: isLetterIdenticon ? 40 : 20
|
2023-04-17 11:36:40 +00:00
|
|
|
|
color: root.account ? root.account.color : "#ffffff"
|
|
|
|
|
emoji: root.account ? root.account.emoji : ""
|
|
|
|
|
name: root.account && !root.account.emoji ? "filled-account": ""
|
2022-03-10 17:01:17 +00:00
|
|
|
|
letterSize: 14
|
2023-04-17 11:36:40 +00:00
|
|
|
|
isLetterIdenticon: !!root.account && !!root.account.emoji
|
2022-08-11 11:55:08 +00:00
|
|
|
|
bgWidth: 40
|
|
|
|
|
bgHeight: 40
|
|
|
|
|
bgColor: Theme.palette.primaryColor3
|
2022-03-07 09:33:38 +00:00
|
|
|
|
}
|
2022-03-10 17:01:17 +00:00
|
|
|
|
}
|
|
|
|
|
Column {
|
|
|
|
|
spacing: Style.current.halfPadding
|
|
|
|
|
Row {
|
|
|
|
|
spacing: Style.current.halfPadding
|
|
|
|
|
StatusBaseText {
|
2022-08-10 09:23:06 +00:00
|
|
|
|
objectName: "walletAccountViewAccountName"
|
2022-03-10 17:01:17 +00:00
|
|
|
|
id: accountName
|
2023-04-17 11:36:40 +00:00
|
|
|
|
text:root.account ? root.account.name : ""
|
2022-03-10 17:01:17 +00:00
|
|
|
|
font.weight: Font.Bold
|
|
|
|
|
font.pixelSize: 28
|
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
|
}
|
|
|
|
|
StatusFlatRoundButton {
|
2022-08-10 09:23:06 +00:00
|
|
|
|
objectName: "walletAccountViewEditAccountButton"
|
2022-03-10 17:01:17 +00:00
|
|
|
|
width: 28
|
|
|
|
|
height: 28
|
|
|
|
|
anchors.verticalCenter: accountName.verticalCenter
|
|
|
|
|
type: StatusFlatRoundButton.Type.Tertiary
|
|
|
|
|
color: "transparent"
|
|
|
|
|
icon.name: "pencil"
|
|
|
|
|
onClicked: Global.openPopup(renameAccountModalComponent)
|
|
|
|
|
}
|
2022-03-07 09:33:38 +00:00
|
|
|
|
}
|
2022-08-03 12:51:47 +00:00
|
|
|
|
StatusAddressPanel {
|
2023-04-17 11:36:40 +00:00
|
|
|
|
value: root.account ? root.account.address : ""
|
2022-08-03 12:51:47 +00:00
|
|
|
|
|
|
|
|
|
font.weight: Font.Normal
|
|
|
|
|
|
|
|
|
|
showFrame: false
|
|
|
|
|
|
|
|
|
|
onDoCopy: (address) => globalUtils.copyToClipboard(address)
|
2022-03-07 09:33:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2022-07-19 13:45:27 +00:00
|
|
|
|
Flow {
|
2022-03-07 09:33:38 +00:00
|
|
|
|
width: parent.width
|
2022-07-19 13:45:27 +00:00
|
|
|
|
|
|
|
|
|
spacing: Style.current.halfPadding
|
|
|
|
|
|
|
|
|
|
InformationTile {
|
2022-03-07 09:33:38 +00:00
|
|
|
|
id: typeRectangle
|
2022-07-19 13:45:27 +00:00
|
|
|
|
maxWidth: parent.width
|
|
|
|
|
primaryText: qsTr("Type")
|
|
|
|
|
secondaryText: {
|
2023-04-17 11:36:40 +00:00
|
|
|
|
if (!root.account) {
|
|
|
|
|
return ""
|
|
|
|
|
}
|
|
|
|
|
const walletType = root.account.walletType
|
2022-07-19 13:45:27 +00:00
|
|
|
|
if (walletType === "watch") {
|
|
|
|
|
return qsTr("Watch-Only Account")
|
|
|
|
|
} else if (walletType === "generated" || walletType === "") {
|
|
|
|
|
return qsTr("Generated by your Status seed phrase profile")
|
|
|
|
|
} else {
|
|
|
|
|
return qsTr("Imported Account")
|
2022-03-07 09:33:38 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-19 13:45:27 +00:00
|
|
|
|
InformationTile {
|
|
|
|
|
maxWidth: parent.width
|
|
|
|
|
primaryText: qsTr("Storage")
|
|
|
|
|
secondaryText: qsTr("On Device")
|
2022-03-07 09:33:38 +00:00
|
|
|
|
}
|
2022-03-24 09:10:34 +00:00
|
|
|
|
|
2022-07-19 13:45:27 +00:00
|
|
|
|
InformationTile {
|
|
|
|
|
maxWidth: parent.width
|
|
|
|
|
primaryText: qsTr("Derivation Path")
|
2023-04-17 11:36:40 +00:00
|
|
|
|
secondaryText: root.account ? root.account.path : ""
|
|
|
|
|
visible: !!root.account && root.account.path
|
2022-03-07 09:33:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-19 13:45:27 +00:00
|
|
|
|
InformationTile {
|
|
|
|
|
maxWidth: parent.width
|
2023-04-17 11:36:40 +00:00
|
|
|
|
visible:root.account ? root.account.relatedAccounts.count > 0 : false
|
2022-07-19 13:45:27 +00:00
|
|
|
|
primaryText: qsTr("Related Accounts")
|
2023-04-17 11:36:40 +00:00
|
|
|
|
tagsModel: root.account ? root.account.relatedAccounts : []
|
2022-07-19 13:45:27 +00:00
|
|
|
|
tagsDelegate: StatusListItemTag {
|
2022-12-21 13:57:41 +00:00
|
|
|
|
bgColor: model.color
|
|
|
|
|
bgRadius: 6
|
2023-01-18 10:22:46 +00:00
|
|
|
|
height: 22
|
2022-07-19 13:45:27 +00:00
|
|
|
|
closeButtonVisible: false
|
2022-08-11 11:55:08 +00:00
|
|
|
|
asset.emoji: model.emoji
|
|
|
|
|
asset.emojiSize: Emoji.size.verySmall
|
|
|
|
|
asset.isLetterIdenticon: true
|
2022-07-19 13:45:27 +00:00
|
|
|
|
title: model.name
|
|
|
|
|
titleText.font.pixelSize: 12
|
|
|
|
|
titleText.color: Theme.palette.indirectColor1
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-07 09:33:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StatusButton {
|
2022-07-20 08:18:27 +00:00
|
|
|
|
objectName: "deleteAccountButton"
|
2023-04-17 11:36:40 +00:00
|
|
|
|
visible: !!root.account && root.account.walletType !== ""
|
2022-03-07 09:33:38 +00:00
|
|
|
|
text: qsTr("Remove from your profile")
|
|
|
|
|
type: StatusBaseButton.Type.Danger
|
|
|
|
|
|
|
|
|
|
ConfirmationDialog {
|
|
|
|
|
id: confirmationPopup
|
2022-07-20 08:18:27 +00:00
|
|
|
|
confirmButtonObjectName: "confirmDeleteAccountButton"
|
2023-04-17 11:36:40 +00:00
|
|
|
|
header.title: qsTr("Confirm %1 Removal").arg(root.account ? root.account.name : "")
|
2022-03-07 09:33:38 +00:00
|
|
|
|
confirmationText: qsTr("You will not be able to restore viewing access to this account in the future unless you enter this account’s address again.")
|
|
|
|
|
confirmButtonLabel: qsTr("Remove Account")
|
|
|
|
|
onConfirmButtonClicked: {
|
|
|
|
|
confirmationPopup.close();
|
|
|
|
|
root.goBack();
|
2023-04-17 11:36:40 +00:00
|
|
|
|
root.walletStore.deleteAccount(root.account.keyUid, root.account.address);
|
2022-03-07 09:33:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onClicked : {
|
|
|
|
|
confirmationPopup.open()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-10 17:01:17 +00:00
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: renameAccountModalComponent
|
|
|
|
|
RenameAccontModal {
|
2023-04-17 11:36:40 +00:00
|
|
|
|
account: root.account
|
2022-03-10 17:01:17 +00:00
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
onClosed: destroy()
|
|
|
|
|
walletStore: root.walletStore
|
|
|
|
|
emojiPopup: root.emojiPopup
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|