diff --git a/res/css/_components.scss b/res/css/_components.scss index 0603296ef5..a55cf2749a 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/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/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/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/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.", + )}