Use localStorage `mx_team_token` to decide welcome page
This commit is contained in:
parent
40609d7da3
commit
4a34bee2dc
|
@ -115,7 +115,7 @@ module.exports = React.createClass({
|
||||||
var TintableSvg = sdk.getComponent('elements.TintableSvg');
|
var TintableSvg = sdk.getComponent('elements.TintableSvg');
|
||||||
|
|
||||||
var homeButton;
|
var homeButton;
|
||||||
if (SdkConfig.get().home_page) {
|
if (window.localStorage.getItem('mx_team_token')) {
|
||||||
homeButton = (
|
homeButton = (
|
||||||
<div className="mx_BottomLeftMenu_homePage" onClick={ this.onHomeClick } onMouseEnter={ this.onHomeMouseEnter } onMouseLeave={ this.onHomeMouseLeave } >
|
<div className="mx_BottomLeftMenu_homePage" onClick={ this.onHomeClick } onMouseEnter={ this.onHomeMouseEnter } onMouseLeave={ this.onHomeMouseLeave } >
|
||||||
<TintableSvg src="img/icons-home.svg" width="25" height="25" />
|
<TintableSvg src="img/icons-home.svg" width="25" height="25" />
|
||||||
|
|
|
@ -16,8 +16,6 @@ limitations under the License.
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import 'isomorphic-fetch';
|
|
||||||
|
|
||||||
var React = require("react");
|
var React = require("react");
|
||||||
var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
|
var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
|
||||||
var sdk = require('matrix-react-sdk');
|
var sdk = require('matrix-react-sdk');
|
||||||
|
@ -26,40 +24,17 @@ module.exports = React.createClass({
|
||||||
displayName: 'HomePage',
|
displayName: 'HomePage',
|
||||||
|
|
||||||
propTypes: {
|
propTypes: {
|
||||||
config: React.PropTypes.object.isRequired,
|
teamToken: React.PropTypes.string.isRequired,
|
||||||
collapsedRhs: React.PropTypes.bool,
|
collapsedRhs: React.PropTypes.bool,
|
||||||
},
|
},
|
||||||
|
|
||||||
getInitialState: function() {
|
|
||||||
return {
|
|
||||||
page: ""
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
componentWillMount: function() {
|
|
||||||
fetch(this.props.config.home_page).then(
|
|
||||||
(response)=>{
|
|
||||||
return response.text();
|
|
||||||
},
|
|
||||||
(error)=>{
|
|
||||||
console.log(error);
|
|
||||||
this.setState({ page: "Couldn't load home page" });
|
|
||||||
}
|
|
||||||
).done(
|
|
||||||
(body)=>{
|
|
||||||
this.setState({ page: body });
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
// const SimpleRoomHeader = sdk.getComponent('rooms.SimpleRoomHeader');
|
// const SimpleRoomHeader = sdk.getComponent('rooms.SimpleRoomHeader');
|
||||||
// <SimpleRoomHeader title="Welcome to Riot" collapsedRhs={ this.props.collapsedRhs }/>
|
// <SimpleRoomHeader title="Welcome to Riot" collapsedRhs={ this.props.collapsedRhs }/>
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx_HomePage">
|
<div className="mx_HomePage">
|
||||||
<div className="mx_HomePage_body" dangerouslySetInnerHTML={{ __html: this.state.page }}>
|
<iframe src={`http://localhost:7000/static/${this.props.teamToken}/welcome.html`} style={{width: '100%', border: 'none'}}/>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
@import "./matrix-react-sdk/views/voip/_VideoView.scss";
|
@import "./matrix-react-sdk/views/voip/_VideoView.scss";
|
||||||
@import "./vector-web/_fonts.scss";
|
@import "./vector-web/_fonts.scss";
|
||||||
@import "./vector-web/structures/_CompatibilityPage.scss";
|
@import "./vector-web/structures/_CompatibilityPage.scss";
|
||||||
|
@import "./vector-web/structures/_HomePage.scss";
|
||||||
@import "./vector-web/structures/_LeftPanel.scss";
|
@import "./vector-web/structures/_LeftPanel.scss";
|
||||||
@import "./vector-web/structures/_RightPanel.scss";
|
@import "./vector-web/structures/_RightPanel.scss";
|
||||||
@import "./vector-web/structures/_RoomDirectory.scss";
|
@import "./vector-web/structures/_RoomDirectory.scss";
|
||||||
|
|
|
@ -20,6 +20,11 @@ limitations under the License.
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
.mx_HomePage iframe {
|
||||||
|
width: 100%;
|
||||||
|
height: 90%;
|
||||||
|
border: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.mx_HomePage_body {
|
.mx_HomePage_body {
|
||||||
margin-left: 63px;
|
margin-left: 63px;
|
Loading…
Reference in New Issue