2020-12-15 16:04:19 +00:00
|
|
|
import QtQuick 2.12
|
2021-03-16 13:07:09 +00:00
|
|
|
import QtQuick.Controls 2.12
|
2021-07-15 11:15:56 +00:00
|
|
|
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2020-12-15 16:04:19 +00:00
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
import "../../panels/communities"
|
|
|
|
|
2021-07-15 11:15:56 +00:00
|
|
|
StatusModal {
|
2021-10-22 20:49:47 +00:00
|
|
|
id: root
|
2021-07-16 12:36:27 +00:00
|
|
|
|
2021-10-22 20:49:47 +00:00
|
|
|
property var store
|
2021-07-16 12:36:27 +00:00
|
|
|
property var community
|
2022-01-19 20:07:02 +00:00
|
|
|
property var contactsStore
|
|
|
|
property bool hasAddedContacts
|
2022-01-18 20:54:14 +00:00
|
|
|
property var communitySectionModule
|
2021-07-16 12:36:27 +00:00
|
|
|
|
2021-03-16 13:07:09 +00:00
|
|
|
onClosed: {
|
2021-09-07 13:37:00 +00:00
|
|
|
while (contentItem.depth > 1) {
|
|
|
|
contentItem.pop()
|
2021-03-16 13:07:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-23 12:46:16 +00:00
|
|
|
headerSettings.title: contentItem.currentItem.headerTitle
|
|
|
|
headerSettings.subTitle: contentItem.currentItem.headerSubtitle || ""
|
|
|
|
headerSettings.asset.name: contentItem.currentItem.headerImageSource || ""
|
|
|
|
headerSettings.asset.isImage: !!contentItem.currentItem.headerImageSource
|
|
|
|
headerSettings.asset.isLetterIdenticon: contentItem.currentItem.headerTitle === root.community.name && !contentItem.currentItem.headerImageSource
|
|
|
|
headerSettings.asset.bgColor: root.community.color
|
2021-02-12 16:32:04 +00:00
|
|
|
|
2021-09-02 14:40:10 +00:00
|
|
|
contentItem: StackView {
|
2021-03-16 13:07:09 +00:00
|
|
|
id: stack
|
|
|
|
initialItem: profileOverview
|
2021-10-22 20:49:47 +00:00
|
|
|
width: root.width
|
2021-09-07 13:37:00 +00:00
|
|
|
implicitHeight: currentItem.implicitHeight || currentItem.height
|
2020-12-16 18:56:48 +00:00
|
|
|
|
2021-03-16 13:07:09 +00:00
|
|
|
pushEnter: Transition { enabled: false }
|
|
|
|
pushExit: Transition { enabled: false }
|
|
|
|
popEnter: Transition { enabled: false }
|
|
|
|
popExit: Transition { enabled: false }
|
2020-12-18 20:15:00 +00:00
|
|
|
|
2021-03-16 13:07:09 +00:00
|
|
|
Component {
|
|
|
|
id: profileOverview
|
2021-10-01 15:58:36 +00:00
|
|
|
CommunityProfilePopupOverviewPanel {
|
2021-07-15 11:15:56 +00:00
|
|
|
width: stack.width
|
|
|
|
|
2021-10-22 20:49:47 +00:00
|
|
|
headerTitle: root.community.name
|
2021-07-15 11:15:56 +00:00
|
|
|
headerSubtitle: {
|
2021-10-22 20:49:47 +00:00
|
|
|
switch(root.community.access) {
|
2022-04-04 11:26:30 +00:00
|
|
|
case Constants.communityChatPublicAccess: return qsTr("Public community");
|
|
|
|
case Constants.communityChatInvitationOnlyAccess: return qsTr("Invitation only community");
|
|
|
|
case Constants.communityChatOnRequestAccess: return qsTr("On request community");
|
|
|
|
default: return qsTr("Unknown community");
|
2020-12-17 13:24:33 +00:00
|
|
|
}
|
|
|
|
}
|
2022-01-05 15:11:26 +00:00
|
|
|
headerImageSource: root.community.image
|
2021-10-22 20:49:47 +00:00
|
|
|
community: root.community
|
2021-07-15 11:15:56 +00:00
|
|
|
|
2021-12-07 20:33:12 +00:00
|
|
|
onTransferOwnershipButtonClicked: Global.openPopup(transferOwnershiproot, {
|
2022-01-19 20:07:02 +00:00
|
|
|
privateKey: communitySectionModule.exportCommunity(root.community.id),
|
2021-11-11 10:45:59 +00:00
|
|
|
store: root.store
|
|
|
|
})
|
2021-08-02 09:39:51 +00:00
|
|
|
onLeaveButtonClicked: {
|
2022-01-18 20:54:14 +00:00
|
|
|
communitySectionModule.leaveCommunity();
|
2021-10-22 20:49:47 +00:00
|
|
|
root.close();
|
2021-08-02 09:39:51 +00:00
|
|
|
}
|
2021-10-21 00:41:54 +00:00
|
|
|
onCopyToClipboard: {
|
2021-10-22 20:49:47 +00:00
|
|
|
root.store.copyToClipboard(link);
|
2021-10-21 00:41:54 +00:00
|
|
|
}
|
2021-07-16 12:36:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
2021-10-22 20:49:47 +00:00
|
|
|
id: transferOwnershiproot
|
2021-07-16 12:36:27 +00:00
|
|
|
TransferOwnershipPopup {
|
2023-06-06 16:45:05 +00:00
|
|
|
destroyOnClose: true
|
2021-07-15 11:15:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: inviteFriendsView
|
2021-10-01 15:58:36 +00:00
|
|
|
CommunityProfilePopupInviteFriendsPanel {
|
2021-07-15 11:15:56 +00:00
|
|
|
width: stack.width
|
2022-04-04 11:26:30 +00:00
|
|
|
headerTitle: qsTr("Invite friends")
|
2021-10-22 20:49:47 +00:00
|
|
|
community: root.community
|
2022-01-19 20:07:02 +00:00
|
|
|
contactsStore: root.contactsStore
|
2022-04-19 10:49:34 +00:00
|
|
|
rootStore: root.store
|
2020-12-16 18:56:48 +00:00
|
|
|
}
|
|
|
|
}
|
2021-03-16 13:07:09 +00:00
|
|
|
}
|
2020-12-18 20:15:00 +00:00
|
|
|
|
2021-07-15 11:15:56 +00:00
|
|
|
leftButtons: [
|
2022-08-02 13:48:07 +00:00
|
|
|
StatusBackButton {
|
2021-07-16 07:53:41 +00:00
|
|
|
id: backButton
|
2021-09-07 13:37:00 +00:00
|
|
|
visible: contentItem.depth > 1
|
2021-07-15 11:15:56 +00:00
|
|
|
height: !visible ? 0 : implicitHeight
|
2021-03-16 13:07:09 +00:00
|
|
|
onClicked: {
|
2021-09-07 13:37:00 +00:00
|
|
|
contentItem.pop()
|
2020-12-16 18:56:48 +00:00
|
|
|
}
|
|
|
|
}
|
2021-07-15 11:15:56 +00:00
|
|
|
]
|
2021-04-20 12:31:36 +00:00
|
|
|
|
2021-07-15 11:15:56 +00:00
|
|
|
rightButtons: [
|
2021-04-20 12:31:36 +00:00
|
|
|
StatusButton {
|
2022-04-04 11:26:30 +00:00
|
|
|
text: qsTr("Invite")
|
2021-10-22 20:49:47 +00:00
|
|
|
visible: root.contentItem.depth > 2
|
2021-07-15 11:15:56 +00:00
|
|
|
height: !visible ? 0 : implicitHeight
|
2022-07-25 15:07:19 +00:00
|
|
|
enabled: root.contentItem.currentItem !== undefined && root.contentItem.currentItem.pubKeys.length > 0
|
2021-04-20 12:31:36 +00:00
|
|
|
onClicked: {
|
2022-07-25 15:07:19 +00:00
|
|
|
root.contentItem.currentItem.sendInvites(root.contentItem.currentItem.pubKeys, "") // NOTE: empty message
|
2021-10-22 20:49:47 +00:00
|
|
|
root.contentItem.pop()
|
2021-04-20 12:31:36 +00:00
|
|
|
}
|
|
|
|
}
|
2021-07-15 11:15:56 +00:00
|
|
|
]
|
2020-12-15 16:04:19 +00:00
|
|
|
}
|
|
|
|
|