From 1906cfd700a289d2045bea1adf031e3b40899aa2 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Jan 2019 10:09:33 -0600 Subject: [PATCH 01/11] Tweak field label to be vertically centered --- res/css/views/elements/_Field.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/css/views/elements/_Field.scss b/res/css/views/elements/_Field.scss index 1b5b0b37c2..e28ae91761 100644 --- a/res/css/views/elements/_Field.scss +++ b/res/css/views/elements/_Field.scss @@ -56,7 +56,7 @@ limitations under the License. position: absolute; left: 0px; top: 0px; - margin: 6px 8px; + margin: 7px 8px; padding: 2px; } From 352107352edd46a63182c57e9a7cb539cb34fb2b Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Jan 2019 10:16:20 -0600 Subject: [PATCH 02/11] Tweak field input padding to match label position --- res/css/views/elements/_Field.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/css/views/elements/_Field.scss b/res/css/views/elements/_Field.scss index e28ae91761..f8090eaaf7 100644 --- a/res/css/views/elements/_Field.scss +++ b/res/css/views/elements/_Field.scss @@ -26,7 +26,7 @@ limitations under the License. border-radius: 4px; transition: border-color 0.25s; border: 1px solid $input-border-color; - padding: 8px 10px; + padding: 8px 9px; } .mx_Field input:focus { From 23b3e74c1c3037e687620ea609dda8f95ce943cb Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Jan 2019 10:24:04 -0600 Subject: [PATCH 03/11] Change to new field focused color --- res/css/views/elements/_Field.scss | 4 ++-- res/themes/dharma/css/_dharma.scss | 1 + res/themes/light/css/_base.scss | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/res/css/views/elements/_Field.scss b/res/css/views/elements/_Field.scss index f8090eaaf7..c728f4bcd4 100644 --- a/res/css/views/elements/_Field.scss +++ b/res/css/views/elements/_Field.scss @@ -31,7 +31,7 @@ limitations under the License. .mx_Field input:focus { outline: 0; - border-color: $input-valid-border-color; + border-color: $input-focused-border-color; } .mx_Field input::placeholder { @@ -73,5 +73,5 @@ limitations under the License. } .mx_Field input:focus + label { - color: $input-valid-border-color; + color: $input-focused-border-color; } diff --git a/res/themes/dharma/css/_dharma.scss b/res/themes/dharma/css/_dharma.scss index 4a2bfec8e4..5f6a69abe3 100644 --- a/res/themes/dharma/css/_dharma.scss +++ b/res/themes/dharma/css/_dharma.scss @@ -71,6 +71,7 @@ $input-darker-bg-color: rgba(193, 201, 214, 0.29); $input-darker-fg-color: #9fa9ba; $input-lighter-bg-color: #f2f5f8; $input-lighter-fg-color: $input-darker-fg-color; +$input-focused-border-color: #238cf5; $input-valid-border-color: #7ac9a1; $field-focused-label-bg-color: #ffffff; diff --git a/res/themes/light/css/_base.scss b/res/themes/light/css/_base.scss index 9a3b3727a9..dbab909f13 100644 --- a/res/themes/light/css/_base.scss +++ b/res/themes/light/css/_base.scss @@ -73,6 +73,7 @@ $button-bg-color: #7ac9a1; $button-fg-color: white; // apart from login forms, which have stronger border $strong-input-border-color: #c7c7c7; +$input-focused-border-color: #238cf5; $input-valid-border-color: #7ac9a1; $field-focused-label-bg-color: #ffffff; From 82dee37afeb045c511e6ad2748198164178929c4 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Jan 2019 08:56:58 -0600 Subject: [PATCH 04/11] Fix styling regression in member list filter --- res/themes/dharma/css/_dharma.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/res/themes/dharma/css/_dharma.scss b/res/themes/dharma/css/_dharma.scss index 5f6a69abe3..1436328047 100644 --- a/res/themes/dharma/css/_dharma.scss +++ b/res/themes/dharma/css/_dharma.scss @@ -247,8 +247,8 @@ input[type=password] { } .dark-panel { - :not(.mx_textinput) > input[type=text], - :not(.mx_textinput) > input[type=search], + :not(.mx_textinput):not(.mx_Field) > input[type=text], + :not(.mx_textinput):not(.mx_Field) > input[type=search], .mx_textinput { color: $input-darker-fg-color; background-color: $input-darker-bg-color; @@ -257,8 +257,8 @@ input[type=password] { } .light-panel { - :not(.mx_textinput) > input[type=text], - :not(.mx_textinput) > input[type=search], + :not(.mx_textinput):not(.mx_Field) > input[type=text], + :not(.mx_textinput):not(.mx_Field) > input[type=search], .mx_textinput { color: $input-lighter-fg-color; background-color: $input-lighter-bg-color; From e714b2aed2a000c0c159948a6e19290294d6ee5a Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Jan 2019 12:05:07 -0600 Subject: [PATCH 05/11] Remove Status theme-specific hacks --- src/components/structures/login/Login.js | 14 +------ .../structures/login/Registration.js | 19 +++------ src/components/views/login/LoginPage.js | 39 +++---------------- 3 files changed, 13 insertions(+), 59 deletions(-) diff --git a/src/components/structures/login/Login.js b/src/components/structures/login/Login.js index 321084389b..6206b7660d 100644 --- a/src/components/structures/login/Login.js +++ b/src/components/structures/login/Login.js @@ -1,7 +1,7 @@ /* Copyright 2015, 2016 OpenMarket Ltd Copyright 2017 Vector Creations Ltd -Copyright 2018 New Vector Ltd +Copyright 2018, 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. @@ -24,7 +24,6 @@ import { _t, _td } from '../../../languageHandler'; import sdk from '../../../index'; import Login from '../../../Login'; import SdkConfig from '../../../SdkConfig'; -import SettingsStore from "../../../settings/SettingsStore"; import { messageForResourceLimitError } from '../../../utils/ErrorUtils'; import { AutoDiscovery } from "matrix-js-sdk"; @@ -533,7 +532,6 @@ module.exports = React.createClass({ } let serverConfig; - let header; if (!SdkConfig.get()['disable_custom_urls']) { serverConfig = ; } - // FIXME: remove status.im theme tweaks - const theme = SettingsStore.getValue("theme"); - if (theme !== "status") { - header =

{ _t('Sign in') } { loader }

; - } else { - if (!errorText) { - header =

{ _t('Sign in to get started') } { loader }

; - } - } + const header =

{ _t('Sign in') } { loader }

; let errorTextSection; if (errorText) { diff --git a/src/components/structures/login/Registration.js b/src/components/structures/login/Registration.js index fa5a02e881..74e3685bb5 100644 --- a/src/components/structures/login/Registration.js +++ b/src/components/structures/login/Registration.js @@ -1,7 +1,7 @@ /* Copyright 2015, 2016 OpenMarket Ltd Copyright 2017 Vector Creations Ltd -Copyright 2018 New Vector Ltd +Copyright 2018, 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. @@ -28,7 +28,6 @@ import RegistrationForm from '../../views/login/RegistrationForm'; import RtsClient from '../../../RtsClient'; import { _t, _td } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; -import SettingsStore from "../../../settings/SettingsStore"; import { messageForResourceLimitError } from '../../../utils/ErrorUtils'; const MIN_PASSWORD_LENGTH = 6; @@ -404,8 +403,6 @@ module.exports = React.createClass({ const Spinner = sdk.getComponent("elements.Spinner"); const ServerConfig = sdk.getComponent('views.login.ServerConfig'); - const theme = SettingsStore.getValue("theme"); - let registerBody; if (this.state.doingUIAuth) { registerBody = ( @@ -458,24 +455,18 @@ module.exports = React.createClass({ ); } - let header; let errorText; - // FIXME: remove hardcoded Status team tweaks at some point const err = this.state.errorText || this.props.defaultServerDiscoveryError; - if (theme === 'status' && err) { - header =
{ err }
; - } else { - header =

{ _t('Create an account') }

; - if (err) { - errorText =
{ err }
; - } + const header =

{ _t('Create an account') }

; + if (err) { + errorText =
{ err }
; } let signIn; if (!this.state.doingUIAuth) { signIn = ( - { theme === 'status' ? _t('Sign in') : _t('I already have an account') } + { _t('I already have an account') } ); } diff --git a/src/components/views/login/LoginPage.js b/src/components/views/login/LoginPage.js index 9eba53188e..83da8fa60b 100644 --- a/src/components/views/login/LoginPage.js +++ b/src/components/views/login/LoginPage.js @@ -1,5 +1,6 @@ /* Copyright 2015, 2016 OpenMarket Ltd +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. @@ -16,44 +17,16 @@ limitations under the License. 'use strict'; -import SettingsStore from "../../../settings/SettingsStore"; - const React = require('react'); module.exports = React.createClass({ displayName: 'LoginPage', render: function() { - // FIXME: this should be turned into a proper skin with a StatusLoginPage component - if (SettingsStore.getValue("theme") === 'status') { - return ( -
-
- Status -
-
-
-

Status Community Chat

-
- A safer, decentralised communication - platform powered by Riot -
-
- { this.props.children } -
-

This channel is for our development community.

-

Interested in SNT and discussions on the cryptocurrency market?

-

Join Telegram Chat

-
-
-
- ); - } else { - return ( -
- { this.props.children } -
- ); - } + return ( +
+ { this.props.children } +
+ ); }, }); From 31808c23a864991b0b6c9b6bd7d8944a58f03fd8 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Jan 2019 14:31:51 -0600 Subject: [PATCH 06/11] Override Firefox UA style for placeholders --- res/themes/dharma/css/_dharma.scss | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/res/themes/dharma/css/_dharma.scss b/res/themes/dharma/css/_dharma.scss index 1436328047..c9f62fbe6b 100644 --- a/res/themes/dharma/css/_dharma.scss +++ b/res/themes/dharma/css/_dharma.scss @@ -295,6 +295,13 @@ input[type=search]::-webkit-search-results-decoration { .input[type=search]::-moz-placeholder { color: #a5aab2; } + +// Override Firefox's UA style so we get a consistent look across browsers +input::placeholder, +textarea::placeholder { + opacity: initial; +} + // ***** Mixins! ***** @define-mixin mx_DialogButton { From cd8c74a7c48014458405c35480bf0ceec826dca5 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Jan 2019 15:03:55 -0600 Subject: [PATCH 07/11] Rebuild strings --- src/i18n/strings/en_EN.json | 1 - 1 file changed, 1 deletion(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 16c40460e2..cfd5168152 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1328,7 +1328,6 @@ "Can't connect to homeserver - please check your connectivity, ensure your homeserver's SSL certificate is trusted, and that a browser extension is not blocking requests.": "Can't connect to homeserver - please check your connectivity, ensure your homeserver's SSL certificate is trusted, and that a browser extension is not blocking requests.", "Sign in with single sign-on": "Sign in with single sign-on", "Try the app first": "Try the app first", - "Sign in to get started": "Sign in to get started", "Failed to fetch avatar URL": "Failed to fetch avatar URL", "Set a display name:": "Set a display name:", "Upload an avatar:": "Upload an avatar:", From 29be3ee4b5aa0fd7ddb10936545344d091dfe340 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Jan 2019 16:11:10 -0600 Subject: [PATCH 08/11] Rename login directory to auth --- .eslintignore.errorfiles | 16 ++++++++-------- res/css/_components.scss | 6 +++--- res/css/structures/{login => auth}/_Login.scss | 0 .../_InteractiveAuthEntryComponents.scss | 0 res/css/views/{login => auth}/_ServerConfig.scss | 0 src/components/structures/InteractiveAuth.js | 2 +- src/components/structures/MatrixChat.js | 10 +++++----- .../structures/{login => auth}/ForgotPassword.js | 10 +++++----- .../{login => auth}/LanguageSelector.js | 0 .../structures/{login => auth}/Login.js | 12 ++++++------ .../{login => auth}/PostRegistration.js | 4 ++-- .../structures/{login => auth}/Registration.js | 12 ++++++------ .../views/{login => auth}/CaptchaForm.js | 0 .../views/{login => auth}/CountryDropdown.js | 0 .../views/{login => auth}/CustomServerDialog.js | 0 .../InteractiveAuthEntryComponents.js | 2 +- .../views/{login => auth}/LoginFooter.js | 0 .../views/{login => auth}/LoginHeader.js | 0 .../views/{login => auth}/LoginPage.js | 0 .../views/{login => auth}/PasswordLogin.js | 2 +- .../views/{login => auth}/RegistrationForm.js | 2 +- .../views/{login => auth}/ServerConfig.js | 2 +- src/components/views/settings/AddPhoneNumber.js | 2 +- src/stores/LifecycleStore.js | 4 ++-- .../{login => auth}/Registration-test.js | 2 +- .../{login => auth}/RegistrationForm-test.js | 2 +- 26 files changed, 45 insertions(+), 45 deletions(-) rename res/css/structures/{login => auth}/_Login.scss (100%) rename res/css/views/{login => auth}/_InteractiveAuthEntryComponents.scss (100%) rename res/css/views/{login => auth}/_ServerConfig.scss (100%) rename src/components/structures/{login => auth}/ForgotPassword.js (97%) rename src/components/structures/{login => auth}/LanguageSelector.js (100%) rename src/components/structures/{login => auth}/Login.js (98%) rename src/components/structures/{login => auth}/PostRegistration.js (95%) rename src/components/structures/{login => auth}/Registration.js (97%) rename src/components/views/{login => auth}/CaptchaForm.js (100%) rename src/components/views/{login => auth}/CountryDropdown.js (100%) rename src/components/views/{login => auth}/CustomServerDialog.js (100%) rename src/components/views/{login => auth}/InteractiveAuthEntryComponents.js (99%) rename src/components/views/{login => auth}/LoginFooter.js (100%) rename src/components/views/{login => auth}/LoginHeader.js (100%) rename src/components/views/{login => auth}/LoginPage.js (100%) rename src/components/views/{login => auth}/PasswordLogin.js (99%) rename src/components/views/{login => auth}/RegistrationForm.js (99%) rename src/components/views/{login => auth}/ServerConfig.js (98%) rename test/components/structures/{login => auth}/Registration-test.js (98%) rename test/components/views/{login => auth}/RegistrationForm-test.js (97%) diff --git a/.eslintignore.errorfiles b/.eslintignore.errorfiles index 30cc55377c..42dc3b4810 100644 --- a/.eslintignore.errorfiles +++ b/.eslintignore.errorfiles @@ -1,11 +1,11 @@ # autogenerated file: run scripts/generate-eslint-error-ignore-file to update. src/component-index.js +src/components/structures/auth/ForgotPassword.js src/components/structures/BottomLeftMenu.js src/components/structures/CompatibilityPage.js src/components/structures/CreateRoom.js src/components/structures/LoggedInView.js -src/components/structures/login/ForgotPassword.js src/components/structures/MessagePanel.js src/components/structures/NotificationPanel.js src/components/structures/RoomDirectory.js @@ -15,6 +15,11 @@ src/components/structures/ScrollPanel.js src/components/structures/SearchBox.js src/components/structures/TimelinePanel.js src/components/structures/UploadBar.js +src/components/views/auth/CountryDropdown.js +src/components/views/auth/InteractiveAuthEntryComponents.js +src/components/views/auth/PasswordLogin.js +src/components/views/auth/RegistrationForm.js +src/components/views/auth/ServerConfig.js src/components/views/avatars/BaseAvatar.js src/components/views/avatars/MemberAvatar.js src/components/views/create_room/RoomAlias.js @@ -31,11 +36,6 @@ src/components/views/elements/UserSelector.js src/components/views/globals/MatrixToolbar.js src/components/views/globals/NewVersionBar.js src/components/views/globals/UpdateCheckBar.js -src/components/views/login/CountryDropdown.js -src/components/views/login/InteractiveAuthEntryComponents.js -src/components/views/login/PasswordLogin.js -src/components/views/login/RegistrationForm.js -src/components/views/login/ServerConfig.js src/components/views/messages/MFileBody.js src/components/views/messages/RoomAvatarEvent.js src/components/views/messages/TextualBody.js @@ -98,12 +98,12 @@ src/VectorConferenceHandler.js src/Velociraptor.js src/WhoIsTyping.js src/wrappers/withMatrixClient.js -test/components/structures/login/Registration-test.js +test/components/structures/auth/Registration-test.js test/components/structures/MessagePanel-test.js test/components/structures/ScrollPanel-test.js test/components/structures/TimelinePanel-test.js +test/components/views/auth/RegistrationForm-test.js test/components/views/dialogs/InteractiveAuthDialog-test.js -test/components/views/login/RegistrationForm-test.js test/components/views/rooms/MessageComposerInput-test.js test/components/views/rooms/RoomSettings-test.js test/mock-clock.js diff --git a/res/css/_components.scss b/res/css/_components.scss index 6b353ba72b..a1b575a0a1 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -23,7 +23,9 @@ @import "./structures/_UploadBar.scss"; @import "./structures/_UserSettings.scss"; @import "./structures/_ViewSource.scss"; -@import "./structures/login/_Login.scss"; +@import "./structures/auth/_Login.scss"; +@import "./views/auth/_InteractiveAuthEntryComponents.scss"; +@import "./views/auth/_ServerConfig.scss"; @import "./views/avatars/_BaseAvatar.scss"; @import "./views/avatars/_MemberStatusMessageAvatar.scss"; @import "./views/context_menus/_MessageContextMenu.scss"; @@ -75,8 +77,6 @@ @import "./views/groups/_GroupPublicityToggle.scss"; @import "./views/groups/_GroupRoomList.scss"; @import "./views/groups/_GroupUserSettings.scss"; -@import "./views/login/_InteractiveAuthEntryComponents.scss"; -@import "./views/login/_ServerConfig.scss"; @import "./views/messages/_CreateEvent.scss"; @import "./views/messages/_DateSeparator.scss"; @import "./views/messages/_MEmoteBody.scss"; diff --git a/res/css/structures/login/_Login.scss b/res/css/structures/auth/_Login.scss similarity index 100% rename from res/css/structures/login/_Login.scss rename to res/css/structures/auth/_Login.scss diff --git a/res/css/views/login/_InteractiveAuthEntryComponents.scss b/res/css/views/auth/_InteractiveAuthEntryComponents.scss similarity index 100% rename from res/css/views/login/_InteractiveAuthEntryComponents.scss rename to res/css/views/auth/_InteractiveAuthEntryComponents.scss diff --git a/res/css/views/login/_ServerConfig.scss b/res/css/views/auth/_ServerConfig.scss similarity index 100% rename from res/css/views/login/_ServerConfig.scss rename to res/css/views/auth/_ServerConfig.scss diff --git a/src/components/structures/InteractiveAuth.js b/src/components/structures/InteractiveAuth.js index 2883c8cca4..89ff4d43a3 100644 --- a/src/components/structures/InteractiveAuth.js +++ b/src/components/structures/InteractiveAuth.js @@ -20,7 +20,7 @@ const InteractiveAuth = Matrix.InteractiveAuth; import React from 'react'; import PropTypes from 'prop-types'; -import {getEntryComponentForLoginType} from '../views/login/InteractiveAuthEntryComponents'; +import {getEntryComponentForLoginType} from '../views/auth/InteractiveAuthEntryComponents'; export default React.createClass({ displayName: 'InteractiveAuth', diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index e5cf6a986a..7acceb4bb7 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -183,7 +183,7 @@ export default React.createClass({ register_is_url: null, register_id_sid: null, - // Parameters used for setting up the login/registration views + // Parameters used for setting up the authentication views defaultServerName: this.props.config.default_server_name, defaultHsUrl: this.props.config.default_hs_url, defaultIsUrl: this.props.config.default_is_url, @@ -1851,7 +1851,7 @@ export default React.createClass({ // needs to be before normal PageTypes as you are logged in technically if (this.state.view === VIEWS.POST_REGISTRATION) { - const PostRegistration = sdk.getComponent('structures.login.PostRegistration'); + const PostRegistration = sdk.getComponent('structures.auth.PostRegistration'); return ( @@ -1906,7 +1906,7 @@ export default React.createClass({ } if (this.state.view === VIEWS.REGISTER) { - const Registration = sdk.getComponent('structures.login.Registration'); + const Registration = sdk.getComponent('structures.auth.Registration'); return ( { err }; } - const LanguageSelector = sdk.getComponent('structures.login.LanguageSelector'); + const LanguageSelector = sdk.getComponent('structures.auth.LanguageSelector'); resetPasswordJsx = (
diff --git a/src/components/structures/login/LanguageSelector.js b/src/components/structures/auth/LanguageSelector.js similarity index 100% rename from src/components/structures/login/LanguageSelector.js rename to src/components/structures/auth/LanguageSelector.js diff --git a/src/components/structures/login/Login.js b/src/components/structures/auth/Login.js similarity index 98% rename from src/components/structures/login/Login.js rename to src/components/structures/auth/Login.js index 6206b7660d..a1f0327835 100644 --- a/src/components/structures/login/Login.js +++ b/src/components/structures/auth/Login.js @@ -486,7 +486,7 @@ module.exports = React.createClass({ }, _renderPasswordStep: function() { - const PasswordLogin = sdk.getComponent('login.PasswordLogin'); + const PasswordLogin = sdk.getComponent('auth.PasswordLogin'); return (
: null; const errorText = this.props.defaultServerDiscoveryError || this.state.discoveryError || this.state.errorText; @@ -555,7 +555,7 @@ module.exports = React.createClass({ ); } - const LanguageSelector = sdk.getComponent('structures.login.LanguageSelector'); + const LanguageSelector = sdk.getComponent('structures.auth.LanguageSelector'); return ( diff --git a/src/components/structures/login/PostRegistration.js b/src/components/structures/auth/PostRegistration.js similarity index 95% rename from src/components/structures/login/PostRegistration.js rename to src/components/structures/auth/PostRegistration.js index f6165348bd..826db89b93 100644 --- a/src/components/structures/login/PostRegistration.js +++ b/src/components/structures/auth/PostRegistration.js @@ -60,8 +60,8 @@ module.exports = React.createClass({ render: function() { const ChangeDisplayName = sdk.getComponent('settings.ChangeDisplayName'); const ChangeAvatar = sdk.getComponent('settings.ChangeAvatar'); - const LoginPage = sdk.getComponent('login.LoginPage'); - const LoginHeader = sdk.getComponent('login.LoginHeader'); + const LoginPage = sdk.getComponent('auth.LoginPage'); + const LoginHeader = sdk.getComponent('auth.LoginHeader'); return (
diff --git a/src/components/structures/login/Registration.js b/src/components/structures/auth/Registration.js similarity index 97% rename from src/components/structures/login/Registration.js rename to src/components/structures/auth/Registration.js index 74e3685bb5..617c9d6983 100644 --- a/src/components/structures/login/Registration.js +++ b/src/components/structures/auth/Registration.js @@ -24,7 +24,7 @@ import PropTypes from 'prop-types'; import sdk from '../../../index'; import MatrixClientPeg from '../../../MatrixClientPeg'; -import RegistrationForm from '../../views/login/RegistrationForm'; +import RegistrationForm from '../../views/auth/RegistrationForm'; import RtsClient from '../../../RtsClient'; import { _t, _td } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; @@ -396,12 +396,12 @@ module.exports = React.createClass({ }, render: function() { - const LoginHeader = sdk.getComponent('login.LoginHeader'); - const LoginFooter = sdk.getComponent('login.LoginFooter'); - const LoginPage = sdk.getComponent('login.LoginPage'); + const LoginHeader = sdk.getComponent('auth.LoginHeader'); + const LoginFooter = sdk.getComponent('auth.LoginFooter'); + const LoginPage = sdk.getComponent('auth.LoginPage'); const InteractiveAuth = sdk.getComponent('structures.InteractiveAuth'); const Spinner = sdk.getComponent("elements.Spinner"); - const ServerConfig = sdk.getComponent('views.login.ServerConfig'); + const ServerConfig = sdk.getComponent('views.auth.ServerConfig'); let registerBody; if (this.state.doingUIAuth) { @@ -471,7 +471,7 @@ module.exports = React.createClass({ ); } - const LanguageSelector = sdk.getComponent('structures.login.LanguageSelector'); + const LanguageSelector = sdk.getComponent('structures.auth.LanguageSelector'); return ( diff --git a/src/components/views/login/CaptchaForm.js b/src/components/views/auth/CaptchaForm.js similarity index 100% rename from src/components/views/login/CaptchaForm.js rename to src/components/views/auth/CaptchaForm.js diff --git a/src/components/views/login/CountryDropdown.js b/src/components/views/auth/CountryDropdown.js similarity index 100% rename from src/components/views/login/CountryDropdown.js rename to src/components/views/auth/CountryDropdown.js diff --git a/src/components/views/login/CustomServerDialog.js b/src/components/views/auth/CustomServerDialog.js similarity index 100% rename from src/components/views/login/CustomServerDialog.js rename to src/components/views/auth/CustomServerDialog.js diff --git a/src/components/views/login/InteractiveAuthEntryComponents.js b/src/components/views/auth/InteractiveAuthEntryComponents.js similarity index 99% rename from src/components/views/login/InteractiveAuthEntryComponents.js rename to src/components/views/auth/InteractiveAuthEntryComponents.js index 73b46959b0..6a78898179 100644 --- a/src/components/views/login/InteractiveAuthEntryComponents.js +++ b/src/components/views/auth/InteractiveAuthEntryComponents.js @@ -187,7 +187,7 @@ export const RecaptchaAuthEntry = React.createClass({ return ; } - const CaptchaForm = sdk.getComponent("views.login.CaptchaForm"); + const CaptchaForm = sdk.getComponent("views.auth.CaptchaForm"); const sitePublicKey = this.props.stageParams.public_key; let errorSection; diff --git a/src/components/views/login/LoginFooter.js b/src/components/views/auth/LoginFooter.js similarity index 100% rename from src/components/views/login/LoginFooter.js rename to src/components/views/auth/LoginFooter.js diff --git a/src/components/views/login/LoginHeader.js b/src/components/views/auth/LoginHeader.js similarity index 100% rename from src/components/views/login/LoginHeader.js rename to src/components/views/auth/LoginHeader.js diff --git a/src/components/views/login/LoginPage.js b/src/components/views/auth/LoginPage.js similarity index 100% rename from src/components/views/login/LoginPage.js rename to src/components/views/auth/LoginPage.js diff --git a/src/components/views/login/PasswordLogin.js b/src/components/views/auth/PasswordLogin.js similarity index 99% rename from src/components/views/login/PasswordLogin.js rename to src/components/views/auth/PasswordLogin.js index 59d4db379c..1d36c52a24 100644 --- a/src/components/views/login/PasswordLogin.js +++ b/src/components/views/auth/PasswordLogin.js @@ -201,7 +201,7 @@ class PasswordLogin extends React.Component { disabled={disabled} />; case PasswordLogin.LOGIN_FIELD_PHONE: { - const CountryDropdown = sdk.getComponent('views.login.CountryDropdown'); + const CountryDropdown = sdk.getComponent('views.auth.CountryDropdown'); classes.mx_Login_phoneNumberField = true; classes.mx_Login_field_has_prefix = true; classes.error = this.props.loginIncorrect && !this.state.phoneNumber; diff --git a/src/components/views/login/RegistrationForm.js b/src/components/views/auth/RegistrationForm.js similarity index 99% rename from src/components/views/login/RegistrationForm.js rename to src/components/views/auth/RegistrationForm.js index 137aeada91..a0fc79b947 100644 --- a/src/components/views/login/RegistrationForm.js +++ b/src/components/views/auth/RegistrationForm.js @@ -323,7 +323,7 @@ module.exports = React.createClass({ } } - const CountryDropdown = sdk.getComponent('views.login.CountryDropdown'); + const CountryDropdown = sdk.getComponent('views.auth.CountryDropdown'); let phoneSection; if (!SdkConfig.get().disable_3pid_login) { const phonePlaceholder = this._authStepIsRequired('m.login.msisdn') ? _t("Mobile phone number") : _t("Mobile phone number (optional)"); diff --git a/src/components/views/login/ServerConfig.js b/src/components/views/auth/ServerConfig.js similarity index 98% rename from src/components/views/login/ServerConfig.js rename to src/components/views/auth/ServerConfig.js index 2f04011273..57535e80d8 100644 --- a/src/components/views/login/ServerConfig.js +++ b/src/components/views/auth/ServerConfig.js @@ -138,7 +138,7 @@ module.exports = React.createClass({ }, showHelpPopup: function() { - const CustomServerDialog = sdk.getComponent('login.CustomServerDialog'); + const CustomServerDialog = sdk.getComponent('auth.CustomServerDialog'); Modal.createTrackedDialog('Custom Server Dialog', '', CustomServerDialog); }, diff --git a/src/components/views/settings/AddPhoneNumber.js b/src/components/views/settings/AddPhoneNumber.js index 82169c9868..27164e6517 100644 --- a/src/components/views/settings/AddPhoneNumber.js +++ b/src/components/views/settings/AddPhoneNumber.js @@ -141,7 +141,7 @@ export default withMatrixClient(React.createClass({ return
; } - const CountryDropdown = sdk.getComponent('views.login.CountryDropdown'); + const CountryDropdown = sdk.getComponent('views.auth.CountryDropdown'); // XXX: This CSS relies on the CSS surrounding it in UserSettings as its in // a tabular format to align the submit buttons return ( diff --git a/src/stores/LifecycleStore.js b/src/stores/LifecycleStore.js index 2ce3be5a33..fcdfe93cf9 100644 --- a/src/stores/LifecycleStore.js +++ b/src/stores/LifecycleStore.js @@ -22,8 +22,8 @@ const INITIAL_STATE = { }; /** - * A class for storing application state to do with login/registration. This is a simple - * flux store that listens for actions and updates its state accordingly, informing any + * A class for storing application state to do with authentication. This is a simple flux + * store that listens for actions and updates its state accordingly, informing any * listeners (views) of state changes. */ class LifecycleStore extends Store { diff --git a/test/components/structures/login/Registration-test.js b/test/components/structures/auth/Registration-test.js similarity index 98% rename from test/components/structures/login/Registration-test.js rename to test/components/structures/auth/Registration-test.js index 7287bb0d95..4827bf4c12 100644 --- a/test/components/structures/login/Registration-test.js +++ b/test/components/structures/auth/Registration-test.js @@ -23,7 +23,7 @@ const expect = require('expect'); const testUtils = require('test-utils'); const sdk = require('matrix-react-sdk'); -const Registration = sdk.getComponent('structures.login.Registration'); +const Registration = sdk.getComponent('structures.auth.Registration'); let rtsClient; let client; diff --git a/test/components/views/login/RegistrationForm-test.js b/test/components/views/auth/RegistrationForm-test.js similarity index 97% rename from test/components/views/login/RegistrationForm-test.js rename to test/components/views/auth/RegistrationForm-test.js index 2d1c1be026..265f158bb9 100644 --- a/test/components/views/login/RegistrationForm-test.js +++ b/test/components/views/auth/RegistrationForm-test.js @@ -23,7 +23,7 @@ const expect = require('expect'); const testUtils = require('test-utils'); const sdk = require('matrix-react-sdk'); -const RegistrationForm = sdk.getComponent('views.login.RegistrationForm'); +const RegistrationForm = sdk.getComponent('views.auth.RegistrationForm'); const TEAM_CONFIG = { supportEmail: "support@some.domain", From c7354f483b8d5260e752fad55e01d3482a9ffb72 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Jan 2019 17:49:50 -0600 Subject: [PATCH 09/11] Rename LoginBox to AuthButtons This component displays login and register buttons. It's currently used in the composer when viewing a room as a guest. The name is confusing because the login flow uses are very similarly named `mx_Login_box` as a wrapping around forms, which is totally different than these buttons. Additionally, the components is moved to `views/auth` since it is very simple and auth related. --- res/css/_components.scss | 2 +- .../auth/_AuthButtons.scss} | 9 +++++---- src/components/structures/RoomView.js | 4 ++-- .../LoginBox.js => views/auth/AuthButtons.js} | 18 +++++++++--------- 4 files changed, 17 insertions(+), 16 deletions(-) rename res/css/{structures/_LoginBox.scss => views/auth/_AuthButtons.scss} (87%) rename src/components/{structures/LoginBox.js => views/auth/AuthButtons.js} (67%) diff --git a/res/css/_components.scss b/res/css/_components.scss index a1b575a0a1..998e1754c8 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -8,7 +8,6 @@ @import "./structures/_GroupView.scss"; @import "./structures/_HomePage.scss"; @import "./structures/_LeftPanel.scss"; -@import "./structures/_LoginBox.scss"; @import "./structures/_MatrixChat.scss"; @import "./structures/_MyGroups.scss"; @import "./structures/_NotificationPanel.scss"; @@ -24,6 +23,7 @@ @import "./structures/_UserSettings.scss"; @import "./structures/_ViewSource.scss"; @import "./structures/auth/_Login.scss"; +@import "./views/auth/_AuthButtons.scss"; @import "./views/auth/_InteractiveAuthEntryComponents.scss"; @import "./views/auth/_ServerConfig.scss"; @import "./views/avatars/_BaseAvatar.scss"; diff --git a/res/css/structures/_LoginBox.scss b/res/css/views/auth/_AuthButtons.scss similarity index 87% rename from res/css/structures/_LoginBox.scss rename to res/css/views/auth/_AuthButtons.scss index 0a3e21a980..553adeee14 100644 --- a/res/css/structures/_LoginBox.scss +++ b/res/css/views/auth/_AuthButtons.scss @@ -1,5 +1,6 @@ /* Copyright 2017 OpenMarket Ltd +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. @@ -14,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_LoginBox { +.mx_AuthButtons { min-height: 24px; height: unset !important; padding-top: 13px !important; @@ -22,13 +23,13 @@ limitations under the License. order: 4; } -.mx_LoginBox_loginButton_wrapper { +.mx_AuthButtons_loginButton_wrapper { text-align: center; width: 100%; } -.mx_LoginBox_loginButton, -.mx_LoginBox_registerButton { +.mx_AuthButtons_loginButton, +.mx_AuthButtons_registerButton { margin-top: 3px; height: 40px; border: 0px; diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index c34b618645..f63e5b3273 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -1757,8 +1757,8 @@ module.exports = React.createClass({ } if (MatrixClientPeg.get().isGuest()) { - const LoginBox = sdk.getComponent('structures.LoginBox'); - messageComposer = ; + const AuthButtons = sdk.getComponent('views.auth.AuthButtons'); + messageComposer = ; } // TODO: Why aren't we storing the term/scope/count in this format diff --git a/src/components/structures/LoginBox.js b/src/components/views/auth/AuthButtons.js similarity index 67% rename from src/components/structures/LoginBox.js rename to src/components/views/auth/AuthButtons.js index 168014daa5..35bfabbbca 100644 --- a/src/components/structures/LoginBox.js +++ b/src/components/views/auth/AuthButtons.js @@ -1,6 +1,6 @@ /* Copyright 2017 Vector Creations Ltd -Copyright 2018 New Vector Ltd +Copyright 2018, 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. @@ -18,12 +18,12 @@ limitations under the License. 'use strict'; const React = require('react'); -import { _t } from '../../languageHandler'; -const dis = require('../../dispatcher'); -const AccessibleButton = require('../../components/views/elements/AccessibleButton'); +import { _t } from '../../../languageHandler'; +const dis = require('../../../dispatcher'); +const AccessibleButton = require('../elements/AccessibleButton'); module.exports = React.createClass({ - displayName: 'LoginBox', + displayName: 'AuthButtons', propTypes: { }, @@ -38,18 +38,18 @@ module.exports = React.createClass({ render: function() { const loginButton = ( -
- +
+ { _t("Login") } - + { _t("Register") }
); return ( -
+
{ loginButton }
); From 3bd765f63f985862fe646b59bff597efcfdc547c Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Jan 2019 18:33:17 -0600 Subject: [PATCH 10/11] Rename LoginPage, Header, Footer views to Auth* --- res/css/_components.scss | 3 ++ res/css/structures/auth/_Login.scss | 41 +------------------ res/css/views/auth/_AuthFooter.scss | 28 +++++++++++++ res/css/views/auth/_AuthHeader.scss | 25 +++++++++++ res/css/views/auth/_AuthPage.scss | 32 +++++++++++++++ .../structures/auth/ForgotPassword.js | 14 +++---- src/components/structures/auth/Login.js | 14 +++---- .../structures/auth/PostRegistration.js | 10 ++--- .../structures/auth/Registration.js | 14 +++---- .../auth/{LoginFooter.js => AuthFooter.js} | 5 ++- .../auth/{LoginHeader.js => AuthHeader.js} | 9 ++-- .../views/auth/{LoginPage.js => AuthPage.js} | 4 +- 12 files changed, 126 insertions(+), 73 deletions(-) create mode 100644 res/css/views/auth/_AuthFooter.scss create mode 100644 res/css/views/auth/_AuthHeader.scss create mode 100644 res/css/views/auth/_AuthPage.scss rename src/components/views/auth/{LoginFooter.js => AuthFooter.js} (89%) rename src/components/views/auth/{LoginHeader.js => AuthHeader.js} (77%) rename src/components/views/auth/{LoginPage.js => AuthPage.js} (91%) diff --git a/res/css/_components.scss b/res/css/_components.scss index 998e1754c8..92070483f5 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -24,6 +24,9 @@ @import "./structures/_ViewSource.scss"; @import "./structures/auth/_Login.scss"; @import "./views/auth/_AuthButtons.scss"; +@import "./views/auth/_AuthFooter.scss"; +@import "./views/auth/_AuthHeader.scss"; +@import "./views/auth/_AuthPage.scss"; @import "./views/auth/_InteractiveAuthEntryComponents.scss"; @import "./views/auth/_ServerConfig.scss"; @import "./views/avatars/_BaseAvatar.scss"; diff --git a/res/css/structures/auth/_Login.scss b/res/css/structures/auth/_Login.scss index 1264d2a30f..a5f62089d6 100644 --- a/res/css/structures/auth/_Login.scss +++ b/res/css/structures/auth/_Login.scss @@ -1,5 +1,6 @@ /* Copyright 2015, 2016 OpenMarket Ltd +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. @@ -14,23 +15,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_Login { - width: 100%; - height: 100%; - - display: flex; - align-items: center; - justify-content: center; - - overflow: auto; -} - -.mx_Login h2 { - font-weight: 300; - margin-top: 32px; - margin-bottom: 20px; -} - .mx_Login_box { width: 300px; min-height: 450px; @@ -39,16 +23,6 @@ limitations under the License. margin: auto; } -.mx_Login_logo { - text-align: center; - height: 150px; - margin-bottom: 45px; -} - -.mx_Login_logo img { - max-height: 100% -} - .mx_Login_support { text-align: center; font-size: 13px; @@ -115,19 +89,6 @@ limitations under the License. color: $primary-fg-color; } -.mx_Login_links { - display: block; - text-align: center; - margin-top: 15px; - width: 100%; - font-size: 13px; - opacity: 0.8; -} - -.mx_Login_links a:link { - color: $primary-fg-color; -} - .mx_Login_prompt { padding-top: 15px; padding-bottom: 15px; diff --git a/res/css/views/auth/_AuthFooter.scss b/res/css/views/auth/_AuthFooter.scss new file mode 100644 index 0000000000..4737513125 --- /dev/null +++ b/res/css/views/auth/_AuthFooter.scss @@ -0,0 +1,28 @@ +/* +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_AuthFooter { + display: block; + text-align: center; + margin-top: 15px; + width: 100%; + font-size: 13px; + opacity: 0.8; +} + +.mx_AuthFooter a:link { + color: $primary-fg-color; +} diff --git a/res/css/views/auth/_AuthHeader.scss b/res/css/views/auth/_AuthHeader.scss new file mode 100644 index 0000000000..58df178aa9 --- /dev/null +++ b/res/css/views/auth/_AuthHeader.scss @@ -0,0 +1,25 @@ +/* +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_AuthHeader_logo { + text-align: center; + height: 150px; + margin-bottom: 45px; +} + +.mx_AuthHeader_logo img { + max-height: 100% +} diff --git a/res/css/views/auth/_AuthPage.scss b/res/css/views/auth/_AuthPage.scss new file mode 100644 index 0000000000..d87a906275 --- /dev/null +++ b/res/css/views/auth/_AuthPage.scss @@ -0,0 +1,32 @@ +/* +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_AuthPage { + width: 100%; + height: 100%; + + display: flex; + align-items: center; + justify-content: center; + + overflow: auto; +} + +.mx_AuthPage h2 { + font-weight: 300; + margin-top: 32px; + margin-bottom: 20px; +} diff --git a/src/components/structures/auth/ForgotPassword.js b/src/components/structures/auth/ForgotPassword.js index 6d5da4f2b7..7c763b0c77 100644 --- a/src/components/structures/auth/ForgotPassword.js +++ b/src/components/structures/auth/ForgotPassword.js @@ -183,9 +183,9 @@ module.exports = React.createClass({ }, render: function() { - const LoginPage = sdk.getComponent("auth.LoginPage"); - const LoginHeader = sdk.getComponent("auth.LoginHeader"); - const LoginFooter = sdk.getComponent("auth.LoginFooter"); + const AuthPage = sdk.getComponent("auth.AuthPage"); + const AuthHeader = sdk.getComponent("auth.AuthHeader"); + const AuthFooter = sdk.getComponent("auth.AuthFooter"); const ServerConfig = sdk.getComponent("auth.ServerConfig"); const Spinner = sdk.getComponent("elements.Spinner"); @@ -272,7 +272,7 @@ module.exports = React.createClass({ { _t('Create an account') } - +
); @@ -280,12 +280,12 @@ module.exports = React.createClass({ return ( - +
- + { resetPasswordJsx }
-
+ ); }, }); diff --git a/src/components/structures/auth/Login.js b/src/components/structures/auth/Login.js index a1f0327835..069e3aebb6 100644 --- a/src/components/structures/auth/Login.js +++ b/src/components/structures/auth/Login.js @@ -515,9 +515,9 @@ module.exports = React.createClass({ render: function() { const Loader = sdk.getComponent("elements.Spinner"); - const LoginPage = sdk.getComponent("auth.LoginPage"); - const LoginHeader = sdk.getComponent("auth.LoginHeader"); - const LoginFooter = sdk.getComponent("auth.LoginFooter"); + const AuthPage = sdk.getComponent("auth.AuthPage"); + const AuthHeader = sdk.getComponent("auth.AuthHeader"); + const AuthFooter = sdk.getComponent("auth.AuthFooter"); const ServerConfig = sdk.getComponent("auth.ServerConfig"); const loader = this.state.busy ?
: null; @@ -558,9 +558,9 @@ module.exports = React.createClass({ const LanguageSelector = sdk.getComponent('structures.auth.LanguageSelector'); return ( - +
- +
{ header } { errorTextSection } @@ -571,10 +571,10 @@ module.exports = React.createClass({ { loginAsGuestJsx } - +
-
+ ); }, }); diff --git a/src/components/structures/auth/PostRegistration.js b/src/components/structures/auth/PostRegistration.js index 826db89b93..78622695cf 100644 --- a/src/components/structures/auth/PostRegistration.js +++ b/src/components/structures/auth/PostRegistration.js @@ -60,12 +60,12 @@ module.exports = React.createClass({ render: function() { const ChangeDisplayName = sdk.getComponent('settings.ChangeDisplayName'); const ChangeAvatar = sdk.getComponent('settings.ChangeAvatar'); - const LoginPage = sdk.getComponent('auth.LoginPage'); - const LoginHeader = sdk.getComponent('auth.LoginHeader'); + const AuthPage = sdk.getComponent('auth.AuthPage'); + const AuthHeader = sdk.getComponent('auth.AuthHeader'); return ( - +
- +
{ _t('Set a display name:') } @@ -76,7 +76,7 @@ module.exports = React.createClass({ { this.state.errorString }
-
+ ); }, }); diff --git a/src/components/structures/auth/Registration.js b/src/components/structures/auth/Registration.js index 617c9d6983..bd5a3a3fda 100644 --- a/src/components/structures/auth/Registration.js +++ b/src/components/structures/auth/Registration.js @@ -396,9 +396,9 @@ module.exports = React.createClass({ }, render: function() { - const LoginHeader = sdk.getComponent('auth.LoginHeader'); - const LoginFooter = sdk.getComponent('auth.LoginFooter'); - const LoginPage = sdk.getComponent('auth.LoginPage'); + const AuthHeader = sdk.getComponent('auth.AuthHeader'); + const AuthFooter = sdk.getComponent('auth.AuthFooter'); + const AuthPage = sdk.getComponent('auth.AuthPage'); const InteractiveAuth = sdk.getComponent('structures.InteractiveAuth'); const Spinner = sdk.getComponent("elements.Spinner"); const ServerConfig = sdk.getComponent('views.auth.ServerConfig'); @@ -474,9 +474,9 @@ module.exports = React.createClass({ const LanguageSelector = sdk.getComponent('structures.auth.LanguageSelector'); return ( - +
- - +
-
+ ); }, }); diff --git a/src/components/views/auth/LoginFooter.js b/src/components/views/auth/AuthFooter.js similarity index 89% rename from src/components/views/auth/LoginFooter.js rename to src/components/views/auth/AuthFooter.js index 392d36e288..ea43bf322c 100644 --- a/src/components/views/auth/LoginFooter.js +++ b/src/components/views/auth/AuthFooter.js @@ -1,5 +1,6 @@ /* Copyright 2015, 2016 OpenMarket Ltd +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. @@ -20,11 +21,11 @@ import { _t } from '../../../languageHandler'; import React from 'react'; module.exports = React.createClass({ - displayName: 'LoginFooter', + displayName: 'AuthFooter', render: function() { return ( -
+ ); diff --git a/src/components/views/auth/LoginHeader.js b/src/components/views/auth/AuthHeader.js similarity index 77% rename from src/components/views/auth/LoginHeader.js rename to src/components/views/auth/AuthHeader.js index cd1f9c6a28..08c9ad41c9 100644 --- a/src/components/views/auth/LoginHeader.js +++ b/src/components/views/auth/AuthHeader.js @@ -1,5 +1,6 @@ /* Copyright 2015, 2016 OpenMarket Ltd +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. @@ -19,12 +20,14 @@ limitations under the License. const React = require('react'); module.exports = React.createClass({ - displayName: 'LoginHeader', + displayName: 'AuthHeader', render: function() { return ( -
- Matrix +
+
+ Matrix +
); }, diff --git a/src/components/views/auth/LoginPage.js b/src/components/views/auth/AuthPage.js similarity index 91% rename from src/components/views/auth/LoginPage.js rename to src/components/views/auth/AuthPage.js index 83da8fa60b..09540885c6 100644 --- a/src/components/views/auth/LoginPage.js +++ b/src/components/views/auth/AuthPage.js @@ -20,11 +20,11 @@ limitations under the License. const React = require('react'); module.exports = React.createClass({ - displayName: 'LoginPage', + displayName: 'AuthPage', render: function() { return ( -
+
{ this.props.children }
); From 1d01ac398c58fc2c0ebe05988f3aeca4c4fb72d4 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 21 Jan 2019 18:49:28 -0600 Subject: [PATCH 11/11] Rename `mx_Login_box` to `mx_AuthPage_modal` and fold into `AuthPage` --- res/css/structures/auth/_Login.scss | 8 ------ res/css/views/auth/_AuthPage.scss | 8 ++++++ .../structures/auth/ForgotPassword.js | 6 ++--- src/components/structures/auth/Login.js | 26 +++++++++---------- .../structures/auth/PostRegistration.js | 20 +++++++------- .../structures/auth/Registration.js | 26 +++++++++---------- src/components/views/auth/AuthPage.js | 4 ++- 7 files changed, 46 insertions(+), 52 deletions(-) diff --git a/res/css/structures/auth/_Login.scss b/res/css/structures/auth/_Login.scss index a5f62089d6..c4eebc48a1 100644 --- a/res/css/structures/auth/_Login.scss +++ b/res/css/structures/auth/_Login.scss @@ -15,14 +15,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_Login_box { - width: 300px; - min-height: 450px; - padding-top: 50px; - padding-bottom: 50px; - margin: auto; -} - .mx_Login_support { text-align: center; font-size: 13px; diff --git a/res/css/views/auth/_AuthPage.scss b/res/css/views/auth/_AuthPage.scss index d87a906275..6916f1d92a 100644 --- a/res/css/views/auth/_AuthPage.scss +++ b/res/css/views/auth/_AuthPage.scss @@ -30,3 +30,11 @@ limitations under the License. margin-top: 32px; margin-bottom: 20px; } + +.mx_AuthPage_modal { + width: 300px; + min-height: 450px; + padding-top: 50px; + padding-bottom: 50px; + margin: auto; +} diff --git a/src/components/structures/auth/ForgotPassword.js b/src/components/structures/auth/ForgotPassword.js index 7c763b0c77..ab0f660be0 100644 --- a/src/components/structures/auth/ForgotPassword.js +++ b/src/components/structures/auth/ForgotPassword.js @@ -281,10 +281,8 @@ module.exports = React.createClass({ return ( -
- - { resetPasswordJsx } -
+ + { resetPasswordJsx }
); }, diff --git a/src/components/structures/auth/Login.js b/src/components/structures/auth/Login.js index 069e3aebb6..c64223ba48 100644 --- a/src/components/structures/auth/Login.js +++ b/src/components/structures/auth/Login.js @@ -559,20 +559,18 @@ module.exports = React.createClass({ return ( -
- -
- { header } - { errorTextSection } - { this.componentForStep(this.state.currentFlow) } - { serverConfig } - - { _t('Create an account') } - - { loginAsGuestJsx } - - -
+ +
+ { header } + { errorTextSection } + { this.componentForStep(this.state.currentFlow) } + { serverConfig } + + { _t('Create an account') } + + { loginAsGuestJsx } + +
); diff --git a/src/components/structures/auth/PostRegistration.js b/src/components/structures/auth/PostRegistration.js index 78622695cf..fff326f6ac 100644 --- a/src/components/structures/auth/PostRegistration.js +++ b/src/components/structures/auth/PostRegistration.js @@ -64,17 +64,15 @@ module.exports = React.createClass({ const AuthHeader = sdk.getComponent('auth.AuthHeader'); return ( -
- -
- { _t('Set a display name:') } - - { _t('Upload an avatar:') } - - - { this.state.errorString } -
+ +
+ { _t('Set a display name:') } + + { _t('Upload an avatar:') } + + + { this.state.errorString }
); diff --git a/src/components/structures/auth/Registration.js b/src/components/structures/auth/Registration.js index bd5a3a3fda..39f7964281 100644 --- a/src/components/structures/auth/Registration.js +++ b/src/components/structures/auth/Registration.js @@ -475,20 +475,18 @@ module.exports = React.createClass({ return ( -
- - { header } - { registerBody } - { signIn } - { errorText } - - -
+ + { header } + { registerBody } + { signIn } + { errorText } + +
); }, diff --git a/src/components/views/auth/AuthPage.js b/src/components/views/auth/AuthPage.js index 09540885c6..d5f82f7264 100644 --- a/src/components/views/auth/AuthPage.js +++ b/src/components/views/auth/AuthPage.js @@ -25,7 +25,9 @@ module.exports = React.createClass({ render: function() { return (
- { this.props.children } +
+ { this.props.children } +
); },