diff --git a/storybook/pages/PermissionConflictWarningPanelPage.qml b/storybook/pages/PermissionConflictWarningPanelPage.qml index 2795dcd749..43d32f365d 100644 --- a/storybook/pages/PermissionConflictWarningPanelPage.qml +++ b/storybook/pages/PermissionConflictWarningPanelPage.qml @@ -19,7 +19,7 @@ SplitView { height: conflictPanel.implicitHeight anchors.centerIn: parent - PermissionConflictWarningPanel{ + PermissionConflictWarningPanel { id: conflictPanel anchors.left: parent.left anchors.right: parent.right diff --git a/ui/app/AppLayouts/Chat/panels/communities/HidePermissionPanel.qml b/ui/app/AppLayouts/Chat/panels/communities/HidePermissionPanel.qml new file mode 100644 index 0000000000..e261dfe7ff --- /dev/null +++ b/ui/app/AppLayouts/Chat/panels/communities/HidePermissionPanel.qml @@ -0,0 +1,53 @@ +import QtQuick 2.14 +import QtQuick.Controls 2.14 +import QtQuick.Layouts 1.14 + +import StatusQ.Core 0.1 +import StatusQ.Components 0.1 +import StatusQ.Controls 0.1 +import StatusQ.Core.Theme 0.1 + +import utils 1.0 + +Control { + id: root + + property alias checked: switchItem.checked + + signal toggled + + contentItem: RowLayout { + spacing: Style.current.padding + + StatusRoundIcon { + asset.name: "hide" + } + + ColumnLayout { + Layout.fillWidth: true + + StatusBaseText { + text: qsTr("Hide permission") + color: Theme.palette.directColor1 + font.pixelSize: Style.current.primaryTextFontSize + } + + StatusBaseText { + Layout.fillWidth: true + Layout.fillHeight: true + text: qsTr("Make this permission hidden from members who don’t meet it’s requirements") + color: Theme.palette.baseColor1 + font.pixelSize: Style.current.primaryTextFontSize + lineHeight: 1.2 + wrapMode: Text.WordWrap + elide: Text.ElideRight + } + } + + StatusSwitch { + id: switchItem + + onToggled: root.toggled() + } + } +} diff --git a/ui/app/AppLayouts/Chat/panels/communities/qmldir b/ui/app/AppLayouts/Chat/panels/communities/qmldir index 4ec43f9490..105b3070a3 100644 --- a/ui/app/AppLayouts/Chat/panels/communities/qmldir +++ b/ui/app/AppLayouts/Chat/panels/communities/qmldir @@ -1,8 +1,9 @@ +CommunityColumnHeaderPanel 1.0 CommunityColumnHeaderPanel.qml +CommunityMintTokensSettingsPanel 1.0 CommunityMintTokensSettingsPanel.qml CommunityPermissionsSettingsPanel 1.0 CommunityPermissionsSettingsPanel.qml CommunityProfilePopupInviteFriendsPanel 1.0 CommunityProfilePopupInviteFriendsPanel.qml CommunityProfilePopupInviteMessagePanel 1.0 CommunityProfilePopupInviteMessagePanel.qml -PermissionQualificationPanel 1.0 PermissionQualificationPanel.qml -PermissionConflictWarningPanel 1.0 PermissionConflictWarningPanel.qml -CommunityColumnHeaderPanel 1.0 CommunityColumnHeaderPanel.qml +HidePermissionPanel 1.0 HidePermissionPanel.qml JoinPermissionsOverlayPanel 1.0 JoinPermissionsOverlayPanel.qml -CommunityMintTokensSettingsPanel 1.0 CommunityMintTokensSettingsPanel.qml +PermissionConflictWarningPanel 1.0 PermissionConflictWarningPanel.qml +PermissionQualificationPanel 1.0 PermissionQualificationPanel.qml diff --git a/ui/app/AppLayouts/Chat/views/communities/CommunityNewPermissionView.qml b/ui/app/AppLayouts/Chat/views/communities/CommunityNewPermissionView.qml index 0ca635fa25..fc639e4395 100644 --- a/ui/app/AppLayouts/Chat/views/communities/CommunityNewPermissionView.qml +++ b/ui/app/AppLayouts/Chat/views/communities/CommunityNewPermissionView.qml @@ -660,42 +660,19 @@ StatusScrollView { Separator { Layout.topMargin: 24 } - RowLayout { + + HidePermissionPanel { Layout.topMargin: 12 Layout.fillWidth: true Layout.leftMargin: 16 Layout.rightMargin: Layout.leftMargin - spacing: 16 - StatusRoundIcon { - asset.name: "hide" - } - ColumnLayout { - Layout.fillWidth: true - StatusBaseText { - text: qsTr("Hide permission") - color: Theme.palette.directColor1 - font.pixelSize: 15 - } - StatusBaseText { - Layout.fillWidth: true - Layout.fillHeight: true - text: qsTr("Make this permission hidden from members who don’t meet it’s requirements") - color: Theme.palette.baseColor1 - font.pixelSize: 15 - lineHeight: 1.2 - wrapMode: Text.WordWrap - elide: Text.ElideRight - clip: true - } - } - StatusSwitch { - enabled: d.permissionType !== PermissionTypes.Type.Admin - checked: d.dirtyValues.isPrivate - onToggled: d.dirtyValues.isPrivate = checked - } + + enabled: d.permissionType !== PermissionTypes.Type.Admin + checked: d.dirtyValues.isPrivate + onToggled: d.dirtyValues.isPrivate = checked } - PermissionConflictWarningPanel{ + PermissionConflictWarningPanel { id: conflictPanel visible: store.permissionConflict.exists