2022-03-23 16:38:23 +01:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
2021-09-28 18:04:06 +03:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-01 18:58:36 +03:00
|
|
|
|
|
|
|
import "views"
|
|
|
|
import "stores"
|
2022-06-21 13:44:20 +02:00
|
|
|
import "popups/community"
|
2020-05-13 13:27:06 -04:00
|
|
|
|
2022-03-23 16:38:23 +01:00
|
|
|
StackLayout {
|
2021-10-22 01:39:53 +03:00
|
|
|
id: root
|
2020-05-27 13:10:50 -04:00
|
|
|
|
2022-01-04 13:06:05 +01:00
|
|
|
property var contactsStore
|
2022-02-22 21:48:57 +01:00
|
|
|
property RootStore rootStore: RootStore {
|
|
|
|
contactsStore: root.contactsStore
|
|
|
|
}
|
2021-11-15 10:15:21 -05:00
|
|
|
|
2022-03-23 16:38:23 +01:00
|
|
|
property alias chatView: chatView
|
2022-05-10 19:04:25 +03:00
|
|
|
signal importCommunityClicked()
|
|
|
|
signal createCommunityClicked()
|
2020-09-23 09:28:20 +02:00
|
|
|
|
2022-03-23 16:38:23 +01:00
|
|
|
clip: true
|
2020-12-11 15:29:46 -05:00
|
|
|
|
2022-06-21 13:44:20 +02:00
|
|
|
Component {
|
|
|
|
id: membershipRequestPopupComponent
|
|
|
|
MembershipRequestsPopup {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
store: root.rootStore
|
|
|
|
communityData: store.mainModuleInst ? store.mainModuleInst.activeSection || {} : {}
|
|
|
|
onClosed: {
|
|
|
|
destroy()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-23 16:38:23 +01:00
|
|
|
ChatView {
|
|
|
|
id: chatView
|
2022-01-04 13:06:05 +01:00
|
|
|
contactsStore: root.contactsStore
|
2022-03-23 16:38:23 +01:00
|
|
|
rootStore: root.rootStore
|
2022-06-21 13:44:20 +02:00
|
|
|
membershipRequestPopup: membershipRequestPopupComponent
|
2022-03-11 19:50:22 +01:00
|
|
|
|
2022-03-23 16:38:23 +01:00
|
|
|
onCommunityInfoButtonClicked: root.currentIndex = 1
|
|
|
|
onCommunityManageButtonClicked: root.currentIndex = 1
|
2022-05-10 19:04:25 +03:00
|
|
|
|
|
|
|
onImportCommunityClicked: {
|
|
|
|
root.importCommunityClicked();
|
|
|
|
}
|
|
|
|
onCreateCommunityClicked: {
|
|
|
|
root.createCommunityClicked();
|
|
|
|
}
|
2021-11-30 15:49:45 +01:00
|
|
|
}
|
|
|
|
|
2022-03-23 16:38:23 +01:00
|
|
|
Loader {
|
|
|
|
active: root.rootStore.chatCommunitySectionModule.isCommunity()
|
2021-07-22 17:53:19 +03:00
|
|
|
|
2022-03-23 16:38:23 +01:00
|
|
|
sourceComponent: CommunitySettingsView {
|
2022-03-09 11:27:32 +01:00
|
|
|
rootStore: root.rootStore
|
2022-06-06 18:23:24 +03:00
|
|
|
hasAddedContacts: root.contactsStore.myContactsModel.count > 0
|
2022-03-23 16:38:23 +01:00
|
|
|
chatCommunitySectionModule: root.rootStore.chatCommunitySectionModule
|
|
|
|
community: root.rootStore.mainModuleInst ? root.rootStore.mainModuleInst.activeSection
|
|
|
|
|| {} : {}
|
|
|
|
|
2022-05-10 19:04:25 +03:00
|
|
|
onBackToCommunityClicked: root.currentIndex = 0
|
2022-03-23 16:38:23 +01:00
|
|
|
|
2022-05-10 19:04:25 +03:00
|
|
|
// TODO: remove me when migration to new settings is done
|
|
|
|
onOpenLegacyPopupClicked: Global.openPopup(Global.communityProfilePopup, {
|
|
|
|
"store": root.rootStore,
|
|
|
|
"community": community,
|
|
|
|
"communitySectionModule": chatCommunitySectionModule
|
|
|
|
})
|
2021-12-14 15:19:55 +01:00
|
|
|
}
|
|
|
|
}
|
2020-05-13 13:27:06 -04:00
|
|
|
}
|