Annotate guest state as class on home page

pull/21833/head
J. Ryan Stinnett 2019-02-01 15:33:05 -06:00
parent 3bfd603dab
commit 88fc2fb47a
1 changed files with 9 additions and 2 deletions

View File

@ -24,6 +24,7 @@ import { _t } from '../../languageHandler';
import sanitizeHtml from 'sanitize-html'; import sanitizeHtml from 'sanitize-html';
import sdk from '../../index'; import sdk from '../../index';
import { MatrixClient } from 'matrix-js-sdk'; import { MatrixClient } from 'matrix-js-sdk';
import classnames from 'classnames';
class HomePage extends React.Component { class HomePage extends React.Component {
static displayName = 'HomePage'; static displayName = 'HomePage';
@ -80,16 +81,22 @@ class HomePage extends React.Component {
} }
render() { render() {
const isGuest = this.context.matrixClient.isGuest();
const classes = classnames({
mx_HomePage: true,
mx_HomePage_guest: isGuest,
});
if (this.state.iframeSrc) { if (this.state.iframeSrc) {
return ( return (
<div className="mx_HomePage"> <div className={classes}>
<iframe src={ this.state.iframeSrc } /> <iframe src={ this.state.iframeSrc } />
</div> </div>
); );
} else { } else {
const GeminiScrollbarWrapper = sdk.getComponent("elements.GeminiScrollbarWrapper"); const GeminiScrollbarWrapper = sdk.getComponent("elements.GeminiScrollbarWrapper");
return ( return (
<GeminiScrollbarWrapper autoshow={true} className="mx_HomePage"> <GeminiScrollbarWrapper autoshow={true} className={classes}>
<div className="mx_HomePage_body" dangerouslySetInnerHTML={{ __html: this.state.page }}> <div className="mx_HomePage_body" dangerouslySetInnerHTML={{ __html: this.state.page }}>
</div> </div>
</GeminiScrollbarWrapper> </GeminiScrollbarWrapper>