2021-02-10 20:37:17 +00:00
|
|
|
import QtQuick 2.12
|
2021-07-20 09:50:36 +00:00
|
|
|
import QtQuick.Controls 2.3
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2021-09-28 15:04:06 +00:00
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
2021-02-10 20:37:17 +00:00
|
|
|
|
2021-07-20 09:50:36 +00:00
|
|
|
StatusModal {
|
2021-02-10 20:37:17 +00:00
|
|
|
id: popup
|
2021-10-22 20:49:47 +00:00
|
|
|
property var store
|
2022-01-18 20:54:14 +00:00
|
|
|
property var communitySectionModule
|
2022-06-21 11:44:20 +00:00
|
|
|
property var communityData
|
2021-02-10 20:37:17 +00:00
|
|
|
onOpened: {
|
2021-09-07 13:51:32 +00:00
|
|
|
contentItem.errorText.text = ""
|
2021-02-10 20:37:17 +00:00
|
|
|
}
|
|
|
|
|
2022-04-04 11:26:30 +00:00
|
|
|
header.title: qsTr("Membership requests")
|
2021-09-07 13:51:32 +00:00
|
|
|
header.subTitle: contentItem.membershipRequestList.count
|
2021-02-10 20:37:17 +00:00
|
|
|
|
2021-09-02 14:40:10 +00:00
|
|
|
contentItem: Column {
|
2021-07-20 09:50:36 +00:00
|
|
|
property alias errorText: errorText
|
|
|
|
property alias membershipRequestList: membershipRequestList
|
|
|
|
width: popup.width
|
2021-02-10 20:37:17 +00:00
|
|
|
|
2021-07-20 09:50:36 +00:00
|
|
|
StatusBaseText {
|
2021-02-10 20:37:17 +00:00
|
|
|
id: errorText
|
|
|
|
visible: !!text
|
|
|
|
height: visible ? implicitHeight : 0
|
2021-07-20 09:50:36 +00:00
|
|
|
color: Theme.palette.dangerColor1
|
2021-02-10 20:37:17 +00:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
width: parent.width
|
|
|
|
}
|
|
|
|
|
2021-07-20 09:50:36 +00:00
|
|
|
Item {
|
|
|
|
height: 8
|
|
|
|
width: parent.width
|
|
|
|
}
|
2021-02-10 20:37:17 +00:00
|
|
|
|
2022-07-13 12:29:38 +00:00
|
|
|
StatusScrollView {
|
2021-07-20 09:50:36 +00:00
|
|
|
width: parent.width
|
|
|
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
|
|
|
topPadding: 8
|
|
|
|
bottomPadding: 8
|
|
|
|
height: 300
|
|
|
|
|
2022-07-14 11:03:36 +00:00
|
|
|
StatusListView {
|
2021-07-20 09:50:36 +00:00
|
|
|
id: membershipRequestList
|
2022-08-05 14:22:22 +00:00
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
2022-06-21 11:44:20 +00:00
|
|
|
model: popup.communityData.pendingRequestsToJoin
|
2021-07-20 09:50:36 +00:00
|
|
|
|
|
|
|
delegate: StatusListItem {
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2022-12-01 10:24:25 +00:00
|
|
|
readonly property var contactDetails: Utils.getContactDetailsAsJson(model.pubKey, false)
|
2021-07-20 09:50:36 +00:00
|
|
|
|
2022-12-01 10:24:25 +00:00
|
|
|
readonly property string displayName: contactDetails.displayName || popup.store.generateAlias(model.pubKey)
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.name: contactDetails.thumbnailImage
|
|
|
|
asset.isImage: true
|
2021-07-20 09:50:36 +00:00
|
|
|
title: displayName
|
|
|
|
|
|
|
|
components: [
|
2022-10-20 11:57:41 +00:00
|
|
|
StatusRoundButton {
|
|
|
|
icon.name: "thumbs-up"
|
|
|
|
icon.color: Style.current.white
|
|
|
|
icon.hoverColor: Style.current.white
|
|
|
|
implicitWidth: 28
|
|
|
|
implicitHeight: 28
|
|
|
|
color: Theme.palette.successColor1
|
|
|
|
onClicked: popup.store.acceptRequestToJoinCommunity(id, popup.communityData.id)
|
2021-07-20 09:50:36 +00:00
|
|
|
},
|
2022-10-20 11:57:41 +00:00
|
|
|
StatusRoundButton {
|
|
|
|
icon.name: "thumbs-down"
|
|
|
|
icon.color: Style.current.white
|
|
|
|
icon.hoverColor: Style.current.white
|
|
|
|
implicitWidth: 28
|
|
|
|
implicitHeight: 28
|
|
|
|
color: Theme.palette.dangerColor1
|
|
|
|
onClicked: popup.store.declineRequestToJoinCommunity(id, popup.communityData.id)
|
2021-02-10 20:37:17 +00:00
|
|
|
}
|
2021-07-20 09:50:36 +00:00
|
|
|
]
|
2021-02-10 20:37:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-20 09:50:36 +00:00
|
|
|
leftButtons: [
|
2022-08-02 13:48:07 +00:00
|
|
|
StatusBackButton {
|
2021-07-20 09:50:36 +00:00
|
|
|
onClicked: popup.close()
|
|
|
|
}
|
|
|
|
]
|
2021-02-10 20:37:17 +00:00
|
|
|
}
|