Swap from ui_opacity to panel_disabled

to simplify the process of disabling panels in the UI.
This commit is contained in:
Luke Barnard 2017-10-25 11:09:48 +01:00
parent 0463f0e581
commit 2f8f2ce76e
10 changed files with 77 additions and 60 deletions

View file

@ -16,6 +16,7 @@ limitations under the License.
import React from 'react';
import ReactDOM from 'react-dom';
import classNames from 'classnames';
import UserSettingsStore from '../../UserSettingsStore';
import shouldHideEvent from '../../shouldHideEvent';
import dis from "../../dispatcher";
@ -78,8 +79,8 @@ module.exports = React.createClass({
// callback which is called when more content is needed.
onFillRequest: React.PropTypes.func,
// opacity for dynamic UI fading effects
opacity: React.PropTypes.number,
// whether to display as faded and uninteractable
disabled: React.PropTypes.bool,
// className for the panel
className: React.PropTypes.string.isRequired,
@ -649,12 +650,14 @@ module.exports = React.createClass({
}
const style = this.props.hidden ? { display: 'none' } : {};
style.opacity = this.props.opacity;
let className = this.props.className + " mx_fadable";
if (this.props.alwaysShowTimestamps) {
className += " mx_MessagePanel_alwaysShowTimestamps";
}
const className = classNames(
this.props.className, "mx_fadable",
{
"mx_MessagePanel_alwaysShowTimestamps": this.props.alwaysShowTimestamps,
"mx_fadable_faded": this.props.disabled,
},
);
return (
<ScrollPanel ref="scrollPanel" className={className}