2021-02-10 20:37:17 +00:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.3
|
2021-07-19 13:31:59 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
|
2021-02-10 20:37:17 +00:00
|
|
|
import "../../../../imports"
|
|
|
|
|
2021-07-19 13:31:59 +00:00
|
|
|
StatusModal {
|
2021-02-10 20:37:17 +00:00
|
|
|
property int checkedMembership: Constants.communityChatPublicAccess
|
|
|
|
|
|
|
|
id: popup
|
|
|
|
|
2021-07-22 15:03:59 +00:00
|
|
|
//% "Membership requirement"
|
|
|
|
header.title: qsTrId("membership-title")
|
2021-07-19 13:31:59 +00:00
|
|
|
|
|
|
|
ButtonGroup {
|
|
|
|
id: membershipRequirementGroup
|
|
|
|
}
|
|
|
|
|
2021-09-02 14:40:10 +00:00
|
|
|
contentItem: Column {
|
2021-07-19 13:31:59 +00:00
|
|
|
width: popup.width
|
|
|
|
spacing: 8
|
|
|
|
|
|
|
|
Item {
|
2021-02-10 20:37:17 +00:00
|
|
|
width: parent.width
|
2021-07-19 13:31:59 +00:00
|
|
|
height: parent.spacing
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2021-07-22 15:03:59 +00:00
|
|
|
//% "Require approval"
|
|
|
|
title: qsTrId("membership-approval")
|
2021-07-19 13:31:59 +00:00
|
|
|
sensor.onClicked: requestAccessRadio.checked = true
|
|
|
|
components: [
|
|
|
|
StatusRadioButton {
|
|
|
|
id: requestAccessRadio
|
|
|
|
checked: popup.checkedMembership === Constants.communityChatOnRequestAccess
|
|
|
|
ButtonGroup.group: membershipRequirementGroup
|
|
|
|
onCheckedChanged: {
|
|
|
|
if (checked) {
|
|
|
|
popup.checkedMembership = Constants.communityChatOnRequestAccess
|
|
|
|
}
|
2021-02-10 20:37:17 +00:00
|
|
|
}
|
|
|
|
}
|
2021-07-19 13:31:59 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.pixelSize: 13
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
width: parent.width * 0.78
|
2021-07-22 15:03:59 +00:00
|
|
|
//% "Your community is free to join, but new members are required to be approved by the community creator first"
|
|
|
|
text: qsTrId("membership-approval-description")
|
2021-07-19 13:31:59 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 32
|
|
|
|
}
|
|
|
|
|
2021-09-14 06:01:43 +00:00
|
|
|
// TODO: uncomment this when we want to re-enable requiring invite from another member
|
|
|
|
// for community creation
|
|
|
|
// StatusListItem {
|
|
|
|
// anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
// //% "Require invite from another member"
|
|
|
|
// title: qsTrId("membership-invite")
|
|
|
|
// sensor.onClicked: inviteOnlyRadio.checked = true
|
|
|
|
// components: [
|
|
|
|
// StatusRadioButton {
|
|
|
|
// id: inviteOnlyRadio
|
|
|
|
// checked: popup.checkedMembership === Constants.communityChatInvitationOnlyAccess
|
|
|
|
// ButtonGroup.group: membershipRequirementGroup
|
|
|
|
// onCheckedChanged: {
|
|
|
|
// if (checked) {
|
|
|
|
// popup.checkedMembership = Constants.communityChatInvitationOnlyAccess
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// ]
|
|
|
|
// }
|
2021-07-19 13:31:59 +00:00
|
|
|
|
|
|
|
StatusBaseText {
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.pixelSize: 13
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
width: parent.width * 0.78
|
2021-07-22 15:03:59 +00:00
|
|
|
//% "Your community can only be joined by an invitation from existing community members"
|
|
|
|
text: qsTrId("membership-invite-description")
|
2021-07-19 13:31:59 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 32
|
|
|
|
}
|
|
|
|
|
|
|
|
/* TODO: add functionality to configure this setting */
|
|
|
|
/* StatusListItem { */
|
|
|
|
/* anchors.horizontalCenter: parent.horizontalCenter */
|
2021-07-22 15:03:59 +00:00
|
|
|
//% "Require ENS username"
|
|
|
|
/* title: qsTrId("membership-ens") */
|
2021-07-19 13:31:59 +00:00
|
|
|
/* components: [ */
|
|
|
|
/* StatusRadioButton { */
|
|
|
|
/* checked: //... */
|
|
|
|
/* ButtonGroup.group: membershipRequirementGroup */
|
|
|
|
/* onCheckedChanged: { */
|
|
|
|
/* // ... */
|
|
|
|
/* } */
|
|
|
|
/* } */
|
|
|
|
/* ] */
|
|
|
|
/* } */
|
|
|
|
/* StatusBaseText { */
|
|
|
|
/* wrapMode: Text.WordWrap */
|
|
|
|
/* font.pixelSize: 13 */
|
|
|
|
/* color: Theme.palette.baseColor1 */
|
|
|
|
/* width: parent.width * 0.78 */
|
2021-07-22 15:03:59 +00:00
|
|
|
//% "Your community requires an ENS username to be able to join"
|
|
|
|
/* text: qsTrId("membership-ens-description") */
|
2021-07-19 13:31:59 +00:00
|
|
|
/* anchors.left: parent.left */
|
|
|
|
/* anchors.leftMargin: 32 */
|
|
|
|
/* } */
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2021-07-22 15:03:59 +00:00
|
|
|
//% "No requirement"
|
|
|
|
title: qsTrId("membership-free")
|
2021-07-19 13:31:59 +00:00
|
|
|
sensor.onClicked: publicRadio.checked = true
|
|
|
|
components: [
|
|
|
|
StatusRadioButton {
|
|
|
|
id: publicRadio
|
|
|
|
checked: popup.checkedMembership === Constants.communityChatPublicAccess
|
|
|
|
ButtonGroup.group: membershipRequirementGroup
|
|
|
|
onCheckedChanged: {
|
|
|
|
if (checked) {
|
|
|
|
popup.checkedMembership = Constants.communityChatPublicAccess
|
|
|
|
}
|
2021-02-10 20:37:17 +00:00
|
|
|
}
|
|
|
|
}
|
2021-07-19 13:31:59 +00:00
|
|
|
]
|
2021-02-10 20:37:17 +00:00
|
|
|
}
|
|
|
|
|
2021-07-19 13:31:59 +00:00
|
|
|
StatusBaseText {
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.pixelSize: 13
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
width: parent.width * 0.78
|
2021-07-22 15:03:59 +00:00
|
|
|
//% "Your community is free for anyone to join"
|
|
|
|
text: qsTrId("membership-free-description")
|
2021-07-19 13:31:59 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 32
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
width: parent.width
|
|
|
|
height: parent.spacing
|
2021-02-10 20:37:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-19 13:31:59 +00:00
|
|
|
leftButtons: [
|
|
|
|
StatusRoundButton {
|
|
|
|
icon.name: "arrow-right"
|
|
|
|
icon.width: 20
|
|
|
|
icon.height: 16
|
|
|
|
rotation: 180
|
|
|
|
onClicked: popup.close()
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|