mirror of
https://github.com/element-hq/element-web
synced 2024-11-25 10:45:51 +03:00
Dramatically simplify use of mx_fadable
by applying it to parent elements of things that need to be faded.
This commit is contained in:
parent
2f8f2ce76e
commit
b1f2a6c1e9
6 changed files with 21 additions and 39 deletions
|
@ -116,7 +116,6 @@ const FilePanel = React.createClass({
|
||||||
timelineSet={this.state.timelineSet}
|
timelineSet={this.state.timelineSet}
|
||||||
showUrlPreview = {false}
|
showUrlPreview = {false}
|
||||||
tileShape="file_grid"
|
tileShape="file_grid"
|
||||||
disabled={this.props.disabled}
|
|
||||||
empty={_t('There are no visible files in this room')}
|
empty={_t('There are no visible files in this room')}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
|
@ -79,9 +79,6 @@ module.exports = React.createClass({
|
||||||
// callback which is called when more content is needed.
|
// callback which is called when more content is needed.
|
||||||
onFillRequest: React.PropTypes.func,
|
onFillRequest: React.PropTypes.func,
|
||||||
|
|
||||||
// whether to display as faded and uninteractable
|
|
||||||
disabled: React.PropTypes.bool,
|
|
||||||
|
|
||||||
// className for the panel
|
// className for the panel
|
||||||
className: React.PropTypes.string.isRequired,
|
className: React.PropTypes.string.isRequired,
|
||||||
|
|
||||||
|
@ -652,10 +649,9 @@ module.exports = React.createClass({
|
||||||
const style = this.props.hidden ? { display: 'none' } : {};
|
const style = this.props.hidden ? { display: 'none' } : {};
|
||||||
|
|
||||||
const className = classNames(
|
const className = classNames(
|
||||||
this.props.className, "mx_fadable",
|
this.props.className,
|
||||||
{
|
{
|
||||||
"mx_MessagePanel_alwaysShowTimestamps": this.props.alwaysShowTimestamps,
|
"mx_MessagePanel_alwaysShowTimestamps": this.props.alwaysShowTimestamps,
|
||||||
"mx_fadable_faded": this.props.disabled,
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,6 @@ const NotificationPanel = React.createClass({
|
||||||
manageReadMarkers={false}
|
manageReadMarkers={false}
|
||||||
timelineSet={timelineSet}
|
timelineSet={timelineSet}
|
||||||
showUrlPreview = {false}
|
showUrlPreview = {false}
|
||||||
opacity={this.props.opacity}
|
|
||||||
tileShape="notif"
|
tileShape="notif"
|
||||||
empty={_t('You have no visible notifications')}
|
empty={_t('You have no visible notifications')}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -1753,15 +1753,9 @@ module.exports = React.createClass({
|
||||||
let hideMessagePanel = false;
|
let hideMessagePanel = false;
|
||||||
|
|
||||||
if (this.state.searchResults) {
|
if (this.state.searchResults) {
|
||||||
const searchResultsClasses = classNames(
|
|
||||||
"mx_RoomView_messagePanel", "mx_RoomView_searchResultsPanel", "mx_fadable",
|
|
||||||
{
|
|
||||||
"mx_fadable_faded": this.props.disabled,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
searchResultsPanel = (
|
searchResultsPanel = (
|
||||||
<ScrollPanel ref="searchResultsPanel"
|
<ScrollPanel ref="searchResultsPanel"
|
||||||
className={searchResultsClasses}
|
className="mx_RoomView_messagePanel mx_RoomView_searchResultsPanel"
|
||||||
onFillRequest={this.onSearchResultsFillRequest}
|
onFillRequest={this.onSearchResultsFillRequest}
|
||||||
onResize={this.onSearchResultsResize}
|
onResize={this.onSearchResultsResize}
|
||||||
>
|
>
|
||||||
|
@ -1794,21 +1788,14 @@ module.exports = React.createClass({
|
||||||
onScroll={this.onMessageListScroll}
|
onScroll={this.onMessageListScroll}
|
||||||
onReadMarkerUpdated={this._updateTopUnreadMessagesBar}
|
onReadMarkerUpdated={this._updateTopUnreadMessagesBar}
|
||||||
showUrlPreview = {this.state.showUrlPreview}
|
showUrlPreview = {this.state.showUrlPreview}
|
||||||
disabled={this.props.disabled}
|
|
||||||
className="mx_RoomView_messagePanel"
|
className="mx_RoomView_messagePanel"
|
||||||
/>);
|
/>);
|
||||||
|
|
||||||
let topUnreadMessagesBar = null;
|
let topUnreadMessagesBar = null;
|
||||||
if (this.state.showTopUnreadMessagesBar) {
|
if (this.state.showTopUnreadMessagesBar) {
|
||||||
const TopUnreadMessagesBar = sdk.getComponent('rooms.TopUnreadMessagesBar');
|
const TopUnreadMessagesBar = sdk.getComponent('rooms.TopUnreadMessagesBar');
|
||||||
const topUnreadMessagesBarClasses = classNames(
|
|
||||||
"mx_RoomView_topUnreadMessagesBar", "mx_fadable",
|
|
||||||
{
|
|
||||||
"mx_fadable_faded": this.props.disabled,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
topUnreadMessagesBar = (
|
topUnreadMessagesBar = (
|
||||||
<div className={topUnreadMessagesBarClasses}>
|
<div className="mx_RoomView_topUnreadMessagesBar">
|
||||||
<TopUnreadMessagesBar
|
<TopUnreadMessagesBar
|
||||||
onScrollUpClick={this.jumpToReadMarker}
|
onScrollUpClick={this.jumpToReadMarker}
|
||||||
onCloseClick={this.forgetReadMarker}
|
onCloseClick={this.forgetReadMarker}
|
||||||
|
@ -1817,9 +1804,15 @@ module.exports = React.createClass({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const statusBarAreaClass = classNames(
|
const statusBarAreaClass = classNames(
|
||||||
"mx_RoomView_statusArea", "mx_fadable",
|
"mx_RoomView_statusArea",
|
||||||
{
|
{
|
||||||
"mx_RoomView_statusArea_expanded": isStatusAreaExpanded,
|
"mx_RoomView_statusArea_expanded": isStatusAreaExpanded,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
const fadableSectionClasses = classNames(
|
||||||
|
"mx_RoomView_body", "mx_fadable",
|
||||||
|
{
|
||||||
"mx_fadable_faded": this.props.disabled,
|
"mx_fadable_faded": this.props.disabled,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -1841,16 +1834,18 @@ module.exports = React.createClass({
|
||||||
onLeaveClick={(myMember && myMember.membership === "join") ? this.onLeaveClick : null}
|
onLeaveClick={(myMember && myMember.membership === "join") ? this.onLeaveClick : null}
|
||||||
/>
|
/>
|
||||||
{ auxPanel }
|
{ auxPanel }
|
||||||
{ topUnreadMessagesBar }
|
<div className={fadableSectionClasses}>
|
||||||
{ messagePanel }
|
{ topUnreadMessagesBar }
|
||||||
{ searchResultsPanel }
|
{ messagePanel }
|
||||||
<div className={statusBarAreaClass}>
|
{ searchResultsPanel }
|
||||||
<div className="mx_RoomView_statusAreaBox">
|
<div className={statusBarAreaClass}>
|
||||||
<div className="mx_RoomView_statusAreaBox_line"></div>
|
<div className="mx_RoomView_statusAreaBox">
|
||||||
{ statusBar }
|
<div className="mx_RoomView_statusAreaBox_line"></div>
|
||||||
|
{ statusBar }
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{ messageComposer }
|
||||||
</div>
|
</div>
|
||||||
{ messageComposer }
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
@ -89,9 +89,6 @@ var TimelinePanel = React.createClass({
|
||||||
// callback which is called when the read-up-to mark is updated.
|
// callback which is called when the read-up-to mark is updated.
|
||||||
onReadMarkerUpdated: React.PropTypes.func,
|
onReadMarkerUpdated: React.PropTypes.func,
|
||||||
|
|
||||||
// whether to display as faded and uninteractable
|
|
||||||
disabled: React.PropTypes.bool,
|
|
||||||
|
|
||||||
// maximum number of events to show in a timeline
|
// maximum number of events to show in a timeline
|
||||||
timelineCap: React.PropTypes.number,
|
timelineCap: React.PropTypes.number,
|
||||||
|
|
||||||
|
@ -1157,7 +1154,6 @@ var TimelinePanel = React.createClass({
|
||||||
onScroll={this.onMessageListScroll}
|
onScroll={this.onMessageListScroll}
|
||||||
onFillRequest={this.onMessageListFillRequest}
|
onFillRequest={this.onMessageListFillRequest}
|
||||||
onUnfillRequest={this.onMessageListUnfillRequest}
|
onUnfillRequest={this.onMessageListUnfillRequest}
|
||||||
disabled={this.props.disabled}
|
|
||||||
isTwelveHour={this.state.isTwelveHour}
|
isTwelveHour={this.state.isTwelveHour}
|
||||||
alwaysShowTimestamps={this.state.alwaysShowTimestamps}
|
alwaysShowTimestamps={this.state.alwaysShowTimestamps}
|
||||||
className={this.props.className}
|
className={this.props.className}
|
||||||
|
|
|
@ -371,7 +371,7 @@ export default class MessageComposer extends React.Component {
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx_MessageComposer mx_fadable" style={{ opacity: this.props.opacity }}>
|
<div className="mx_MessageComposer">
|
||||||
<div className="mx_MessageComposer_wrapper">
|
<div className="mx_MessageComposer_wrapper">
|
||||||
<div className="mx_MessageComposer_row">
|
<div className="mx_MessageComposer_row">
|
||||||
{ controls }
|
{ controls }
|
||||||
|
@ -410,9 +410,6 @@ MessageComposer.propTypes = {
|
||||||
// callback when a file to upload is chosen
|
// callback when a file to upload is chosen
|
||||||
uploadFile: React.PropTypes.func.isRequired,
|
uploadFile: React.PropTypes.func.isRequired,
|
||||||
|
|
||||||
// opacity for dynamic UI fading effects
|
|
||||||
opacity: React.PropTypes.number,
|
|
||||||
|
|
||||||
// string representing the current room app drawer state
|
// string representing the current room app drawer state
|
||||||
showApps: React.PropTypes.bool,
|
showApps: React.PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue