feat(Communities): Spectate futured communities

Part of: #7072
This commit is contained in:
Boris Melnik 2022-10-12 15:39:31 +03:00
parent cd5eb42c0b
commit 5108f6db2b
3 changed files with 13 additions and 5 deletions

View File

@ -53,8 +53,12 @@ StatusSectionLayout {
readonly property bool searchMode: searcher.text.length > 0
function navigateToCommunity(communityId) {
root.communitiesStore.setActiveCommunity(communityId)
function navigateToCommunity(communityId: string, joined: bool) {
if (joined) {
root.communitiesStore.setActiveCommunity(communityId)
} else {
root.communitiesStore.spectateCommunity(communityId)
}
}
}
@ -161,7 +165,7 @@ StatusSectionLayout {
model: searchModel
searchLayout: d.searchMode
onCardClicked: d.navigateToCommunity(communityId)
onCardClicked: d.navigateToCommunity(communityId, joined)
}
StatusBaseText {

View File

@ -90,6 +90,10 @@ QtObject {
mainModule.setActiveSectionById(communityId);
}
function spectateCommunity(communityId: string) {
communitiesModuleInst.spectateCommunity(communityId, userProfile.name)
}
function setFileListItems(filePaths) {
root.communitiesModuleInst.setFileListItems(filePaths)
}

View File

@ -16,7 +16,7 @@ StatusScrollView {
property var model
property bool searchLayout: false
signal cardClicked(string communityId)
signal cardClicked(communityId: string, joined: bool)
clip: false
@ -65,7 +65,7 @@ StatusScrollView {
popularity: model.popularity
// <out of scope> categories: model.categories
onClicked: root.cardClicked(communityId)
onClicked: root.cardClicked(communityId, model.joined)
}
}