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
|
2024-01-24 16:35:53 +00:00
|
|
|
import shared.stores 1.0
|
2022-03-23 10:56:25 +00:00
|
|
|
|
2022-12-07 15:29:37 +00:00
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
2022-03-23 10:56:25 +00:00
|
|
|
import "../panels"
|
2023-06-23 06:17:04 +00:00
|
|
|
import AppLayouts.Communities.popups 1.0
|
|
|
|
import AppLayouts.Communities.panels 1.0
|
2024-03-15 16:03:15 +00:00
|
|
|
import AppLayouts.Profile.stores 1.0
|
2023-07-04 15:11:41 +00:00
|
|
|
import AppLayouts.Wallet.stores 1.0 as WalletStore
|
|
|
|
import AppLayouts.Chat.stores 1.0 as ChatStore
|
2022-03-23 10:56:25 +00:00
|
|
|
|
|
|
|
SettingsContentBase {
|
|
|
|
id: root
|
|
|
|
|
2024-03-15 16:03:15 +00:00
|
|
|
property ProfileSectionStore profileSectionStore
|
2022-03-23 10:56:25 +00:00
|
|
|
property var rootStore
|
2024-01-24 16:35:53 +00:00
|
|
|
required property WalletStore.WalletAssetsStore walletAssetsStore
|
|
|
|
required property CurrenciesStore currencyStore
|
2022-03-23 10:56:25 +00:00
|
|
|
|
|
|
|
clip: true
|
|
|
|
|
|
|
|
titleRowComponentLoader.sourceComponent: StatusButton {
|
|
|
|
text: qsTr("Import community")
|
2022-12-07 15:29:37 +00:00
|
|
|
size: StatusBaseButton.Size.Small
|
2023-06-14 08:42:52 +00:00
|
|
|
onClicked: Global.importCommunityPopupRequested()
|
2022-03-23 10:56:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: rootItem
|
2022-12-07 15:29:37 +00:00
|
|
|
width: root.contentWidth
|
2023-01-24 17:31:20 +00:00
|
|
|
height: childrenRect.height
|
2022-12-07 15:29:37 +00:00
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
id: noCommunitiesLayout
|
|
|
|
anchors.fill: parent
|
2023-06-21 20:37:51 +00:00
|
|
|
visible: !root.profileSectionStore.communitiesList.count
|
2022-12-07 15:29:37 +00:00
|
|
|
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
|
2023-04-26 15:33:24 +00:00
|
|
|
cache: false
|
2022-12-07 15:29:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
2023-06-21 20:37:51 +00:00
|
|
|
Heading {
|
|
|
|
text: qsTr("Owner")
|
|
|
|
visible: panelOwners.count
|
2022-03-23 10:56:25 +00:00
|
|
|
}
|
|
|
|
|
2023-06-21 20:37:51 +00:00
|
|
|
Panel {
|
|
|
|
id: panelOwners
|
|
|
|
filters: ValueFilter {
|
|
|
|
readonly property int role: Constants.memberRole.owner
|
|
|
|
roleName: "memberRole"
|
|
|
|
value: role
|
|
|
|
}
|
|
|
|
}
|
2022-12-07 15:29:37 +00:00
|
|
|
|
2023-07-19 20:07:14 +00:00
|
|
|
Heading {
|
|
|
|
text: qsTr("TokenMaster")
|
|
|
|
visible: panelTokenMasters.count
|
|
|
|
}
|
|
|
|
|
|
|
|
Panel {
|
|
|
|
id: panelTokenMasters
|
|
|
|
filters: ValueFilter {
|
|
|
|
readonly property int role: Constants.memberRole.tokenMaster
|
|
|
|
roleName: "memberRole"
|
|
|
|
value: role
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-21 20:37:51 +00:00
|
|
|
Heading {
|
|
|
|
text: qsTr("Admin")
|
|
|
|
visible: panelAdmins.count
|
|
|
|
}
|
2022-12-07 15:29:37 +00:00
|
|
|
|
2023-06-21 20:37:51 +00:00
|
|
|
Panel {
|
|
|
|
id: panelAdmins
|
|
|
|
filters: ValueFilter {
|
|
|
|
readonly property int role: Constants.memberRole.admin
|
|
|
|
roleName: "memberRole"
|
|
|
|
value: role
|
2022-12-07 15:29:37 +00:00
|
|
|
}
|
2023-06-21 20:37:51 +00:00
|
|
|
}
|
2022-07-25 15:39:09 +00:00
|
|
|
|
2023-06-21 20:37:51 +00:00
|
|
|
Heading {
|
|
|
|
text: qsTr("Member")
|
|
|
|
visible: panelMembers.count
|
|
|
|
}
|
2022-07-25 15:39:09 +00:00
|
|
|
|
2023-06-21 20:37:51 +00:00
|
|
|
Panel {
|
|
|
|
id: panelMembers
|
|
|
|
filters: ExpressionFilter {
|
|
|
|
readonly property int ownerRole: Constants.memberRole.owner
|
|
|
|
readonly property int adminRole: Constants.memberRole.admin
|
2023-07-19 20:07:14 +00:00
|
|
|
readonly property int tokenMasterRole: Constants.memberRole.tokenMaster
|
|
|
|
expression: model.joined && model.memberRole !== ownerRole && model.memberRole !== adminRole && model.memberRole !== tokenMasterRole
|
2023-06-14 08:42:52 +00:00
|
|
|
}
|
2023-06-21 20:37:51 +00:00
|
|
|
}
|
2023-06-14 08:42:52 +00:00
|
|
|
|
2023-06-21 20:37:51 +00:00
|
|
|
Heading {
|
|
|
|
text: qsTr("Pending")
|
|
|
|
visible: panelPendingRequests.count
|
|
|
|
}
|
2022-07-25 15:39:09 +00:00
|
|
|
|
2023-06-21 20:37:51 +00:00
|
|
|
Panel {
|
|
|
|
id: panelPendingRequests
|
2023-06-29 08:47:37 +00:00
|
|
|
filters: ExpressionFilter {
|
|
|
|
expression: model.spectated && !model.joined
|
2022-07-25 15:39:09 +00:00
|
|
|
}
|
2023-06-21 20:37:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-07-25 15:39:09 +00:00
|
|
|
|
2023-06-21 20:37:51 +00:00
|
|
|
component Heading: StatusBaseText {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
}
|
|
|
|
|
|
|
|
component Panel: CommunitiesListPanel {
|
|
|
|
id: panel
|
|
|
|
|
|
|
|
property var filters
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
rootStore: root.rootStore
|
|
|
|
|
|
|
|
model: SortFilterProxyModel {
|
|
|
|
sourceModel: root.profileSectionStore.communitiesList
|
|
|
|
filters: panel.filters
|
|
|
|
}
|
|
|
|
|
|
|
|
onCloseCommunityClicked: {
|
|
|
|
root.profileSectionStore.communitiesProfileModule.leaveCommunity(communityId)
|
|
|
|
}
|
|
|
|
|
|
|
|
onLeaveCommunityClicked: {
|
|
|
|
Global.leaveCommunityRequested(community, communityId, outroMessage)
|
|
|
|
}
|
|
|
|
|
|
|
|
onSetCommunityMutedClicked: {
|
|
|
|
root.profileSectionStore.communitiesProfileModule.setCommunityMuted(communityId, mutedType)
|
|
|
|
}
|
|
|
|
|
|
|
|
onSetActiveCommunityClicked: {
|
|
|
|
rootStore.setActiveCommunity(communityId)
|
|
|
|
}
|
|
|
|
|
|
|
|
onInviteFriends: {
|
|
|
|
Global.openInviteFriendsToCommunityPopup(communityData,
|
|
|
|
root.profileSectionStore.communitiesProfileModule,
|
|
|
|
null)
|
|
|
|
}
|
2024-03-25 17:32:33 +00:00
|
|
|
onShowCommunityMembershipSetupDialog: {
|
2024-03-27 12:48:17 +00:00
|
|
|
Global.communityIntroPopupRequested(communityId, name, introMessage, imageSrc, root.rootStore.isMyCommunityRequestPending(communityId))
|
2023-06-21 20:37:51 +00:00
|
|
|
}
|
|
|
|
onCancelMembershipRequest: {
|
|
|
|
root.rootStore.cancelPendingRequest(communityId)
|
|
|
|
}
|
|
|
|
}
|
2023-06-14 08:42:52 +00:00
|
|
|
}
|