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:
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user