diff --git a/res/css/views/dialogs/_CreateRoomDialog.scss b/res/css/views/dialogs/_CreateRoomDialog.scss index c542741c30..2678f7b4ad 100644 --- a/res/css/views/dialogs/_CreateRoomDialog.scss +++ b/res/css/views/dialogs/_CreateRoomDialog.scss @@ -15,6 +15,8 @@ limitations under the License. */ .mx_CreateRoomDialog_details { + margin-top: 15px; + .mx_CreateRoomDialog_details_summary { outline: none; list-style: none; @@ -71,11 +73,19 @@ limitations under the License. } .mx_CreateRoomDialog { - &.mx_Dialog_fixedWidth { width: 450px; } + .mx_Dialog_content { + margin-bottom: 40px; + } + + p, + .mx_Field_input label { + color: $muted-fg-color; + } + .mx_SettingsFlag { display: flex; } @@ -90,5 +100,18 @@ limitations under the License. flex: 0 0 auto; margin-left: 30px; } + + .mx_CreateRoomDialog_topic { + margin-bottom: 36px; + } + + .mx_Dialog_content > .mx_SettingsFlag { + margin-top: 24px; + } + + p { + margin: 0 85px 0 0; + font-size: $font-12px; + } } diff --git a/src/components/views/dialogs/CreateRoomDialog.js b/src/components/views/dialogs/CreateRoomDialog.js index 77014db21d..88e90627e8 100644 --- a/src/components/views/dialogs/CreateRoomDialog.js +++ b/src/components/views/dialogs/CreateRoomDialog.js @@ -24,6 +24,7 @@ import withValidation from '../elements/Validation'; import { _t } from '../../../languageHandler'; import {MatrixClientPeg} from '../../../MatrixClientPeg'; import {Key} from "../../../Keyboard"; +import SettingsStore from "../../../settings/SettingsStore"; export default createReactClass({ displayName: 'CreateRoomDialog', @@ -35,6 +36,7 @@ export default createReactClass({ const config = SdkConfig.get(); return { isPublic: false, + isEncrypted: true, name: "", topic: "", alias: "", @@ -62,6 +64,11 @@ export default createReactClass({ if (this.state.noFederate) { createOpts.creation_content = {'m.federate': false}; } + + if (!this.state.isPublic && SettingsStore.isFeatureEnabled("feature_cross_signing")) { + createOpts.encryption = this.state.isEncrypted; + } + return opts; }, @@ -127,6 +134,10 @@ export default createReactClass({ this.setState({isPublic}); }, + onEncryptedChange(isEncrypted) { + this.setState({isEncrypted}); + }, + onAliasChange(alias) { this.setState({alias}); }, @@ -166,11 +177,10 @@ export default createReactClass({ const LabelledToggleSwitch = sdk.getComponent('views.elements.LabelledToggleSwitch'); const RoomAliasField = sdk.getComponent('views.elements.RoomAliasField'); - let privateLabel; - let publicLabel; + let publicPrivateLabel; let aliasField; if (this.state.isPublic) { - publicLabel = (
{_t("Set a room alias to easily share your room with other people.")}
); + publicPrivateLabel = ({_t("Set a room alias to easily share your room with other people.")}
); const domain = MatrixClientPeg.get().getDomain(); aliasField = ({_t("This room is private, and can only be joined by invitation.")}
); + publicPrivateLabel = ({_t("This room is private, and can only be joined by invitation.")}
); + } + + let e2eeSection; + if (!this.state.isPublic && SettingsStore.isFeatureEnabled("feature_cross_signing")) { + e2eeSection ={ _t("You can’t disable this later. Bridges & most bots won’t work yet.") }
+