2023-02-28 15:00:10 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
import QtGraphicalEffects 1.15
|
2022-09-27 21:26:26 +00:00
|
|
|
|
2024-08-27 14:35:52 +00:00
|
|
|
import StatusQ 0.1
|
2022-09-27 21:26:26 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
import StatusQ.Popups.Dialog 0.1
|
2023-02-28 15:00:10 +00:00
|
|
|
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
2022-09-27 21:26:26 +00:00
|
|
|
|
|
|
|
import shared.controls 1.0
|
|
|
|
import shared.controls.chat 1.0
|
|
|
|
import shared.controls.chat.menuItems 1.0
|
2024-10-22 12:39:42 +00:00
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.popups 1.0
|
|
|
|
import shared.stores 1.0 as SharedStores
|
2023-02-28 15:00:10 +00:00
|
|
|
import shared.views.profile 1.0
|
2024-10-22 12:39:42 +00:00
|
|
|
import utils 1.0
|
2023-02-28 15:00:10 +00:00
|
|
|
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
2024-06-03 08:57:02 +00:00
|
|
|
import AppLayouts.Profile.helpers 1.0
|
2024-05-22 08:13:39 +00:00
|
|
|
import AppLayouts.Profile.stores 1.0 as ProfileStores
|
|
|
|
import AppLayouts.Wallet.stores 1.0 as WalletStores
|
2022-09-27 21:26:26 +00:00
|
|
|
|
|
|
|
Pane {
|
|
|
|
id: root
|
|
|
|
|
2024-11-21 15:10:58 +00:00
|
|
|
required property ContactDetails contactDetails
|
2023-02-28 15:00:10 +00:00
|
|
|
property bool readOnly // inside settings/profile/preview
|
2022-09-27 21:26:26 +00:00
|
|
|
|
2024-11-21 15:10:58 +00:00
|
|
|
readonly property string publicKey: contactDetails.publicKey
|
2024-03-25 13:29:31 +00:00
|
|
|
readonly property alias isCurrentUser: d.isCurrentUser
|
2022-09-27 21:26:26 +00:00
|
|
|
|
2024-05-22 08:13:39 +00:00
|
|
|
property ProfileStores.ProfileStore profileStore
|
|
|
|
property ProfileStores.ContactsStore contactsStore
|
2024-10-22 12:39:42 +00:00
|
|
|
property SharedStores.UtilsStore utilsStore
|
2024-10-28 23:00:16 +00:00
|
|
|
property WalletStores.RootStore walletStore
|
2024-03-29 11:43:49 +00:00
|
|
|
|
|
|
|
property alias sendToAccountEnabled: showcaseView.sendToAccountEnabled
|
2022-09-27 21:26:26 +00:00
|
|
|
|
2024-03-29 11:43:49 +00:00
|
|
|
property var showcaseCommunitiesModel
|
|
|
|
property var showcaseAccountsModel
|
|
|
|
property var showcaseCollectiblesModel
|
|
|
|
property var showcaseSocialLinksModel
|
|
|
|
property var showcaseAssetsModel
|
2024-03-25 13:29:31 +00:00
|
|
|
|
|
|
|
property alias showcaseMaxVisibility: showcaseView.maxVisibility
|
2024-03-29 11:43:49 +00:00
|
|
|
|
2024-02-15 09:25:40 +00:00
|
|
|
property alias assetsModel: showcaseView.globalAssetsModel
|
|
|
|
property alias collectiblesModel: showcaseView.globalCollectiblesModel
|
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
signal closeRequested()
|
|
|
|
|
|
|
|
padding: 0
|
2024-02-07 09:54:45 +00:00
|
|
|
topPadding: 32
|
2022-09-27 21:26:26 +00:00
|
|
|
|
|
|
|
background: StatusDialogBackground {
|
|
|
|
id: background
|
|
|
|
}
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
|
2024-11-21 15:10:58 +00:00
|
|
|
readonly property bool isCurrentUser: contactDetails.isCurrentUser
|
2022-09-27 21:26:26 +00:00
|
|
|
readonly property string userDisplayName: contactDetails.displayName
|
|
|
|
readonly property string userNickName: contactDetails.localNickname
|
2022-11-08 11:37:25 +00:00
|
|
|
readonly property string prettyEnsName: contactDetails.name
|
2022-12-05 09:56:44 +00:00
|
|
|
readonly property string aliasName: contactDetails.alias
|
|
|
|
readonly property string mainDisplayName: ProfileUtils.displayName(userNickName, prettyEnsName, userDisplayName, aliasName)
|
|
|
|
readonly property string optionalDisplayName: ProfileUtils.displayName("", prettyEnsName, userDisplayName, aliasName)
|
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
readonly property bool isContact: contactDetails.isContact
|
|
|
|
readonly property bool isBlocked: contactDetails.isBlocked
|
|
|
|
|
2023-04-18 15:08:24 +00:00
|
|
|
readonly property int contactRequestState: contactDetails.contactRequestState
|
2022-09-27 21:26:26 +00:00
|
|
|
|
2024-02-26 09:39:08 +00:00
|
|
|
readonly property bool isLocallyTrusted: contactDetails.trustStatus === Constants.trustStatus.trusted
|
2022-09-27 21:26:26 +00:00
|
|
|
|
2023-07-06 11:26:30 +00:00
|
|
|
readonly property string linkToProfile: root.contactsStore.getLinkToProfile(root.publicKey)
|
2024-10-22 12:39:42 +00:00
|
|
|
|
|
|
|
readonly property var emojiHash: root.utilsStore.getEmojiHash(root.publicKey)
|
2024-05-14 08:15:15 +00:00
|
|
|
}
|
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
Component {
|
|
|
|
id: btnEditProfileComponent
|
|
|
|
StatusButton {
|
2022-12-16 18:24:51 +00:00
|
|
|
objectName: "editProfileButton"
|
2022-09-27 21:26:26 +00:00
|
|
|
size: StatusButton.Size.Small
|
|
|
|
text: qsTr("Edit Profile")
|
2024-03-12 15:44:27 +00:00
|
|
|
interactive: !root.readOnly
|
|
|
|
tooltip.text: interactive ? "" : qsTr("Not available in preview mode")
|
2022-09-27 21:26:26 +00:00
|
|
|
onClicked: {
|
|
|
|
Global.changeAppSectionBySectionType(Constants.appSection.profile)
|
|
|
|
root.closeRequested()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: btnSendMessageComponent
|
|
|
|
StatusButton {
|
|
|
|
size: StatusButton.Size.Small
|
|
|
|
text: qsTr("Send Message")
|
2024-06-24 08:36:26 +00:00
|
|
|
objectName: "sendMessageButton"
|
2022-09-27 21:26:26 +00:00
|
|
|
onClicked: {
|
|
|
|
root.contactsStore.joinPrivateChat(root.publicKey)
|
|
|
|
root.closeRequested()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: btnAcceptContactRequestComponent
|
2024-02-29 21:01:33 +00:00
|
|
|
StatusButton {
|
|
|
|
objectName: "profileDialog_reviewContactRequestButton"
|
|
|
|
size: StatusButton.Size.Small
|
|
|
|
text: qsTr("Review contact request")
|
2024-11-06 20:53:41 +00:00
|
|
|
onClicked: Global.openReviewContactRequestPopup(root.publicKey, null)
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: btnSendContactRequestComponent
|
|
|
|
StatusButton {
|
2022-12-26 21:53:47 +00:00
|
|
|
objectName: "profileDialog_sendContactRequestButton"
|
2022-09-27 21:26:26 +00:00
|
|
|
size: StatusButton.Size.Small
|
2024-02-16 11:56:29 +00:00
|
|
|
text: qsTr("Send contact request")
|
2024-11-06 20:53:41 +00:00
|
|
|
onClicked: Global.openContactRequestPopup(root.publicKey, null)
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: btnBlockUserComponent
|
|
|
|
StatusButton {
|
|
|
|
size: StatusButton.Size.Small
|
|
|
|
type: StatusBaseButton.Type.Danger
|
2024-07-18 10:57:24 +00:00
|
|
|
objectName: "blockUserButton"
|
2024-02-20 18:52:07 +00:00
|
|
|
text: qsTr("Block user")
|
2024-11-06 20:53:41 +00:00
|
|
|
onClicked: Global.blockContactRequested(root.publicKey)
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: btnUnblockUserComponent
|
|
|
|
StatusButton {
|
|
|
|
size: StatusButton.Size.Small
|
2024-07-18 10:57:24 +00:00
|
|
|
objectName: "unblockUserProfileButton"
|
2024-02-20 18:52:07 +00:00
|
|
|
text: qsTr("Unblock user")
|
2024-11-06 20:53:41 +00:00
|
|
|
onClicked: Global.unblockContactRequested(root.publicKey)
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: txtPendingContactRequestComponent
|
2024-02-07 14:56:45 +00:00
|
|
|
RowLayout {
|
|
|
|
StatusIcon {
|
|
|
|
icon: "history"
|
|
|
|
width: 16
|
|
|
|
height: width
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
StatusBaseText {
|
|
|
|
font.pixelSize: 13
|
|
|
|
font.weight: Font.Medium
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
2024-02-16 11:56:29 +00:00
|
|
|
text: qsTr("Contact Request Pending")
|
2024-02-07 14:56:45 +00:00
|
|
|
}
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-26 09:39:08 +00:00
|
|
|
Component {
|
|
|
|
id: btnShareProfile
|
|
|
|
StatusFlatButton {
|
2024-05-31 15:40:24 +00:00
|
|
|
objectName: "shareProfileButton"
|
2024-02-26 09:39:08 +00:00
|
|
|
size: StatusButton.Size.Small
|
|
|
|
text: qsTr("Share Profile")
|
|
|
|
onClicked: Global.openPopup(shareProfileCmp)
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
Component {
|
|
|
|
id: shareProfileCmp
|
|
|
|
ShareProfileDialog {
|
|
|
|
destroyOnClose: true
|
2024-05-13 08:05:53 +00:00
|
|
|
title: d.isCurrentUser ? qsTr("Share your profile") : qsTr("%1's profile").arg(StatusQUtils.Emoji.parse(d.mainDisplayName))
|
2024-02-07 14:56:45 +00:00
|
|
|
publicKey: root.publicKey
|
2024-10-22 12:39:42 +00:00
|
|
|
emojiHash: d.emojiHash
|
2024-02-07 14:56:45 +00:00
|
|
|
linkToProfile: d.linkToProfile
|
2024-02-13 14:10:07 +00:00
|
|
|
qrCode: root.profileStore.getQrCodeSource(linkToProfile)
|
|
|
|
displayName: userImage.name
|
|
|
|
largeImage: userImage.image
|
2024-11-06 20:08:22 +00:00
|
|
|
colorId: root.profileStore.colorId
|
2024-02-07 14:56:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
ColumnLayout {
|
|
|
|
id: column
|
|
|
|
spacing: 20
|
|
|
|
anchors {
|
|
|
|
fill: parent
|
2024-10-15 19:26:12 +00:00
|
|
|
leftMargin: Theme.bigPadding
|
|
|
|
rightMargin: Theme.bigPadding
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Layout.fillWidth: true
|
2024-10-15 19:26:12 +00:00
|
|
|
spacing: Theme.halfPadding
|
2022-09-27 21:26:26 +00:00
|
|
|
|
|
|
|
UserImage {
|
2024-02-13 14:10:07 +00:00
|
|
|
id: userImage
|
2022-09-27 21:26:26 +00:00
|
|
|
Layout.alignment: Qt.AlignTop
|
|
|
|
objectName: "ProfileDialog_userImage"
|
2024-11-21 15:10:58 +00:00
|
|
|
name: d.mainDisplayName
|
|
|
|
image: Utils.addTimestampToURL(contactDetails.largeImage)
|
2024-11-06 20:08:22 +00:00
|
|
|
colorId: contactDetails.colorId
|
|
|
|
colorHash: contactDetails.colorHash
|
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
interactive: false
|
2024-02-07 14:56:45 +00:00
|
|
|
imageWidth: 90
|
2022-09-27 21:26:26 +00:00
|
|
|
imageHeight: imageWidth
|
2024-06-03 08:57:02 +00:00
|
|
|
ensVerified: contactDetails.ensVerified
|
2024-02-09 15:52:28 +00:00
|
|
|
|
|
|
|
Binding on onlineStatus {
|
2024-06-03 08:57:02 +00:00
|
|
|
value: contactDetails.onlineStatus
|
2024-02-09 15:52:28 +00:00
|
|
|
when: !d.isCurrentUser
|
|
|
|
}
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
Item { Layout.fillWidth: true }
|
2023-07-25 13:37:04 +00:00
|
|
|
|
2024-02-26 18:54:05 +00:00
|
|
|
// secondary action button
|
2024-02-26 09:39:08 +00:00
|
|
|
Loader {
|
2024-02-07 14:56:45 +00:00
|
|
|
Layout.alignment: Qt.AlignTop
|
|
|
|
Layout.preferredHeight: menuButton.visible ? menuButton.height : -1
|
2024-10-29 18:08:12 +00:00
|
|
|
active: d.isCurrentUser && !root.readOnly
|
|
|
|
sourceComponent: btnShareProfile
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
|
|
|
|
2024-02-26 18:54:05 +00:00
|
|
|
// primary action button
|
2022-09-27 21:26:26 +00:00
|
|
|
Loader {
|
|
|
|
Layout.alignment: Qt.AlignTop
|
|
|
|
Layout.preferredHeight: menuButton.visible ? menuButton.height : -1
|
2024-02-07 14:56:45 +00:00
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
sourceComponent: {
|
|
|
|
// current user
|
|
|
|
if (d.isCurrentUser)
|
|
|
|
return btnEditProfileComponent
|
|
|
|
|
2024-02-20 18:52:07 +00:00
|
|
|
// blocked user
|
2023-04-18 11:43:28 +00:00
|
|
|
if (d.isBlocked)
|
|
|
|
return btnUnblockUserComponent
|
|
|
|
|
2024-02-16 17:34:09 +00:00
|
|
|
// accept incoming CR
|
|
|
|
if (d.contactRequestState === Constants.ContactRequestState.Received)
|
|
|
|
return btnAcceptContactRequestComponent
|
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
// mutual contact
|
|
|
|
if (d.isContact || d.contactRequestState === Constants.ContactRequestState.Mutual)
|
|
|
|
return btnSendMessageComponent
|
|
|
|
|
2023-04-18 15:08:24 +00:00
|
|
|
// depend on contactRequestState
|
|
|
|
switch (d.contactRequestState) {
|
|
|
|
case Constants.ContactRequestState.Sent:
|
2022-09-27 21:26:26 +00:00
|
|
|
return txtPendingContactRequestComponent
|
2023-04-18 15:08:24 +00:00
|
|
|
case Constants.ContactRequestState.Received:
|
2024-02-16 17:34:09 +00:00
|
|
|
break // handled above
|
2023-04-18 15:08:24 +00:00
|
|
|
case Constants.ContactRequestState.None:
|
|
|
|
case Constants.ContactRequestState.Dismissed:
|
2022-09-27 21:26:26 +00:00
|
|
|
return btnSendContactRequestComponent
|
2023-04-18 15:08:24 +00:00
|
|
|
default:
|
|
|
|
console.warn("!!! UNHANDLED CONTACT ACTION BUTTON; PUBKEY", root.publicKey)
|
|
|
|
return null
|
|
|
|
}
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusFlatButton {
|
|
|
|
id: menuButton
|
|
|
|
Layout.alignment: Qt.AlignTop
|
|
|
|
Layout.preferredWidth: height
|
|
|
|
|
|
|
|
visible: !d.isCurrentUser
|
|
|
|
horizontalPadding: 6
|
|
|
|
verticalPadding: 6
|
|
|
|
icon.name: "more"
|
|
|
|
icon.color: Theme.palette.directColor1
|
|
|
|
highlighted: moreMenu.opened
|
|
|
|
onClicked: moreMenu.popup(-moreMenu.width + width, height + 4)
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusMenu {
|
2022-09-27 21:26:26 +00:00
|
|
|
id: moreMenu
|
2023-06-15 10:27:09 +00:00
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
SendContactRequestMenuItem {
|
2023-04-26 09:12:45 +00:00
|
|
|
enabled: !d.isContact && !d.isBlocked && d.contactRequestState !== Constants.ContactRequestState.Sent &&
|
2024-06-03 08:57:02 +00:00
|
|
|
contactDetails.trustStatus === Constants.trustStatus.untrustworthy // we have an action button otherwise
|
2024-11-06 20:53:41 +00:00
|
|
|
onTriggered: Global.openContactRequestPopup(root.publicKey, null)
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2024-10-29 18:08:12 +00:00
|
|
|
text: qsTr("Mark as trusted")
|
2022-09-27 21:26:26 +00:00
|
|
|
icon.name: "checkmark-circle"
|
2024-10-29 18:08:12 +00:00
|
|
|
enabled: d.isContact && !d.isBlocked && !d.isLocallyTrusted
|
2024-11-06 20:53:41 +00:00
|
|
|
onTriggered: Global.openMarkAsIDVerifiedPopup(root.publicKey, null)
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2024-07-18 10:57:24 +00:00
|
|
|
objectName: "addEditNickNameStatusAction"
|
2024-02-07 14:56:45 +00:00
|
|
|
text: d.userNickName ? qsTr("Edit nickname") : qsTr("Add nickname")
|
2022-09-27 21:26:26 +00:00
|
|
|
icon.name: "edit_pencil"
|
2024-11-06 20:53:41 +00:00
|
|
|
onTriggered: Global.openNicknamePopupRequested(root.publicKey, null)
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2024-02-07 14:56:45 +00:00
|
|
|
text: qsTr("Show QR code")
|
|
|
|
icon.name: "qr"
|
|
|
|
enabled: !d.isCurrentUser
|
2024-11-06 20:53:41 +00:00
|
|
|
onTriggered: Global.openPopup(shareProfileCmp)
|
2024-02-07 14:56:45 +00:00
|
|
|
}
|
|
|
|
StatusAction {
|
|
|
|
text: qsTr("Copy link to profile")
|
2022-09-27 21:26:26 +00:00
|
|
|
icon.name: "copy"
|
2024-11-06 20:53:41 +00:00
|
|
|
onTriggered: ClipboardUtils.setText(d.linkToProfile)
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
StatusMenuSeparator {}
|
2024-02-20 18:52:07 +00:00
|
|
|
StatusAction {
|
2024-10-29 18:08:12 +00:00
|
|
|
text: qsTr("Remove trusted mark")
|
2024-02-26 09:39:08 +00:00
|
|
|
icon.name: "delete"
|
2024-02-20 18:52:07 +00:00
|
|
|
type: StatusAction.Type.Danger
|
2024-10-29 18:08:12 +00:00
|
|
|
enabled: d.isContact && d.isLocallyTrusted
|
2024-11-06 20:53:41 +00:00
|
|
|
onTriggered: Global.openRemoveIDVerificationDialog(root.publicKey, null)
|
2024-02-20 18:52:07 +00:00
|
|
|
}
|
2024-02-14 12:52:54 +00:00
|
|
|
StatusAction {
|
|
|
|
text: qsTr("Remove nickname")
|
2024-07-18 10:57:24 +00:00
|
|
|
objectName: "removeNicknameStatusAction"
|
2024-02-14 12:52:54 +00:00
|
|
|
icon.name: "delete"
|
|
|
|
type: StatusAction.Type.Danger
|
2024-06-03 08:57:02 +00:00
|
|
|
enabled: !d.isCurrentUser && !!contactDetails.localNickname
|
2024-02-14 12:52:54 +00:00
|
|
|
onTriggered: root.contactsStore.changeContactNickname(root.publicKey, "", d.optionalDisplayName, true)
|
|
|
|
}
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2024-02-07 14:56:45 +00:00
|
|
|
text: qsTr("Mark as untrusted")
|
2022-09-27 21:26:26 +00:00
|
|
|
icon.name: "warning"
|
2022-12-01 16:58:37 +00:00
|
|
|
type: StatusAction.Type.Danger
|
2024-06-03 08:57:02 +00:00
|
|
|
enabled: contactDetails.trustStatus !== Constants.trustStatus.untrustworthy && !d.isBlocked
|
2024-11-06 20:53:41 +00:00
|
|
|
onTriggered: Global.markAsUntrustedRequested(root.publicKey)
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2024-02-07 14:56:45 +00:00
|
|
|
text: qsTr("Remove untrusted mark")
|
2022-09-27 21:26:26 +00:00
|
|
|
icon.name: "warning"
|
2024-02-07 14:56:45 +00:00
|
|
|
type: StatusAction.Type.Danger
|
2024-06-03 08:57:02 +00:00
|
|
|
enabled: contactDetails.trustStatus === Constants.trustStatus.untrustworthy && !d.isBlocked
|
2024-11-06 20:53:41 +00:00
|
|
|
onTriggered: root.contactsStore.removeTrustStatus(root.publicKey)
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2024-02-07 14:56:45 +00:00
|
|
|
text: qsTr("Remove contact")
|
2022-09-27 21:26:26 +00:00
|
|
|
icon.name: "remove-contact"
|
2022-12-01 16:58:37 +00:00
|
|
|
type: StatusAction.Type.Danger
|
2023-04-18 15:08:24 +00:00
|
|
|
enabled: d.isContact && !d.isBlocked && d.contactRequestState !== Constants.ContactRequestState.Sent
|
2024-11-06 20:53:41 +00:00
|
|
|
onTriggered: Global.removeContactRequested(root.publicKey)
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2024-02-07 14:56:45 +00:00
|
|
|
text: qsTr("Block user")
|
2024-07-18 10:57:24 +00:00
|
|
|
objectName: "blockUserStatusAction"
|
2022-09-27 21:26:26 +00:00
|
|
|
icon.name: "cancel"
|
2022-12-01 16:58:37 +00:00
|
|
|
type: StatusAction.Type.Danger
|
2022-09-27 21:26:26 +00:00
|
|
|
enabled: !d.isBlocked
|
2024-11-06 20:53:41 +00:00
|
|
|
onTriggered: Global.blockContactRequested(root.publicKey)
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-07 14:56:45 +00:00
|
|
|
ColumnLayout {
|
2022-09-27 21:26:26 +00:00
|
|
|
Layout.fillWidth: true
|
2024-02-07 14:56:45 +00:00
|
|
|
spacing: 4
|
|
|
|
Item {
|
|
|
|
id: contactRow
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: childrenRect.height
|
|
|
|
StatusBaseText {
|
|
|
|
id: contactName
|
|
|
|
anchors.left: parent.left
|
|
|
|
width: Math.min(implicitWidth, contactRow.width - verificationIcons.width - verificationIcons.anchors.leftMargin)
|
|
|
|
objectName: "ProfileDialog_displayName"
|
|
|
|
font.bold: true
|
|
|
|
font.pixelSize: 22
|
|
|
|
elide: Text.ElideRight
|
2024-11-21 15:10:58 +00:00
|
|
|
text: StatusQUtils.Emoji.parse(d.mainDisplayName, StatusQUtils.Emoji.size.middle)
|
2024-02-07 14:56:45 +00:00
|
|
|
}
|
|
|
|
StatusContactVerificationIcons {
|
|
|
|
id: verificationIcons
|
|
|
|
anchors.left: contactName.right
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.leftMargin: Theme.halfPadding
|
2024-02-07 14:56:45 +00:00
|
|
|
anchors.verticalCenter: contactName.verticalCenter
|
|
|
|
objectName: "ProfileDialog_userVerificationIcons"
|
|
|
|
visible: !d.isCurrentUser
|
|
|
|
isContact: d.isContact
|
2024-06-03 08:57:02 +00:00
|
|
|
trustIndicator: contactDetails.trustStatus
|
2024-02-07 14:56:45 +00:00
|
|
|
isBlocked: d.isBlocked
|
|
|
|
tiny: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RowLayout {
|
2024-10-15 19:26:12 +00:00
|
|
|
spacing: Theme.halfPadding
|
2024-02-07 14:56:45 +00:00
|
|
|
StatusBaseText {
|
|
|
|
id: contactSecondaryName
|
|
|
|
color: Theme.palette.baseColor1
|
2024-05-13 08:05:53 +00:00
|
|
|
text: StatusQUtils.Emoji.parse(d.optionalDisplayName)
|
2024-02-07 14:56:45 +00:00
|
|
|
visible: !!d.userNickName
|
|
|
|
}
|
|
|
|
Rectangle {
|
|
|
|
Layout.preferredWidth: 4
|
|
|
|
Layout.preferredHeight: 4
|
|
|
|
radius: width/2
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
visible: contactSecondaryName.visible
|
|
|
|
}
|
|
|
|
StatusBaseText {
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
text: Utils.getElidedCompressedPk(root.publicKey)
|
2024-02-16 11:56:29 +00:00
|
|
|
HoverHandler {
|
|
|
|
id: keyHoverHandler
|
|
|
|
}
|
|
|
|
StatusToolTip {
|
2024-10-28 23:00:16 +00:00
|
|
|
text: root.utilsStore.getCompressedPk(root.publicKey)
|
2024-02-16 11:56:29 +00:00
|
|
|
visible: keyHoverHandler.hovered
|
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
}
|
|
|
|
CopyButton {
|
|
|
|
Layout.leftMargin: -4
|
|
|
|
Layout.preferredWidth: 16
|
|
|
|
Layout.preferredHeight: 16
|
2024-10-28 23:00:16 +00:00
|
|
|
textToCopy: root.utilsStore.getCompressedPk(root.publicKey)
|
2024-02-07 14:56:45 +00:00
|
|
|
StatusToolTip {
|
|
|
|
text: qsTr("Copy Chat Key")
|
|
|
|
visible: parent.hovered
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-04-18 22:02:13 +00:00
|
|
|
StatusScrollView {
|
|
|
|
id: bioScrollView
|
2024-02-07 14:56:45 +00:00
|
|
|
Layout.fillWidth: true
|
2024-05-13 08:05:53 +00:00
|
|
|
Layout.preferredHeight: implicitHeight
|
|
|
|
Layout.maximumHeight: 120
|
2024-04-18 22:02:13 +00:00
|
|
|
contentWidth: availableWidth
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.topMargin: Theme.halfPadding
|
2024-04-18 22:02:13 +00:00
|
|
|
padding: 0
|
2024-10-15 19:26:12 +00:00
|
|
|
rightPadding: Theme.padding
|
2024-04-18 22:02:13 +00:00
|
|
|
visible: !!bioText.text
|
|
|
|
StatusBaseText {
|
|
|
|
id: bioText
|
|
|
|
width: bioScrollView.availableWidth
|
|
|
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
2024-11-21 15:10:58 +00:00
|
|
|
text: contactDetails.bio.trim()
|
2024-04-18 22:02:13 +00:00
|
|
|
}
|
2024-02-07 14:56:45 +00:00
|
|
|
}
|
|
|
|
EmojiHash {
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.topMargin: Theme.halfPadding
|
2024-02-07 14:56:45 +00:00
|
|
|
objectName: "ProfileDialog_userEmojiHash"
|
2024-10-22 12:39:42 +00:00
|
|
|
emojiHash: d.emojiHash
|
2024-02-07 14:56:45 +00:00
|
|
|
oneRow: true
|
|
|
|
}
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusScrollView {
|
|
|
|
id: scrollView
|
|
|
|
Layout.fillWidth: true
|
2023-02-28 15:00:10 +00:00
|
|
|
Layout.fillHeight: true
|
2022-09-27 21:26:26 +00:00
|
|
|
Layout.leftMargin: -column.anchors.leftMargin
|
|
|
|
Layout.rightMargin: -column.anchors.rightMargin
|
|
|
|
padding: 0
|
2023-05-31 20:58:23 +00:00
|
|
|
contentWidth: availableWidth
|
2022-09-27 21:26:26 +00:00
|
|
|
|
|
|
|
ColumnLayout {
|
2023-05-31 20:58:23 +00:00
|
|
|
width: scrollView.availableWidth
|
2022-09-27 21:26:26 +00:00
|
|
|
spacing: 20
|
|
|
|
|
|
|
|
StatusTabBar {
|
2023-02-28 15:00:10 +00:00
|
|
|
id: showcaseTabBar
|
2022-09-27 21:26:26 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.leftMargin: column.anchors.leftMargin
|
|
|
|
Layout.rightMargin: column.anchors.rightMargin
|
|
|
|
bottomPadding: -4
|
|
|
|
StatusTabButton {
|
2023-04-19 16:48:57 +00:00
|
|
|
leftPadding: 0
|
2022-09-27 21:26:26 +00:00
|
|
|
width: implicitWidth
|
2023-02-28 15:00:10 +00:00
|
|
|
text: qsTr("Communities")
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
|
|
|
StatusTabButton {
|
|
|
|
width: implicitWidth
|
2023-02-28 15:00:10 +00:00
|
|
|
text: qsTr("Accounts")
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
|
|
|
StatusTabButton {
|
|
|
|
width: implicitWidth
|
2023-02-28 15:00:10 +00:00
|
|
|
text: qsTr("Collectibles")
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
2024-03-04 22:07:09 +00:00
|
|
|
// StatusTabButton {
|
|
|
|
// width: implicitWidth
|
|
|
|
// text: qsTr("Assets")
|
|
|
|
// }
|
2024-02-15 09:25:40 +00:00
|
|
|
StatusTabButton {
|
|
|
|
width: implicitWidth
|
|
|
|
text: qsTr("Web")
|
|
|
|
}
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
|
|
|
|
2023-02-28 15:00:10 +00:00
|
|
|
// Profile Showcase
|
|
|
|
ProfileShowcaseView {
|
2024-03-29 11:43:49 +00:00
|
|
|
id: showcaseView
|
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.topMargin: -column.spacing
|
|
|
|
Layout.preferredHeight: 300
|
|
|
|
|
2023-02-28 15:00:10 +00:00
|
|
|
currentTabIndex: showcaseTabBar.currentIndex
|
2024-11-21 15:10:58 +00:00
|
|
|
mainDisplayName: d.mainDisplayName
|
2023-02-28 15:00:10 +00:00
|
|
|
readOnly: root.readOnly
|
2024-03-14 17:31:38 +00:00
|
|
|
|
2024-03-29 11:43:49 +00:00
|
|
|
communitiesModel: root.showcaseCommunitiesModel
|
|
|
|
accountsModel: root.showcaseAccountsModel
|
|
|
|
collectiblesModel: root.showcaseCollectiblesModel
|
2024-02-15 09:25:40 +00:00
|
|
|
socialLinksModel: root.showcaseSocialLinksModel
|
2024-03-29 11:43:49 +00:00
|
|
|
// assetsModel: root.showcaseAssetsModel
|
2022-09-27 21:26:26 +00:00
|
|
|
|
2024-10-28 23:00:16 +00:00
|
|
|
walletStore: root.walletStore
|
2024-02-27 17:11:03 +00:00
|
|
|
|
2023-02-28 15:00:10 +00:00
|
|
|
onCloseRequested: root.closeRequested()
|
2024-08-27 14:35:52 +00:00
|
|
|
onCopyToClipboard: ClipboardUtils.setText(text)
|
2024-11-05 18:51:17 +00:00
|
|
|
onSendToAccountRequested: {
|
|
|
|
Global.sendToRecipientRequested(recipientAddress)
|
|
|
|
}
|
2022-09-27 21:26:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
layer.enabled: !root.readOnly // profile preview has its own layer.effect
|
|
|
|
layer.effect: OpacityMask {
|
|
|
|
maskSource: Rectangle {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
width: column.width
|
|
|
|
height: column.height
|
|
|
|
radius: background.radius
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|