From 7378904f0042a7f131e83902118abf24268e96ac Mon Sep 17 00:00:00 2001 From: wmwragg Date: Mon, 5 Sep 2016 12:43:04 +0100 Subject: [PATCH] Adding back the BottomLeftMenuTile component, as it turns out it's still used in the RightPanel --- src/component-index.js | 1 + .../views/rooms/BottomLeftMenuTile.js | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 src/components/views/rooms/BottomLeftMenuTile.js diff --git a/src/component-index.js b/src/component-index.js index a0c4d9dc09..dfe549930a 100644 --- a/src/component-index.js +++ b/src/component-index.js @@ -48,6 +48,7 @@ module.exports.components['views.login.VectorLoginFooter'] = require('./componen module.exports.components['views.login.VectorLoginHeader'] = require('./components/views/login/VectorLoginHeader'); module.exports.components['views.messages.DateSeparator'] = require('./components/views/messages/DateSeparator'); module.exports.components['views.messages.MessageTimestamp'] = require('./components/views/messages/MessageTimestamp'); +module.exports.components['views.rooms.BottomLeftMenuTile'] = require('./components/views/rooms/BottomLeftMenuTile'); module.exports.components['views.rooms.RoomDNDView'] = require('./components/views/rooms/RoomDNDView'); module.exports.components['views.rooms.RoomDropTarget'] = require('./components/views/rooms/RoomDropTarget'); module.exports.components['views.rooms.RoomTooltip'] = require('./components/views/rooms/RoomTooltip'); diff --git a/src/components/views/rooms/BottomLeftMenuTile.js b/src/components/views/rooms/BottomLeftMenuTile.js new file mode 100644 index 0000000000..0db6bd92eb --- /dev/null +++ b/src/components/views/rooms/BottomLeftMenuTile.js @@ -0,0 +1,57 @@ +/* +Copyright 2015, 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'; + +var React = require('react'); + +var sdk = require('matrix-react-sdk') + +module.exports = React.createClass({ + displayName: 'BottomLeftMenuTile', + + getInitialState: function() { + return( { hover : false }); + }, + + onMouseEnter: function() { + this.setState( { hover : true }); + }, + + onMouseLeave: function() { + this.setState( { hover : false }); + }, + + render: function() { + var label; + if (!this.props.collapsed) { + label =
{ this.props.label }
; + } + else if (this.state.hover) { + var RoomTooltip = sdk.getComponent("rooms.RoomTooltip"); + label = ; + } + + return ( +
+
+ +
+ { label } +
+ ); + } +});