chore(commonuty/popups): remove needless CommunityProfilePopup features
CommunityProfilePopup is deprecated and will be removed. Members list and notifications are already covered by new community settings.
This commit is contained in:
parent
62183cf60b
commit
4a4cee7da7
|
@ -1,216 +0,0 @@
|
||||||
import QtQuick 2.13
|
|
||||||
import QtQuick.Controls 2.13
|
|
||||||
import QtQuick.Layouts 1.13
|
|
||||||
|
|
||||||
import StatusQ.Core 0.1
|
|
||||||
import StatusQ.Core.Theme 0.1
|
|
||||||
import StatusQ.Components 0.1
|
|
||||||
import StatusQ.Controls 0.1
|
|
||||||
import StatusQ.Popups 0.1
|
|
||||||
|
|
||||||
import utils 1.0
|
|
||||||
import shared 1.0
|
|
||||||
import shared.popups 1.0
|
|
||||||
|
|
||||||
import "../../popups"
|
|
||||||
import "../../popups/community"
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
implicitHeight: childrenRect.height
|
|
||||||
implicitWidth: 480
|
|
||||||
|
|
||||||
property string headerTitle: ""
|
|
||||||
property string headerSubtitle: ""
|
|
||||||
property string headerImageSource: ""
|
|
||||||
property alias members: memberList.model
|
|
||||||
property var community
|
|
||||||
property var store
|
|
||||||
property var communitySectionModule
|
|
||||||
|
|
||||||
signal inviteButtonClicked()
|
|
||||||
|
|
||||||
Column {
|
|
||||||
|
|
||||||
id: memberSearchAndInviteButton
|
|
||||||
|
|
||||||
StatusInput {
|
|
||||||
id: memberSearch
|
|
||||||
input.placeholderText: qsTr("Member name")
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusListItem {
|
|
||||||
id: inviteButton
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
visible: root.community.amISectionAdmin
|
|
||||||
//% "Invite People"
|
|
||||||
title: qsTrId("invite-people")
|
|
||||||
icon.name: "share-ios"
|
|
||||||
type: StatusListItem.Type.Secondary
|
|
||||||
sensor.onClicked: root.inviteButtonClicked()
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusModalDivider {
|
|
||||||
visible: inviteButton.visible && memberRequestsButton.visible
|
|
||||||
topPadding: 8
|
|
||||||
bottomPadding: 8
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusContactRequestsIndicatorListItem {
|
|
||||||
|
|
||||||
id: memberRequestsButton
|
|
||||||
|
|
||||||
property int nbRequests: root.community.pendingRequestsToJoin.count
|
|
||||||
width: parent.width - 32
|
|
||||||
visible: root.community.amISectionAdmin && nbRequests > 0
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
//% "Membership requests"
|
|
||||||
title: qsTrId("membership-requests")
|
|
||||||
requestsCount: nbRequests
|
|
||||||
sensor.onClicked: Global.openPopup(membershipRequestPopup, {
|
|
||||||
communitySectionModule: root.communitySectionModule
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusModalDivider {
|
|
||||||
topPadding: !memberRequestsButton.visible && !inviteButton.visible ? 0 : 8
|
|
||||||
bottomPadding: 8
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollView {
|
|
||||||
id: scrollView
|
|
||||||
width: parent.width
|
|
||||||
height: 300
|
|
||||||
anchors.top: memberSearchAndInviteButton.bottom
|
|
||||||
|
|
||||||
contentHeight: Math.max(300, memberListColumn.height)
|
|
||||||
bottomPadding: 8
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: 300
|
|
||||||
visible: memberList.count === 0
|
|
||||||
|
|
||||||
StatusBaseText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
//% "Community members will appear here"
|
|
||||||
text: qsTrId("community-members-will-appear-here")
|
|
||||||
font.pixelSize: 15
|
|
||||||
color: Theme.palette.baseColor1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: 300
|
|
||||||
visible: !!memberSearch.input.text && !!memberList.count && !memberListColumn.height
|
|
||||||
|
|
||||||
StatusBaseText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
//% "No contacts found"
|
|
||||||
text: qsTrId("no-contacts-found")
|
|
||||||
font.pixelSize: 15
|
|
||||||
color: Theme.palette.baseColor1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: memberListColumn
|
|
||||||
width: parent.width
|
|
||||||
visible: memberList.count > 0 || height > 0
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
id: memberList
|
|
||||||
model: root.community.members
|
|
||||||
delegate: StatusListItem {
|
|
||||||
id: memberItem
|
|
||||||
|
|
||||||
visible: !!!memberSearch.input.text ||
|
|
||||||
model.name.toLowerCase().includes(memberSearch.input.text.toLowerCase())
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
image.source: model.icon
|
|
||||||
|
|
||||||
title: {
|
|
||||||
if (menuButton.visible) {
|
|
||||||
return !model.name.endsWith(".eth") ?
|
|
||||||
model.name : Utils.removeStatusEns(model.name)
|
|
||||||
}
|
|
||||||
//% "You"
|
|
||||||
return qsTrId("You")
|
|
||||||
}
|
|
||||||
|
|
||||||
components: [
|
|
||||||
StatusFlatRoundButton {
|
|
||||||
id: menuButton
|
|
||||||
width: 32
|
|
||||||
height: 32
|
|
||||||
visible: model.id.toLowerCase() !== userProfile.pubKey.toLowerCase()
|
|
||||||
icon.name: "more"
|
|
||||||
type: StatusFlatRoundButton.Type.Secondary
|
|
||||||
onClicked: {
|
|
||||||
highlighted = true
|
|
||||||
communityMemberContextMenu.popup(-communityMemberContextMenu.width+menuButton.width, menuButton.height + 4)
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusPopupMenu {
|
|
||||||
|
|
||||||
id: communityMemberContextMenu
|
|
||||||
|
|
||||||
onClosed: {
|
|
||||||
menuButton.highlighted = false
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusMenuItem {
|
|
||||||
//% "View Profile"
|
|
||||||
text: qsTrId("view-profile")
|
|
||||||
icon.name: "channel"
|
|
||||||
onTriggered: Global.openProfilePopup(model.id)
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusMenuSeparator {
|
|
||||||
visible: root.community.amISectionAdmin
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusMenuItem {
|
|
||||||
//% "Kick"
|
|
||||||
text: qsTrId("kick")
|
|
||||||
icon.name: "arrow-right"
|
|
||||||
iconRotation: 180
|
|
||||||
type: StatusMenuItem.Type.Danger
|
|
||||||
enabled: root.community.amISectionAdmin
|
|
||||||
onTriggered: root.store.removeUserFromCommunity(model.id)
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusMenuItem {
|
|
||||||
//% "Ban"
|
|
||||||
text: qsTrId("ban")
|
|
||||||
icon.name: "cancel"
|
|
||||||
type: StatusMenuItem.Type.Danger
|
|
||||||
enabled: root.community.amISectionAdmin
|
|
||||||
onTriggered: root.store.banUserFromCommunity(model.id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: membershipRequestPopup
|
|
||||||
MembershipRequestsPopup {
|
|
||||||
store: root.store
|
|
||||||
pendingRequestsToJoin: root.community.pendingRequestsToJoin
|
|
||||||
anchors.centerIn: parent
|
|
||||||
onClosed: {
|
|
||||||
destroy()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -18,8 +18,6 @@ Column {
|
||||||
property string headerImageSource: ""
|
property string headerImageSource: ""
|
||||||
property var community
|
property var community
|
||||||
|
|
||||||
signal membersListButtonClicked()
|
|
||||||
signal notificationsButtonClicked(bool checked)
|
|
||||||
signal transferOwnershipButtonClicked()
|
signal transferOwnershipButtonClicked()
|
||||||
signal leaveButtonClicked()
|
signal leaveButtonClicked()
|
||||||
signal copyToClipboard(string link)
|
signal copyToClipboard(string link)
|
||||||
|
@ -65,51 +63,6 @@ Column {
|
||||||
bottomPadding: 8
|
bottomPadding: 8
|
||||||
}
|
}
|
||||||
|
|
||||||
StatusListItem {
|
|
||||||
id: membersListItem
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
property int nbRequests: root.community.pendingRequestsToJoin.count
|
|
||||||
|
|
||||||
//% "Members"
|
|
||||||
title: qsTrId("members-label")
|
|
||||||
icon.name: "group-chat"
|
|
||||||
label: root.community.members.count.toString()
|
|
||||||
sensor.onClicked: root.membersListButtonClicked()
|
|
||||||
|
|
||||||
components: [
|
|
||||||
StatusBadge {
|
|
||||||
visible: !!membersListItem.nbRequests
|
|
||||||
value: membersListItem.nbRequests
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.topMargin: 2
|
|
||||||
},
|
|
||||||
StatusIcon {
|
|
||||||
icon: "chevron-down"
|
|
||||||
rotation: 270
|
|
||||||
color: Theme.palette.baseColor1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusListItem {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
//% "Notifications"
|
|
||||||
title: qsTrId("notifications")
|
|
||||||
icon.name: "notification"
|
|
||||||
components: [
|
|
||||||
StatusSwitch {
|
|
||||||
checked: !root.community.muted
|
|
||||||
onClicked: root.notificationsButtonClicked(!checked)
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusModalDivider {
|
|
||||||
topPadding: 8
|
|
||||||
bottomPadding: 8
|
|
||||||
}
|
|
||||||
|
|
||||||
StatusListItem {
|
StatusListItem {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
visible: root.community.amISectionAdmin
|
visible: root.community.amISectionAdmin
|
||||||
|
|
|
@ -62,8 +62,6 @@ StatusModal {
|
||||||
headerImageSource: root.community.image
|
headerImageSource: root.community.image
|
||||||
community: root.community
|
community: root.community
|
||||||
|
|
||||||
onMembersListButtonClicked: root.contentItem.push(membersList)
|
|
||||||
onNotificationsButtonClicked: root.communitySectionModule.setCommunityMuted(checked)
|
|
||||||
onTransferOwnershipButtonClicked: Global.openPopup(transferOwnershiproot, {
|
onTransferOwnershipButtonClicked: Global.openPopup(transferOwnershiproot, {
|
||||||
privateKey: communitySectionModule.exportCommunity(root.community.id),
|
privateKey: communitySectionModule.exportCommunity(root.community.id),
|
||||||
store: root.store
|
store: root.store
|
||||||
|
@ -88,21 +86,6 @@ StatusModal {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
|
||||||
id: membersList
|
|
||||||
CommunityProfilePopupMembersListPanel {
|
|
||||||
// TODO assign the store on open
|
|
||||||
store: root.store
|
|
||||||
width: stack.width
|
|
||||||
//% "Members"
|
|
||||||
headerTitle: qsTrId("members-label")
|
|
||||||
headerSubtitle: root.community.members.count.toString()
|
|
||||||
community: root.community
|
|
||||||
communitySectionModule: root.communitySectionModule
|
|
||||||
onInviteButtonClicked: root.contentItem.push(inviteFriendsView)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: inviteFriendsView
|
id: inviteFriendsView
|
||||||
CommunityProfilePopupInviteFriendsPanel {
|
CommunityProfilePopupInviteFriendsPanel {
|
||||||
|
|
Loading…
Reference in New Issue