diff --git a/home-geektime.html b/home-geektime.html new file mode 100644 index 0000000000..cea2eac3be --- /dev/null +++ b/home-geektime.html @@ -0,0 +1,25 @@ +
+ + GeekTime Techfest! + +
+ +

+Welcome to the GeekTime Techfest Riot! +

+ +

+To get started, please join some chat rooms! +

+ + + +

+To explore other rooms available on Matrix, click here: Room Directory +

+ +

+To learn more about Matrix, head over to Matrix.org - and to better understand Riot, check out the official Riot Website. +

\ No newline at end of file diff --git a/src/component-index.js b/src/component-index.js index 3141087ce6..068ab0610d 100644 --- a/src/component-index.js +++ b/src/component-index.js @@ -34,6 +34,8 @@ import structures$LeftPanel from './components/structures/LeftPanel'; module.exports.components['structures.LeftPanel'] = structures$LeftPanel; import structures$RightPanel from './components/structures/RightPanel'; module.exports.components['structures.RightPanel'] = structures$RightPanel; +import structures$HomePage from './components/structures/HomePage'; +module.exports.components['structures.HomePage'] = structures$HomePage; import structures$RoomDirectory from './components/structures/RoomDirectory'; module.exports.components['structures.RoomDirectory'] = structures$RoomDirectory; import structures$RoomSubList from './components/structures/RoomSubList'; diff --git a/src/components/structures/BottomLeftMenu.js b/src/components/structures/BottomLeftMenu.js index 0ea35b4ecb..793f8405df 100644 --- a/src/components/structures/BottomLeftMenu.js +++ b/src/components/structures/BottomLeftMenu.js @@ -20,6 +20,7 @@ var React = require('react'); var ReactDOM = require('react-dom'); var sdk = require('matrix-react-sdk') var dis = require('matrix-react-sdk/lib/dispatcher'); +var SdkConfig = require('matrix-react-sdk/lib/SdkConfig'); module.exports = React.createClass({ displayName: 'BottomLeftMenu', @@ -32,6 +33,7 @@ module.exports = React.createClass({ return({ directoryHover : false, roomsHover : false, + homeHover: false, peopleHover : false, settingsHover : false, }); @@ -62,6 +64,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' }); @@ -98,9 +113,21 @@ module.exports = React.createClass({ render: function() { var TintableSvg = sdk.getComponent('elements.TintableSvg'); + + var homeButton; + if (SdkConfig.get().home_page) { + homeButton = ( +
+ + { this.getLabel("Welcome page", this.state.homeHover) } +
+ ); + } + return (
+ { homeButton }
{ this.getLabel("Start chat", this.state.peopleHover) } diff --git a/src/components/structures/HomePage.js b/src/components/structures/HomePage.js new file mode 100644 index 0000000000..26bdf81e22 --- /dev/null +++ b/src/components/structures/HomePage.js @@ -0,0 +1,66 @@ +/* +Copyright 2016 OpenMarket 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 'isomorphic-fetch'; + +var React = require("react"); +var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); +var sdk = require('matrix-react-sdk'); + +module.exports = React.createClass({ + displayName: 'HomePage', + + propTypes: { + config: React.PropTypes.object.isRequired, + 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" }); + } + ).then( + (body)=>{ + this.setState({ page: body }); + } + ); + }, + + render: function() { + // const SimpleRoomHeader = sdk.getComponent('rooms.SimpleRoomHeader'); + // + + return ( +
+
+
+
+ ); + } +}); diff --git a/src/skins/vector/css/vector-web/structures/HomePage.css b/src/skins/vector/css/vector-web/structures/HomePage.css new file mode 100644 index 0000000000..0e2009a602 --- /dev/null +++ b/src/skins/vector/css/vector-web/structures/HomePage.css @@ -0,0 +1,26 @@ +/* +Copyright 2016 OpenMarket 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_body { + margin-left: 63px; +} \ No newline at end of file diff --git a/src/skins/vector/css/vector-web/structures/LeftPanel.css b/src/skins/vector/css/vector-web/structures/LeftPanel.css index 4e3281716e..35d3e22bf8 100644 --- a/src/skins/vector/css/vector-web/structures/LeftPanel.css +++ b/src/skins/vector/css/vector-web/structures/LeftPanel.css @@ -79,6 +79,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, @@ -87,6 +88,7 @@ limitations under the License. cursor: pointer; } +.collapsed .mx_BottomLeftMenu_homePage, .collapsed .mx_BottomLeftMenu_directory, .collapsed .mx_BottomLeftMenu_createRoom, .collapsed .mx_BottomLeftMenu_people, @@ -96,6 +98,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 { diff --git a/src/skins/vector/img/geektime/geektime.png b/src/skins/vector/img/geektime/geektime.png new file mode 100644 index 0000000000..fcb7b01af0 Binary files /dev/null and b/src/skins/vector/img/geektime/geektime.png differ diff --git a/src/skins/vector/img/icons-home.svg b/src/skins/vector/img/icons-home.svg new file mode 100644 index 0000000000..937e9916dd --- /dev/null +++ b/src/skins/vector/img/icons-home.svg @@ -0,0 +1,28 @@ + + + + + + 81230A28-D944-4572-B5DB-C03CAA2B1FCA + Created with sketchtool. + + + + + + + + + + + + + + + + +