From 0561c5bd4f785d1f2f1d7ccc3399823e9205c0ad Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 25 Oct 2017 10:29:57 +0100 Subject: [PATCH] Swap ui_opacity for panel_disabled Simplify the API for disabling panels in the UI. `mx_fadable_faded` is applied instead of setting opacity. --- src/components/structures/LeftPanel.js | 24 +++++++++------------- src/components/structures/RightPanel.js | 19 ++++++++--------- src/components/structures/RoomDirectory.js | 12 +++++------ src/skins/vector/css/_common.scss | 5 +++++ 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/components/structures/LeftPanel.js b/src/components/structures/LeftPanel.js index b48d03be..60f07a62 100644 --- a/src/components/structures/LeftPanel.js +++ b/src/components/structures/LeftPanel.js @@ -19,6 +19,7 @@ limitations under the License. import React from 'react'; import { DragDropContext } from 'react-dnd'; import HTML5Backend from 'react-dnd-html5-backend'; +import classNames from 'classnames'; import KeyCode from 'matrix-react-sdk/lib/KeyCode'; import sdk from 'matrix-react-sdk'; import dis from 'matrix-react-sdk/lib/dispatcher'; @@ -55,7 +56,7 @@ var LeftPanel = React.createClass({ // We just need to update if any of these things change. if ( this.props.collapsed !== nextProps.collapsed || - this.props.opacity !== nextProps.opacity + this.props.disabled !== nextProps.disabled ) { return true; } @@ -176,21 +177,16 @@ var LeftPanel = React.createClass({ topBox = ; } - let classes = "mx_LeftPanel mx_fadable"; - if (this.props.collapsed) { - classes += " collapsed"; - } + let classes = classNames( + "mx_LeftPanel", "mx_fadable", + { + "collapsed": this.props.collapsed, + "mx_fadable_faded": this.props.disabled, + } + ); return ( -