Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Remove guest warning bar
Browse files Browse the repository at this point in the history
  • Loading branch information
jryans committed Feb 1, 2019
1 parent 22178f2 commit 889450e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 67 deletions.
17 changes: 0 additions & 17 deletions res/css/structures/_HomePage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,3 @@ limitations under the License.
height: 100%;
border: 0px;
}

.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;
}
48 changes: 0 additions & 48 deletions src/components/structures/HomePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ 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';
Expand All @@ -34,10 +32,6 @@ class HomePage extends React.Component {
homePageUrl: PropTypes.string,
};

static contextTypes = {
matrixClient: PropTypes.instanceOf(MatrixClient),
};

state = {
iframeSrc: '',
page: '',
Expand Down Expand Up @@ -80,59 +74,17 @@ class HomePage extends React.Component {
this._unmounted = true;
}

onLoginClick(ev) {
ev.preventDefault();
ev.stopPropagation();
dis.dispatch({ action: 'start_login' });
}

onRegisterClick(ev) {
ev.preventDefault();
ev.stopPropagation();
dis.dispatch({ action: 'start_registration' });
}

render() {
let guestWarning = "";
if (this.context.matrixClient.isGuest()) {
guestWarning = (
<div className="mx_HomePage_guest_warning">
<img src={require("../../../res/img/warning.svg")} width="24" height="23" />
<div>
<div>
{ _t("You are currently using Riot anonymously as a guest.") }
</div>
<div>
{ _t(
'If you would like to create a Matrix account you can <a>register</a> now.',
{},
{ 'a': (sub) => <a href="#" onClick={this.onRegisterClick}>{ sub }</a> },
) }
</div>
<div>
{ _t(
'If you already have a Matrix account you can <a>log in</a> instead.',
{},
{ 'a': (sub) => <a href="#" onClick={this.onLoginClick}>{ sub }</a> },
) }
</div>
</div>
</div>
);
}

if (this.state.iframeSrc) {
return (
<div className="mx_HomePage">
{ guestWarning }
<iframe src={ this.state.iframeSrc } />
</div>
);
} else {
const GeminiScrollbarWrapper = sdk.getComponent("elements.GeminiScrollbarWrapper");
return (
<GeminiScrollbarWrapper autoshow={true} className="mx_HomePage">
{ guestWarning }
<div className="mx_HomePage_body" dangerouslySetInnerHTML={{ __html: this.state.page }}>
</div>
</GeminiScrollbarWrapper>
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1277,8 +1277,6 @@
"This homeserver does not support communities": "This homeserver does not support communities",
"Failed to load %(groupId)s": "Failed to load %(groupId)s",
"Couldn't load home page": "Couldn't load home page",
"You are currently using Riot anonymously as a guest.": "You are currently using Riot anonymously as a guest.",
"If you would like to create a Matrix account you can <a>register</a> now.": "If you would like to create a Matrix account you can <a>register</a> now.",
"Invalid configuration: Cannot supply a default homeserver URL and a default server name": "Invalid configuration: Cannot supply a default homeserver URL and a default server name",
"Failed to reject invitation": "Failed to reject invitation",
"This room is not public. You will not be able to rejoin without an invite.": "This room is not public. You will not be able to rejoin without an invite.",
Expand Down

0 comments on commit 889450e

Please sign in to comment.