diff --git a/res/css/structures/_HomePage.scss b/res/css/structures/_HomePage.scss index cdac1bcc8a..dc3158b39d 100644 --- a/res/css/structures/_HomePage.scss +++ b/res/css/structures/_HomePage.scss @@ -33,3 +33,16 @@ limitations under the License. .mx_HomePage_body { // margin-left: 63px; } + +.mx_HomePage_guest_warning { + display: flex; + background-color: $secondary-accent-color; + border: 1px solid $accent-color; + margin: 20px; + padding: 20px 40px; + border-radius: 5px; +} + +.mx_HomePage_guest_warning img { + padding-right: 10px; +} diff --git a/res/css/views/dialogs/_EncryptedEventDialog.scss b/res/css/views/dialogs/_EncryptedEventDialog.scss index b4dd353370..0dbaae24c1 100644 --- a/res/css/views/dialogs/_EncryptedEventDialog.scss +++ b/res/css/views/dialogs/_EncryptedEventDialog.scss @@ -24,4 +24,5 @@ limitations under the License. @mixin mx_DialogButton; background-color: $primary-bg-color; color: $accent-color; -} \ No newline at end of file + margin-top: 0px; +} diff --git a/res/css/views/rooms/_MemberDeviceInfo.scss b/res/css/views/rooms/_MemberDeviceInfo.scss index 5888820e0d..d4e4bb1adf 100644 --- a/res/css/views/rooms/_MemberDeviceInfo.scss +++ b/res/css/views/rooms/_MemberDeviceInfo.scss @@ -19,7 +19,6 @@ limitations under the License. } .mx_MemberDeviceInfo.mx_DeviceVerifyButtons { - padding: 6px 0; display: flex; flex-wrap: wrap; justify-content: space-between; diff --git a/src/components/structures/HomePage.js b/src/components/structures/HomePage.js index 89053b35c7..01aabf6115 100644 --- a/src/components/structures/HomePage.js +++ b/src/components/structures/HomePage.js @@ -23,6 +23,8 @@ import request from 'browser-request'; import { _t } from '../../languageHandler'; import sanitizeHtml from 'sanitize-html'; import sdk from '../../index'; +import { MatrixClient } from 'matrix-js-sdk'; +import dis from '../../dispatcher'; class HomePage extends React.Component { static displayName = 'HomePage'; @@ -37,6 +39,10 @@ class HomePage extends React.Component { homePageUrl: PropTypes.string, }; + static contextTypes = { + matrixClient: PropTypes.instanceOf(MatrixClient), + }; + state = { iframeSrc: '', page: '', @@ -85,10 +91,47 @@ class HomePage extends React.Component { this._unmounted = true; } + onLoginClick() { + dis.dispatch({ action: 'start_login' }); + } + + onRegisterClick() { + dis.dispatch({ action: 'start_registration' }); + } + render() { + let guestWarning = ""; + if (this.context.matrixClient.isGuest()) { + guestWarning = ( +
+ +
+
+ { _t("You are currently using Riot anonymously as a guest.") } +
+
+ { _t( + 'If you would like to create a Matrix account you can register now.', + {}, + { 'a': (sub) => { sub } }, + ) } +
+
+ { _t( + 'If you already have a Matrix account you can log in instead.', + {}, + { 'a': (sub) => { sub } }, + ) } +
+
+
+ ); + } + if (this.state.iframeSrc) { return (
+ { guestWarning }