Implement default welcome page and allow custom URL /w config

counterpart to https://github.com/matrix-org/matrix-react-sdk/pull/922
This commit is contained in:
Luke Barnard 2017-05-24 17:58:03 +01:00
parent 299dc7fe84
commit efb6316ba0
6 changed files with 29 additions and 19 deletions

View file

@ -25,15 +25,24 @@ module.exports = React.createClass({
displayName: 'HomePage',
propTypes: {
// URL base of the team server.
teamServerUrl: React.PropTypes.string.isRequired,
teamToken: React.PropTypes.string.isRequired,
collapsedRhs: React.PropTypes.bool,
// Team token. Optional. If unset, the homePageUrl will be used
teamToken: React.PropTypes.string,
// URL to use as the iFrame src. Defaults to /home.html.
homePageUrl: React.PropTypes.string,
},
render: function() {
let src = this.props.homePageUrl || '/home.html';
if (this.props.teamToken) {
src = `${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`;
}
return (
<div className="mx_HomePage">
<iframe src={`${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`}/>
<iframe src={src}/>
</div>
);
}