diff --git a/res/css/_components.scss b/res/css/_components.scss index c6c8cace27..5e7e9abd05 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -33,6 +33,7 @@ @import "./views/auth/_InteractiveAuthEntryComponents.scss"; @import "./views/auth/_LanguageSelector.scss"; @import "./views/auth/_ServerConfig.scss"; +@import "./views/auth/_ServerTypeSelector.scss"; @import "./views/avatars/_BaseAvatar.scss"; @import "./views/avatars/_MemberStatusMessageAvatar.scss"; @import "./views/context_menus/_MessageContextMenu.scss"; diff --git a/res/css/structures/_AutoHideScrollbar.scss b/res/css/structures/_AutoHideScrollbar.scss index 60aea7ce8f..cb0d6f7f09 100644 --- a/res/css/structures/_AutoHideScrollbar.scss +++ b/res/css/structures/_AutoHideScrollbar.scss @@ -64,3 +64,20 @@ body.mx_scrollbar_nooverlay { margin-right: calc(-1 * var(--scrollbar-width)); } } + +// style the native scrollbars ... +// ... standard css scrollbars (firefox at time of writing) +.mx_AutoHideScrollbar { + scrollbar-color: $scrollbar-thumb-color $scrollbar-track-color; + scrollbar-width: thin; +} +// or fallback for webkit browsers +::-webkit-scrollbar { + width: 6px; + background-color: $scrollbar-track-color; +} + +::-webkit-scrollbar-thumb { + background-color: $scrollbar-thumb-color; + border-radius: 3px; +} diff --git a/res/css/structures/_TabbedView.scss b/res/css/structures/_TabbedView.scss index d1a448711a..7d7ab35081 100644 --- a/res/css/structures/_TabbedView.scss +++ b/res/css/structures/_TabbedView.scss @@ -55,6 +55,7 @@ limitations under the License. .mx_TabbedView_maskedIcon {; margin-left: 6px; margin-right: 9px; + margin-top: 1px; width: 14px; height: 14px; display: inline-block; @@ -66,7 +67,7 @@ limitations under the License. mask-repeat: no-repeat; mask-size: 14px; width: 14px; - height: 15px; + height: 18px; mask-position: center; content: ''; vertical-align: middle; diff --git a/res/css/structures/auth/_Login.scss b/res/css/structures/auth/_Login.scss index c32f70a696..5ba4a38c95 100644 --- a/res/css/structures/auth/_Login.scss +++ b/res/css/structures/auth/_Login.scss @@ -23,7 +23,8 @@ limitations under the License. } .mx_Login_field { - width: 280px; + width: 100%; + box-sizing: border-box; border-radius: 3px; border: 1px solid $strong-input-border-color; font-weight: 300; @@ -32,10 +33,6 @@ limitations under the License. margin-bottom: 14px; } -.mx_Login_field_disabled { - opacity: 0.3; -} - .mx_Login_fieldLabel { margin-top: -10px; margin-left: 8px; @@ -49,6 +46,8 @@ limitations under the License. width: 100%; margin-top: 35px; margin-bottom: 24px; + box-sizing: border-box; + text-align: center; } .mx_Login_submit:hover { @@ -69,10 +68,10 @@ limitations under the License. margin-right: 10px; } -.mx_Login_sso_link { - display: block; - text-align: center; - margin-bottom: 20px; +.mx_AuthBody a.mx_Login_sso_link:link, +.mx_AuthBody a.mx_Login_sso_link:hover, +.mx_AuthBody a.mx_Login_sso_link:visited { + color: $button-primary-fg-color; } .mx_Login_loader { @@ -105,6 +104,7 @@ limitations under the License. .mx_Login_type_container { display: flex; margin-bottom: 14px; + color: $primary-fg-color; } .mx_Login_type_label { @@ -124,9 +124,9 @@ limitations under the License. } .mx_Login_field_prefix { - height: 34px; + height: 38px; padding: 0px 5px; - line-height: 33px; + line-height: 38px; background-color: #eee; border: 1px solid #c7c7c7; @@ -136,40 +136,11 @@ limitations under the License. text-align: center; } -.mx_Login_field_suffix { - height: 34px; - padding: 0px 5px; - line-height: 33px; - - background-color: #eee; - border: 1px solid #c7c7c7; - border-left: 0px; - border-radius: 0px 3px 3px 0px; - - text-align: center; - flex-grow: 1; -} - -.mx_Login_username { - height: 16px; - flex-shrink: 1; - min-width: 0px; -} - -.mx_Login_phoneNumberField { - height: 16px; -} - .mx_Login_field_has_prefix { border-top-left-radius: 0px; border-bottom-left-radius: 0px; } -.mx_Login_field_has_suffix { - border-top-right-radius: 0px; - border-bottom-right-radius: 0px; -} - .mx_Login_phoneSection { display:flex; } @@ -190,12 +161,9 @@ limitations under the License. } .mx_Login_phoneCountry .mx_Dropdown_option { - /* - To match height of mx_Login_field - 33px + 2px border from mx_Dropdown_option = 35px - */ - height: 33px; - line-height: 33px; + /* To match height of mx_Login_field */ + height: 38px; + line-height: 38px; } .mx_Login_phoneCountry .mx_Dropdown_option img { diff --git a/res/css/views/auth/_AuthBody.scss b/res/css/views/auth/_AuthBody.scss index cb28d57801..845aea3fd9 100644 --- a/res/css/views/auth/_AuthBody.scss +++ b/res/css/views/auth/_AuthBody.scss @@ -24,6 +24,29 @@ limitations under the License. color: $authpage-body-color; } +.mx_AuthBody h2 { + font-size: 24px; + font-weight: 600; + margin-top: 8px; +} + +.mx_AuthBody h3 { + font-size: 14px; + font-weight: 600; + color: $primary-fg-color; +} + +.mx_Auth_editServerDetails { + padding-left: 1em; + font-size: 12px; + font-weight: normal; +} + +.mx_AuthBody .mx_Field input { + width: 100%; + box-sizing: border-box; +} + .mx_AuthBody a:link, .mx_AuthBody a:hover, .mx_AuthBody a:visited { diff --git a/res/css/views/auth/_AuthPage.scss b/res/css/views/auth/_AuthPage.scss index 04dab59ed6..cf509248fd 100644 --- a/res/css/views/auth/_AuthPage.scss +++ b/res/css/views/auth/_AuthPage.scss @@ -23,12 +23,6 @@ limitations under the License. background-color: $authpage-bg-color; } -.mx_AuthPage h2 { - font-size: 24px; - font-weight: 600; - margin-top: 8px; -} - .mx_AuthPage_modal { display: flex; margin: 100px auto auto; diff --git a/res/css/views/auth/_ServerConfig.scss b/res/css/views/auth/_ServerConfig.scss index 894ce19827..79ad9e8238 100644 --- a/res/css/views/auth/_ServerConfig.scss +++ b/res/css/views/auth/_ServerConfig.scss @@ -14,23 +14,24 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_ServerConfig { - margin-top: 7px; +.mx_ServerConfig_fields { + display: flex; + margin: 1em 0; } -.mx_ServerConfig .mx_Login_field { - margin-top: 4px; - margin-bottom: 5px; +.mx_ServerConfig_fields .mx_Field { + flex: 1; + margin: 0 5px; +} + +.mx_ServerConfig_fields .mx_Field:first-child { + margin-left: 0; +} + +.mx_ServerConfig_fields .mx_Field:last-child { + margin-right: 0; } .mx_ServerConfig_help:link { opacity: 0.8; - font-size: 13px; - font-weight: 300; - color: $primary-fg-color; } - -.mx_ServerConfig_selector { - text-align: center; - width: 302px; // for fr i18n -} \ No newline at end of file diff --git a/res/css/views/auth/_ServerTypeSelector.scss b/res/css/views/auth/_ServerTypeSelector.scss new file mode 100644 index 0000000000..03f5386501 --- /dev/null +++ b/res/css/views/auth/_ServerTypeSelector.scss @@ -0,0 +1,69 @@ +/* +Copyright 2019 New Vector Ltd + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +.mx_ServerTypeSelector { + display: flex; + margin-bottom: 28px; +} + +.mx_ServerTypeSelector_type { + margin: 0 5px; +} + +.mx_ServerTypeSelector_type:first-child { + margin-left: 0; +} + +.mx_ServerTypeSelector_type:last-child { + margin-right: 0; +} + +.mx_ServerTypeSelector_label { + text-align: center; + font-weight: 600; + color: $primary-fg-color; + margin: 8px 0; +} + +.mx_ServerTypeSelector_type .mx_AccessibleButton { + padding: 10px; + border: 1px solid $input-border-color; + border-radius: 4px; +} + +.mx_ServerTypeSelector_type.mx_ServerTypeSelector_type_selected .mx_AccessibleButton { + border-color: $input-valid-border-color; +} + +.mx_ServerTypeSelector_logo { + display: flex; + justify-content: center; + height: 18px; + margin-bottom: 12px; + font-weight: 600; + color: $primary-fg-color; +} + +.mx_ServerTypeSelector_logo > div { + display: flex; + width: 70%; + align-items: center; + justify-content: space-evenly; +} + +.mx_ServerTypeSelector_description { + font-size: 10px; +} diff --git a/res/css/views/dialogs/_UserSettingsDialog.scss b/res/css/views/dialogs/_UserSettingsDialog.scss index 2849573790..c29c04a273 100644 --- a/res/css/views/dialogs/_UserSettingsDialog.scss +++ b/res/css/views/dialogs/_UserSettingsDialog.scss @@ -44,3 +44,7 @@ limitations under the License. .mx_UserSettingsDialog_labsIcon:before { mask-image: url('$(res)/img/feather-icons/flag.svg'); } + +.mx_UserSettingsDialog_flairIcon:before { + mask-image: url('$(res)/img/feather-icons/flair.svg'); +} diff --git a/res/css/views/groups/_GroupPublicityToggle.scss b/res/css/views/groups/_GroupPublicityToggle.scss index 3ea4aa07d6..b8be2711ca 100644 --- a/res/css/views/groups/_GroupPublicityToggle.scss +++ b/res/css/views/groups/_GroupPublicityToggle.scss @@ -20,23 +20,14 @@ limitations under the License. margin: 8px; } -.mx_GroupPublicity_toggle > label { - display: flex; - align-items: flex-start; -} - -.mx_GroupPublicity_toggle > label, -.mx_GroupPublicity_toggle .mx_GroupTile { - width: 50%; -} - -.mx_GroupPublicity_toggle input { - margin-right: 8px; - vertical-align: -4px; -} - .mx_GroupPublicity_toggle .mx_GroupTile { display: flex; align-items: flex-start; cursor: pointer; + box-sizing: border-box; + width: 100%; +} + +.mx_GroupPublicity_toggle .mx_ToggleSwitch { + float: right; } diff --git a/res/img/feather-icons/flair.svg b/res/img/feather-icons/flair.svg new file mode 100644 index 0000000000..ce3a5ed6ad --- /dev/null +++ b/res/img/feather-icons/flair.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/res/img/feather-icons/globe.svg b/res/img/feather-icons/globe.svg new file mode 100644 index 0000000000..8af7dc41dc --- /dev/null +++ b/res/img/feather-icons/globe.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/res/img/feather-icons/matrix-org-bw-logo.svg b/res/img/feather-icons/matrix-org-bw-logo.svg new file mode 100644 index 0000000000..39a7b173e8 --- /dev/null +++ b/res/img/feather-icons/matrix-org-bw-logo.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/res/img/feather-icons/modular-bw-logo.svg b/res/img/feather-icons/modular-bw-logo.svg new file mode 100644 index 0000000000..924a587805 --- /dev/null +++ b/res/img/feather-icons/modular-bw-logo.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/res/themes/dark/css/_dark.scss b/res/themes/dark/css/_dark.scss index 0afa6a91e1..ee5e1cf5d6 100644 --- a/res/themes/dark/css/_dark.scss +++ b/res/themes/dark/css/_dark.scss @@ -74,7 +74,9 @@ $strong-input-border-color: #656565; // used for UserSettings EditableText $input-underline-color: $primary-fg-color; $input-fg-color: $primary-fg-color; - +// scrollbars +$scrollbar-thumb-color: rgba(255, 255, 255, 0.2); +$scrollbar-track-color: transparent; // context menus $menu-border-color: rgba(187, 187, 187, 0.5); $menu-bg-color: #373737; diff --git a/res/themes/dharma/css/_dharma.scss b/res/themes/dharma/css/_dharma.scss index 940e26a1a2..dccad9b6ef 100644 --- a/res/themes/dharma/css/_dharma.scss +++ b/res/themes/dharma/css/_dharma.scss @@ -86,7 +86,9 @@ $strong-input-border-color: #c7c7c7; // used for UserSettings EditableText $input-underline-color: rgba(151, 151, 151, 0.5); $input-fg-color: rgba(74, 74, 74, 0.9); - +// scrollbars +$scrollbar-thumb-color: rgba(0, 0, 0, 0.2); +$scrollbar-track-color: transparent; // context menus $menu-border-color: #ebedf8; $menu-bg-color: #fff; diff --git a/res/themes/light/css/_base.scss b/res/themes/light/css/_base.scss index 6871ec8d6c..7136b8834a 100644 --- a/res/themes/light/css/_base.scss +++ b/res/themes/light/css/_base.scss @@ -83,7 +83,9 @@ $field-focused-label-bg-color: #ffffff; // used for UserSettings EditableText $input-underline-color: rgba(151, 151, 151, 0.5); $input-fg-color: rgba(74, 74, 74, 0.9); - +// scrollbars +$scrollbar-thumb-color: rgba(0, 0, 0, 0.2); +$scrollbar-track-color: transparent; // context menus $menu-border-color: rgba(187, 187, 187, 0.5); $menu-bg-color: #f6f6f6; diff --git a/src/Analytics.js b/src/Analytics.js index d85d635b28..3a8c5d6e10 100644 --- a/src/Analytics.js +++ b/src/Analytics.js @@ -66,7 +66,7 @@ const customVariables = { }, 'User Type': { id: 3, - expl: _td('Whether or not you\'re logged in (we don\'t record your user name)'), + expl: _td('Whether or not you\'re logged in (we don\'t record your username)'), example: 'Logged In', }, 'Chosen Language': { diff --git a/src/components/structures/AutoHideScrollbar.js b/src/components/structures/AutoHideScrollbar.js index 47ae24ba0f..a8fccec08e 100644 --- a/src/components/structures/AutoHideScrollbar.js +++ b/src/components/structures/AutoHideScrollbar.js @@ -20,6 +20,7 @@ import React from "react"; // Copyright (c) Noel Delgado (pixelia.me) function getScrollbarWidth(alternativeOverflow) { const div = document.createElement('div'); + div.className = 'mx_AutoHideScrollbar'; //to get width of css scrollbar div.style.position = 'absolute'; div.style.top = '-9999px'; div.style.width = '100px'; diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index 852dddd063..676e0e6976 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -84,7 +84,7 @@ const RoomSubList = React.createClass({ // The dataset elements are added in the RoomList _initAndPositionStickyHeaders method isCollapsableOnClick: function() { const stuck = this.refs.header.dataset.stuck; - if (this.state.hidden || stuck === undefined || stuck === "none") { + if (!this.props.forceExpand && (this.state.hidden || stuck === undefined || stuck === "none")) { return true; } else { return false; @@ -238,7 +238,7 @@ const RoomSubList = React.createClass({ } }, - _getHeaderJsx: function() { + _getHeaderJsx: function(isCollapsed) { const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); const subListNotifications = this.roomNotificationCount(); const subListNotifCount = subListNotifications[0]; @@ -287,8 +287,8 @@ const RoomSubList = React.createClass({ if (len) { const chevronClasses = classNames({ 'mx_RoomSubList_chevron': true, - 'mx_RoomSubList_chevronRight': this.state.hidden, - 'mx_RoomSubList_chevronDown': !this.state.hidden, + 'mx_RoomSubList_chevronRight': isCollapsed, + 'mx_RoomSubList_chevronDown': !isCollapsed, }); chevron = (
); } @@ -321,21 +321,23 @@ const RoomSubList = React.createClass({ render: function() { const len = this.props.list.length + this.props.extraTiles.length; + const isCollapsed = this.state.hidden && !this.props.forceExpand; if (len) { const subListClasses = classNames({ "mx_RoomSubList": true, - "mx_RoomSubList_hidden": this.state.hidden, - "mx_RoomSubList_nonEmpty": len && !this.state.hidden, + "mx_RoomSubList_hidden": isCollapsed, + "mx_RoomSubList_nonEmpty": len && !isCollapsed, }); - if (this.state.hidden) { + + if (isCollapsed) { return
- {this._getHeaderJsx()} + {this._getHeaderJsx(isCollapsed)}
; } else { const tiles = this.makeRoomTiles(); tiles.push(...this.props.extraTiles); return
- {this._getHeaderJsx()} + {this._getHeaderJsx(isCollapsed)} { tiles } @@ -344,13 +346,13 @@ const RoomSubList = React.createClass({ } else { const Loader = sdk.getComponent("elements.Spinner"); let content; - if (this.props.showSpinner && !this.state.hidden) { + if (this.props.showSpinner && !isCollapsed) { content = ; } return (
- { this._getHeaderJsx() } + { this._getHeaderJsx(isCollapsed) } { content }
); diff --git a/src/components/structures/auth/ForgotPassword.js b/src/components/structures/auth/ForgotPassword.js index 73d9f95e20..1b8b15981b 100644 --- a/src/components/structures/auth/ForgotPassword.js +++ b/src/components/structures/auth/ForgotPassword.js @@ -211,7 +211,6 @@ module.exports = React.createClass({ if (!SdkConfig.get()['disable_custom_urls']) { serverConfigSection = ( + +
; + } + + let serverDetails = null; + switch (this.state.serverType) { + case ServerType.FREE: + break; + case ServerType.PREMIUM: + serverDetails = ; + break; + case ServerType.ADVANCED: + serverDetails = ; + break; + } + + let nextButton = null; + if (PHASES_ENABLED) { + nextButton = + {_t("Next")} + ; + } + + return
+ + {serverDetails} + {nextButton} +
; + }, + + loginComponentForStep() { + if (PHASES_ENABLED && this.state.phase !== PHASE_LOGIN) { + return null; + } + + const step = this.state.currentFlow; + if (!step) { return null; } @@ -491,10 +627,21 @@ module.exports = React.createClass({ _renderPasswordStep: function() { const PasswordLogin = sdk.getComponent('auth.PasswordLogin'); + let onEditServerDetailsClick = null; + // If custom URLs are allowed and we haven't selected the Free server type, wire + // up the server details edit link. + if ( + PHASES_ENABLED && + !SdkConfig.get()['disable_custom_urls'] && + this.state.serverType !== ServerType.FREE + ) { + onEditServerDetailsClick = this.onEditServerDetailsClick; + } return ( { _t('Sign in with single sign-on') } + { _t('Sign in with single sign-on') } ); }, @@ -530,7 +677,6 @@ module.exports = React.createClass({ const AuthPage = sdk.getComponent("auth.AuthPage"); const AuthHeader = sdk.getComponent("auth.AuthHeader"); const AuthBody = sdk.getComponent("auth.AuthBody"); - const ServerConfig = sdk.getComponent("auth.ServerConfig"); const loader = this.state.busy ?
: null; const errorText = this.props.defaultServerDiscoveryError || this.state.discoveryError || this.state.errorText; @@ -543,19 +689,6 @@ module.exports = React.createClass({ ; } - let serverConfig; - - if (!SdkConfig.get()['disable_custom_urls']) { - serverConfig = ; - } - let errorTextSection; if (errorText) { errorTextSection = ( @@ -574,8 +707,8 @@ module.exports = React.createClass({ {loader} { errorTextSection } - { this.componentForStep(this.state.currentFlow) } - { serverConfig } + { this.serverComponentForStep() } + { this.loginComponentForStep() } { _t('Create account') } diff --git a/src/components/structures/auth/Registration.js b/src/components/structures/auth/Registration.js index acc45df86f..3a63115a43 100644 --- a/src/components/structures/auth/Registration.js +++ b/src/components/structures/auth/Registration.js @@ -255,7 +255,7 @@ module.exports = React.createClass({ errMsg = _t("Only use lower case letters, numbers and '=_-./'"); break; case "RegistrationForm.ERR_USERNAME_BLANK": - errMsg = _t('You need to enter a user name.'); + errMsg = _t('You need to enter a username.'); break; default: console.error("Unknown error code: %s", errCode); @@ -330,7 +330,6 @@ module.exports = React.createClass({ if (!SdkConfig.get()['disable_custom_urls']) { serverConfigSection = (
- - { _t("You can use the custom server options to sign into other Matrix " + - "servers by specifying a different Home server URL.") } -
- { _t("This allows you to use this app with an existing Matrix account on " + - "a different home server.") } -
-
- { _t("You can also set a custom identity server but this will typically prevent " + - "interaction with users based on email address.") } -
+

{_t( + "You can use the custom server options to sign into other " + + "Matrix servers by specifying a different homeserver URL. This " + + "allows you to use this app with an existing Matrix account on a " + + "different homeserver.", + )}

+

{_t( + "You can also set a custom identity server, but you won't be " + + "able to invite users by email address, or be invited by email " + + "address yourself.", + )}