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

Commit

Permalink
Annotate guest state as class on home page
Browse files Browse the repository at this point in the history
  • Loading branch information
jryans committed Feb 1, 2019
1 parent 3bfd603 commit 88fc2fb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/structures/HomePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { _t } from '../../languageHandler';
import sanitizeHtml from 'sanitize-html';
import sdk from '../../index';
import { MatrixClient } from 'matrix-js-sdk';
import classnames from 'classnames';

class HomePage extends React.Component {
static displayName = 'HomePage';
Expand Down Expand Up @@ -80,16 +81,22 @@ class HomePage extends React.Component {
}

render() {
const isGuest = this.context.matrixClient.isGuest();
const classes = classnames({
mx_HomePage: true,
mx_HomePage_guest: isGuest,
});

if (this.state.iframeSrc) {
return (
<div className="mx_HomePage">
<div className={classes}>
<iframe src={ this.state.iframeSrc } />
</div>
);
} else {
const GeminiScrollbarWrapper = sdk.getComponent("elements.GeminiScrollbarWrapper");
return (
<GeminiScrollbarWrapper autoshow={true} className="mx_HomePage">
<GeminiScrollbarWrapper autoshow={true} className={classes}>
<div className="mx_HomePage_body" dangerouslySetInnerHTML={{ __html: this.state.page }}>
</div>
</GeminiScrollbarWrapper>
Expand Down

0 comments on commit 88fc2fb

Please sign in to comment.