fix: remove actions from community member when self

Fixes: #2486.

In the community member managment popup, for the current user, remove the “more actions” menu that allows kicking of the user and viewing of their profile.
This commit is contained in:
Eric Mastro 2021-06-11 16:48:51 +10:00 committed by Iuri Matias
parent 45286e179c
commit c0013a0956
1 changed files with 11 additions and 0 deletions

View File

@ -94,13 +94,23 @@ Item {
} }
StyledText { StyledText {
id: txtUsername
text: !model.userName.endsWith(".eth") && !!contactRow.nickname ? text: !model.userName.endsWith(".eth") && !!contactRow.nickname ?
contactRow.nickname : Utils.removeStatusEns(model.userName) contactRow.nickname : Utils.removeStatusEns(model.userName)
anchors.left: identicon.right anchors.left: identicon.right
anchors.leftMargin: Style.current.smallPadding anchors.leftMargin: Style.current.smallPadding
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 15
}
StyledText {
text: " (" + qsTr("You") + ")"
visible: !moreActionsBtn.visible
anchors.left: txtUsername.right
anchors.leftMargin: Style.current.smallPadding
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: Style.current.smallPadding anchors.rightMargin: Style.current.smallPadding
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: Style.current.secondaryText
font.pixelSize: 15 font.pixelSize: 15
} }
@ -119,6 +129,7 @@ Item {
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: Style.current.padding anchors.rightMargin: Style.current.padding
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
visible: model.pubKey.toLowerCase() !== profileModel.profile.pubKey.toLowerCase()
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: contextMenu.popup(-contextMenu.width + moreActionsBtn.width, moreActionsBtn.height + 4) onClicked: contextMenu.popup(-contextMenu.width + moreActionsBtn.width, moreActionsBtn.height + 4)