Annotate guest state as class on home page
This commit is contained in:
parent
3bfd603dab
commit
88fc2fb47a
1 changed files with 9 additions and 2 deletions
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue