2024-02-08 17:59:53 +01:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2021-07-15 13:15:56 +02:00
|
|
|
|
2024-08-27 16:35:52 +02:00
|
|
|
import StatusQ 0.1
|
2021-07-15 13:15:56 +02:00
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
|
2021-09-28 18:04:06 +03:00
|
|
|
|
|
|
|
import utils 1.0
|
2020-12-15 12:04:19 -04:00
|
|
|
|
2023-06-23 08:17:04 +02:00
|
|
|
import AppLayouts.Communities.panels 1.0
|
2021-10-01 18:58:36 +03:00
|
|
|
|
2021-07-15 13:15:56 +02:00
|
|
|
StatusModal {
|
2021-10-22 23:49:47 +03:00
|
|
|
id: root
|
2021-07-16 14:36:27 +02:00
|
|
|
|
|
|
|
property var community
|
2022-01-19 15:07:02 -05:00
|
|
|
property bool hasAddedContacts
|
2022-01-18 15:54:14 -05:00
|
|
|
property var communitySectionModule
|
2021-07-16 14:36:27 +02:00
|
|
|
|
2021-03-16 14:07:09 +01:00
|
|
|
onClosed: {
|
2021-09-07 15:37:00 +02:00
|
|
|
while (contentItem.depth > 1) {
|
|
|
|
contentItem.pop()
|
2021-03-16 14:07:09 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-23 14:46:16 +02: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 11:32:04 -05:00
|
|
|
|
2021-09-02 17:40:10 +03:00
|
|
|
contentItem: StackView {
|
2021-03-16 14:07:09 +01:00
|
|
|
id: stack
|
|
|
|
initialItem: profileOverview
|
2021-10-22 23:49:47 +03:00
|
|
|
width: root.width
|
2021-09-07 15:37:00 +02:00
|
|
|
implicitHeight: currentItem.implicitHeight || currentItem.height
|
2020-12-16 14:56:48 -04:00
|
|
|
|
2021-03-16 14:07:09 +01:00
|
|
|
pushEnter: Transition { enabled: false }
|
|
|
|
pushExit: Transition { enabled: false }
|
|
|
|
popEnter: Transition { enabled: false }
|
|
|
|
popExit: Transition { enabled: false }
|
2020-12-18 15:15:00 -05:00
|
|
|
|
2021-03-16 14:07:09 +01:00
|
|
|
Component {
|
|
|
|
id: profileOverview
|
2023-06-26 13:48:45 +02:00
|
|
|
ProfilePopupOverviewPanel {
|
2021-07-15 13:15:56 +02:00
|
|
|
width: stack.width
|
|
|
|
|
2021-10-22 23:49:47 +03:00
|
|
|
headerTitle: root.community.name
|
2021-07-15 13:15:56 +02:00
|
|
|
headerSubtitle: {
|
2021-10-22 23:49:47 +03:00
|
|
|
switch(root.community.access) {
|
2022-04-04 13:26:30 +02: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 09:24:33 -04:00
|
|
|
}
|
|
|
|
}
|
2022-01-05 10:11:26 -05:00
|
|
|
headerImageSource: root.community.image
|
2021-10-22 23:49:47 +03:00
|
|
|
community: root.community
|
2021-07-15 13:15:56 +02:00
|
|
|
|
2021-08-02 12:39:51 +03:00
|
|
|
onLeaveButtonClicked: {
|
2021-10-22 23:49:47 +03:00
|
|
|
root.close();
|
2023-06-14 10:42:52 +02:00
|
|
|
root.community.spectated ? communitySectionModule.leaveCommunity()
|
|
|
|
: Global.leaveCommunityRequested(root.community.name, root.community.id, root.community.outroMessage)
|
2021-08-02 12:39:51 +03:00
|
|
|
}
|
2024-08-27 16:35:52 +02:00
|
|
|
onCopyToClipboard: ClipboardUtils.setText(link)
|
2021-07-16 14:36:27 +02:00
|
|
|
}
|
|
|
|
}
|
2021-03-16 14:07:09 +01:00
|
|
|
}
|
2020-12-18 15:15:00 -05:00
|
|
|
|
2021-07-15 13:15:56 +02:00
|
|
|
leftButtons: [
|
2022-08-02 16:48:07 +03:00
|
|
|
StatusBackButton {
|
2021-07-16 09:53:41 +02:00
|
|
|
id: backButton
|
2021-09-07 15:37:00 +02:00
|
|
|
visible: contentItem.depth > 1
|
2021-07-15 13:15:56 +02:00
|
|
|
height: !visible ? 0 : implicitHeight
|
2021-03-16 14:07:09 +01:00
|
|
|
onClicked: {
|
2021-09-07 15:37:00 +02:00
|
|
|
contentItem.pop()
|
2020-12-16 14:56:48 -04:00
|
|
|
}
|
2024-02-08 17:59:53 +01:00
|
|
|
|
|
|
|
Layout.minimumWidth: implicitWidth
|
2020-12-16 14:56:48 -04:00
|
|
|
}
|
2021-07-15 13:15:56 +02:00
|
|
|
]
|
2020-12-15 12:04:19 -04:00
|
|
|
}
|