Merge pull request #3103 from vector-im/luke/rts-welcome-pages

RTS Welcome Pages
pull/3162/head
David Baker 2017-02-07 11:52:59 +00:00 committed by GitHub
commit 2f54034afe
8 changed files with 141 additions and 0 deletions

View File

@ -34,6 +34,8 @@ import structures$LeftPanel from './components/structures/LeftPanel';
structures$LeftPanel && (module.exports.components['structures.LeftPanel'] = structures$LeftPanel);
import structures$RightPanel from './components/structures/RightPanel';
structures$RightPanel && (module.exports.components['structures.RightPanel'] = structures$RightPanel);
import structures$HomePage from './components/structures/HomePage';
structures$HomePage && (module.exports.components['structures.HomePage'] = structures$HomePage);
import structures$RoomDirectory from './components/structures/RoomDirectory';
structures$RoomDirectory && (module.exports.components['structures.RoomDirectory'] = structures$RoomDirectory);
import structures$RoomSubList from './components/structures/RoomSubList';

View File

@ -33,11 +33,17 @@ module.exports = React.createClass({
return({
directoryHover : false,
roomsHover : false,
homeHover: false,
peopleHover : false,
settingsHover : false,
teamToken: null,
});
},
componentWillMount: function() {
this.teamToken = window.localStorage.getItem('mx_team_token');
},
// Room events
onDirectoryClick: function() {
dis.dispatch({ action: 'view_room_directory' });
@ -63,6 +69,19 @@ module.exports = React.createClass({
this.setState({ roomsHover: false });
},
// Home button events
onHomeClick: function() {
dis.dispatch({ action: 'view_home_page' });
},
onHomeMouseEnter: function() {
this.setState({ homeHover: true });
},
onHomeMouseLeave: function() {
this.setState({ homeHover: false });
},
// People events
onPeopleClick: function() {
dis.dispatch({ action: 'view_create_chat' });
@ -99,9 +118,21 @@ module.exports = React.createClass({
render: function() {
var TintableSvg = sdk.getComponent('elements.TintableSvg');
var homeButton;
if (this.state.teamToken) {
homeButton = (
<AccessibleButton className="mx_BottomLeftMenu_homePage" onClick={ this.onHomeClick } onMouseEnter={ this.onHomeMouseEnter } onMouseLeave={ this.onHomeMouseLeave } >
<TintableSvg src="img/icons-home.svg" width="25" height="25" />
{ this.getLabel("Welcome page", this.state.homeHover) }
</AccessibleButton>
);
}
return (
<div className="mx_BottomLeftMenu">
<div className="mx_BottomLeftMenu_options">
{ homeButton }
<AccessibleButton className="mx_BottomLeftMenu_people" onClick={ this.onPeopleClick } onMouseEnter={ this.onPeopleMouseEnter } onMouseLeave={ this.onPeopleMouseLeave } >
<TintableSvg src="img/icons-people.svg" width="25" height="25" />
{ this.getLabel("Start chat", this.state.peopleHover) }

View File

@ -0,0 +1,40 @@
/*
Copyright 2016 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
'use strict';
import React from 'react';
import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg';
import sdk from 'matrix-react-sdk';
module.exports = React.createClass({
displayName: 'HomePage',
propTypes: {
teamServerUrl: React.PropTypes.string.isRequired,
teamToken: React.PropTypes.string.isRequired,
collapsedRhs: React.PropTypes.bool,
},
render: function() {
return (
<div className="mx_HomePage">
<iframe src={`${this.props.teamServerUrl}/static/${this.props.teamToken}/home.html`}/>
</div>
);
}
});

View File

@ -53,6 +53,7 @@
@import "./matrix-react-sdk/views/voip/_VideoView.scss";
@import "./vector-web/_fonts.scss";
@import "./vector-web/structures/_CompatibilityPage.scss";
@import "./vector-web/structures/_HomePage.scss";
@import "./vector-web/structures/_LeftPanel.scss";
@import "./vector-web/structures/_RightPanel.scss";
@import "./vector-web/structures/_RoomDirectory.scss";

View File

@ -22,6 +22,10 @@ limitations under the License.
flex-direction: column;
justify-content: center;
display: flex;
/* For welcome pages */
background-color: #f7f7f7;
-webkit-align-items: center;
}
.mx_RoomPreviewBar_wrapper {

View File

@ -0,0 +1,32 @@
/*
Copyright 2016 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
.mx_HomePage {
max-width: 960px;
width: 100%;
margin-left: auto;
margin-right: auto;
}
.mx_HomePage iframe {
width: 100%;
height: 90%;
border: 0px;
}
.mx_HomePage_body {
margin-left: 63px;
}

View File

@ -64,6 +64,7 @@ limitations under the License.
pointer-events: none;
}
.mx_LeftPanel .mx_BottomLeftMenu_homePage,
.mx_LeftPanel .mx_BottomLeftMenu_directory,
.mx_LeftPanel .mx_BottomLeftMenu_createRoom,
.mx_LeftPanel .mx_BottomLeftMenu_people,
@ -72,6 +73,7 @@ limitations under the License.
cursor: pointer;
}
.collapsed .mx_BottomLeftMenu_homePage,
.collapsed .mx_BottomLeftMenu_directory,
.collapsed .mx_BottomLeftMenu_createRoom,
.collapsed .mx_BottomLeftMenu_people,
@ -81,6 +83,7 @@ limitations under the License.
padding-bottom: 3px ! important;
}
.mx_LeftPanel .mx_BottomLeftMenu_homePage,
.mx_LeftPanel .mx_BottomLeftMenu_directory,
.mx_LeftPanel .mx_BottomLeftMenu_createRoom,
.mx_LeftPanel .mx_BottomLeftMenu_people {

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 25 25" style="enable-background:new 0 0 25 25;" xml:space="preserve">
<style type="text/css">
.st0{fill:#76CFA6;}
.st1{fill:none;stroke:#FFFFFF;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
</style>
<g id="Layer_1">
<title>81230A28-D944-4572-B5DB-C03CAA2B1FCA</title>
<desc>Created with sketchtool.</desc>
<g id="Symbols">
<g id="Left-nav-default" transform="translate(-50.000000, -725.000000)">
<g id="Left-panel">
<g>
<g id="icons_people" transform="translate(50.000000, 725.000000)">
<path id="Oval-1-Copy-7" class="st0" d="M12.5,25C19.4,25,25,19.4,25,12.5S19.4,0,12.5,0S0,5.6,0,12.5S5.6,25,12.5,25z"/>
</g>
</g>
</g>
</g>
</g>
</g>
<g id="Layer_2">
<rect x="7.8" y="10.7" class="st1" width="9.4" height="7.4"/>
<polygon class="st1" points="12.5,6 6.2,10.7 18.8,10.7 "/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB