diff --git a/ui/app/AppLayouts/Chat/panels/communities/CommunityWelcomeBannerPanel.qml b/ui/app/AppLayouts/Chat/panels/communities/CommunityWelcomeBannerPanel.qml index d401c8956b..16ee6e9544 100644 --- a/ui/app/AppLayouts/Chat/panels/communities/CommunityWelcomeBannerPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/communities/CommunityWelcomeBannerPanel.qml @@ -98,6 +98,7 @@ Rectangle { anchors.bottom: parent.bottom anchors.bottomMargin: Style.current.padding onClicked: openPopup(communityProfilePopup, { + store: rootStore, community: root.activeCommunity }) } diff --git a/ui/app/AppLayouts/Chat/popups/community/CommunityDetailPopup.qml b/ui/app/AppLayouts/Chat/popups/community/CommunityDetailPopup.qml index 0147b1ece0..5b87a44af2 100644 --- a/ui/app/AppLayouts/Chat/popups/community/CommunityDetailPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/community/CommunityDetailPopup.qml @@ -146,7 +146,7 @@ StatusModal { icon.width: 20 rotation: 180 onClicked: { - openroot(communitiesrootComponent) + openPopup(communitiesPopupComponent) root.close() } } diff --git a/ui/app/AppLayouts/Chat/popups/community/CommunityProfilePopup.qml b/ui/app/AppLayouts/Chat/popups/community/CommunityProfilePopup.qml index 52675c200e..41cdfd583e 100644 --- a/ui/app/AppLayouts/Chat/popups/community/CommunityProfilePopup.qml +++ b/ui/app/AppLayouts/Chat/popups/community/CommunityProfilePopup.qml @@ -63,10 +63,11 @@ StatusModal { onNotificationsButtonClicked: { root.store.setCommunityMuted(root.community.id, checked); } - onEditButtonClicked: openroot(editCommunityroot, { + onEditButtonClicked: openPopup(editCommunityPopup, { + store: root.store, community: root.community }) - onTransferOwnershipButtonClicked: openroot(transferOwnershiproot, {privateKey: root.store.exportCommunity()}) + onTransferOwnershipButtonClicked: openPopup(transferOwnershiproot, {privateKey: root.store.exportCommunity()}) onLeaveButtonClicked: { root.store.leaveCommunity(root.community.id); root.close(); diff --git a/ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml b/ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml index cd6fd2f16c..df9b4654b2 100644 --- a/ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/community/CreateCategoryPopup.qml @@ -163,7 +163,7 @@ StatusModal { icon.name: "delete" type: StatusListItem.Type.Danger sensor.onClicked: { - openroot(deleteCategoryConfirmationDialogComponent, { + openPopup(deleteCategoryConfirmationDialogComponent, { //% "Delete %1 category" title: qsTrId("delete--1-category").arg(root.contentItem.categoryName.input.text), //% "Are you sure you want to delete %1 category? Channels inside the category won’t be deleted." diff --git a/ui/app/AppLayouts/Chat/stores/RootStore.qml b/ui/app/AppLayouts/Chat/stores/RootStore.qml index f5d56ddee2..56e338cab0 100644 --- a/ui/app/AppLayouts/Chat/stores/RootStore.qml +++ b/ui/app/AppLayouts/Chat/stores/RootStore.qml @@ -88,8 +88,8 @@ QtObject { chatsModelInst.communities.createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY); } - function editCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY) { - chatsModelInst.communities.editCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY); + function editCommunity(communityId, communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY) { + chatsModelInst.communities.editCommunity(communityId, communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY); } function createCommunityCategory(communityId, categoryName, channels) { diff --git a/ui/app/AppLayouts/Chat/views/CommunityColumnView.qml b/ui/app/AppLayouts/Chat/views/CommunityColumnView.qml index 73fcbf1d32..2246ebd9cc 100644 --- a/ui/app/AppLayouts/Chat/views/CommunityColumnView.qml +++ b/ui/app/AppLayouts/Chat/views/CommunityColumnView.qml @@ -40,6 +40,7 @@ Item { chatInfoButton.icon.color: root.store.chatsModelInst.communities.activeCommunity.communityColor menuButton.visible: root.store.chatsModelInst.communities.activeCommunity.admin && root.store.chatsModelInst.communities.activeCommunity.canManageUsers chatInfoButton.onClicked: openPopup(communityProfilePopup, { + store: root.store, community: root.store.chatsModelInst.communities.activeCommunity }) diff --git a/ui/app/AppLayouts/stores/RootStore.qml b/ui/app/AppLayouts/stores/RootStore.qml index 3150290bc0..baadf9380f 100644 --- a/ui/app/AppLayouts/stores/RootStore.qml +++ b/ui/app/AppLayouts/stores/RootStore.qml @@ -6,4 +6,28 @@ QtObject { property var walletModelInst: walletModel property var profileModelInst: profileModel property MessageStore messageStore: MessageStore { } + + function setCommunityMuted(communityId, checked) { + chatsModelInst.communities.setCommunityMuted(communityId, checked); + } + + function exportCommunity() { + chatsModelInst.communities.exportCommunity(); + } + + function leaveCommunity(communityId) { + chatsModelInst.communities.leaveCommunity(communityId); + } + + function createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY) { + chatsModelInst.communities.createCommunity(communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY); + } + + function editCommunity(communityId, communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY) { + chatsModelInst.communities.editCommunity(communityId, communityName, communityDescription, checkedMembership, ensOnlySwitchChecked, communityColor, communityImage, imageCropperModalaX, imageCropperModalaY, imageCropperModalbX, imageCropperModalbY); + } + + function copyToClipboard(text) { + chatsModelInst.copyToClipboard(text); + } } diff --git a/ui/app/AppMain.qml b/ui/app/AppMain.qml index 4dcfeb4a63..0d12977cf1 100644 --- a/ui/app/AppMain.qml +++ b/ui/app/AppMain.qml @@ -258,6 +258,7 @@ Item { text: qsTrId("view-community") icon.name: "group-chat" onTriggered: openPopup(communityProfilePopup, { + store: appMain.rootStore, community: chatsModel.communities.observedCommunity }) } @@ -267,7 +268,7 @@ Item { //% "Edit Community" text: qsTrId("edit-community") icon.name: "edit" - onTriggered: openPopup(editCommunityPopup, {community: chatsModel.communities.observedCommunity}) + onTriggered: openPopup(editCommunityPopup, {store: appMain.rootStore, community: chatsModel.communities.observedCommunity}) } StatusMenuSeparator {}