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