2022-03-23 10:56:25 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.status 1.0
|
|
|
|
import shared.popups 1.0
|
|
|
|
|
2022-12-07 15:29:37 +00:00
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
2022-03-23 10:56:25 +00:00
|
|
|
import "../panels"
|
|
|
|
import "../../Chat/popups/community"
|
|
|
|
|
|
|
|
SettingsContentBase {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property var profileSectionStore
|
|
|
|
property var rootStore
|
|
|
|
property var contactStore
|
|
|
|
|
|
|
|
clip: true
|
|
|
|
|
|
|
|
titleRowComponentLoader.sourceComponent: StatusButton {
|
|
|
|
text: qsTr("Import community")
|
2022-12-07 15:29:37 +00:00
|
|
|
size: StatusBaseButton.Size.Small
|
2022-03-23 10:56:25 +00:00
|
|
|
onClicked: {
|
|
|
|
Global.openPopup(importCommunitiesPopupComponent)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: rootItem
|
|
|
|
height: childrenRect.height
|
2022-12-07 15:29:37 +00:00
|
|
|
width: root.contentWidth
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
id: noCommunitiesLayout
|
|
|
|
anchors.fill: parent
|
|
|
|
visible: communitiesList.count === 0
|
|
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
|
|
|
|
|
|
|
Image {
|
|
|
|
source: Style.png("settings/communities")
|
|
|
|
mipmap: true
|
|
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
|
|
|
Layout.preferredWidth: 434
|
|
|
|
Layout.preferredHeight: 213
|
|
|
|
Layout.topMargin: 18
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
text: qsTr("Discover your Communities")
|
|
|
|
color: Theme.palette.directColor1
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.weight: Font.Bold
|
|
|
|
font.pixelSize: 17
|
|
|
|
Layout.topMargin: 35
|
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
text: qsTr("Explore and see what communities are trending")
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.pixelSize: 15
|
|
|
|
Layout.topMargin: 8
|
|
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusButton {
|
|
|
|
text: qsTr("Discover")
|
|
|
|
Layout.topMargin: 16
|
|
|
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
|
|
|
onClicked: Global.changeAppSectionBySectionType(Constants.appSection.communitiesPortal)
|
|
|
|
}
|
|
|
|
}
|
2022-03-23 10:56:25 +00:00
|
|
|
|
|
|
|
Column {
|
|
|
|
id: rootLayout
|
2022-12-07 15:29:37 +00:00
|
|
|
visible: !noCommunitiesLayout.visible
|
2022-03-23 10:56:25 +00:00
|
|
|
width: parent.width
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.left: parent.left
|
2022-09-15 15:49:13 +00:00
|
|
|
spacing: Style.current.padding
|
2022-03-23 10:56:25 +00:00
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
text: qsTr("Communities you've joined")
|
|
|
|
}
|
|
|
|
|
|
|
|
CommunitiesListPanel {
|
2022-12-07 15:29:37 +00:00
|
|
|
id: communitiesList
|
2022-03-23 10:56:25 +00:00
|
|
|
width: parent.width
|
2022-12-07 15:29:37 +00:00
|
|
|
|
|
|
|
model: SortFilterProxyModel {
|
|
|
|
id: filteredModel
|
|
|
|
|
|
|
|
sourceModel: root.profileSectionStore.communitiesList
|
|
|
|
filters: [
|
|
|
|
ValueFilter {
|
|
|
|
roleName: "joined"
|
|
|
|
value: true
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2022-07-25 15:39:09 +00:00
|
|
|
|
2022-06-21 14:08:24 +00:00
|
|
|
onLeaveCommunityClicked: {
|
2022-07-25 15:39:09 +00:00
|
|
|
root.profileSectionStore.communitiesProfileModule.leaveCommunity(communityId)
|
|
|
|
}
|
|
|
|
|
|
|
|
onSetCommunityMutedClicked: {
|
|
|
|
root.profileSectionStore.communitiesProfileModule.setCommunityMuted(communityId, muted)
|
2022-06-21 14:08:24 +00:00
|
|
|
}
|
2022-07-25 15:39:09 +00:00
|
|
|
|
|
|
|
onSetActiveCommunityClicked: {
|
|
|
|
rootStore.setActiveCommunity(communityId)
|
|
|
|
}
|
|
|
|
|
2022-03-23 10:56:25 +00:00
|
|
|
onInviteFriends: {
|
2022-09-28 21:07:18 +00:00
|
|
|
Global.openInviteFriendsToCommunityPopup(communityData,
|
2022-10-25 17:15:44 +00:00
|
|
|
root.profileSectionStore.communitiesProfileModule,
|
|
|
|
null)
|
2022-03-23 10:56:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // Column
|
|
|
|
} // Item
|
|
|
|
|
|
|
|
property Component importCommunitiesPopupComponent: ImportCommunityPopup {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
store: root.profileSectionStore
|
|
|
|
onClosed: {
|
|
|
|
destroy()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // ScrollView
|