feat(Communities): Add checking access type in Welcome modal

Part of: #7072
This commit is contained in:
Boris Melnik 2022-10-21 14:27:08 +03:00
parent 34d7d4354b
commit 6175beb40a
2 changed files with 7 additions and 1 deletions

View File

@ -133,6 +133,7 @@ Item {
name: communityData.name
introMessage: communityData.introMessage
imageSrc: communityData.image
accessType: communityData.access
onJoined: root.store.requestToJoinCommunity(communityData.id, root.store.userProfileInst.name)
}

View File

@ -3,6 +3,8 @@ import QtQuick.Controls 2.14
import QtQuick.Layouts 1.1
import QtQml.Models 2.14
import utils 1.0
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
@ -14,6 +16,7 @@ StatusDialog {
property string name
property string introMessage
property int accessType
property url imageSrc
signal joined
@ -23,7 +26,9 @@ StatusDialog {
footer: StatusDialogFooter {
rightButtons: ObjectModel {
StatusButton {
text: qsTr("Join %1").arg(root.name)
text: root.accessType === Constants.communityChatOnRequestAccess
? qsTr("Request to join %1").arg(root.name)
: qsTr("Join %1").arg(root.name)
enabled: checkBox.checked
onClicked: {
root.joined()