moved hiding components to the top level
This commit is contained in:
@@ -1305,9 +1305,7 @@ class MessagesView extends React.Component {
|
|||||||
const {formatMessage} = this.props.intl;
|
const {formatMessage} = this.props.intl;
|
||||||
|
|
||||||
let component;
|
let component;
|
||||||
if (this.props.hideSelf) {
|
if (!this.state.topic) {
|
||||||
component = null;
|
|
||||||
} else if (!this.state.topic) {
|
|
||||||
component = (
|
component = (
|
||||||
<LogoView
|
<LogoView
|
||||||
serverVersion={this.props.serverVersion}
|
serverVersion={this.props.serverVersion}
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ class SidepanelView extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div id="sidepanel" className={this.props.hideSelf ? 'nodisplay' : null}>
|
<div id="sidepanel">
|
||||||
<SideNavbar
|
<SideNavbar
|
||||||
state={view}
|
state={view}
|
||||||
title={title}
|
title={title}
|
||||||
|
|||||||
@@ -1985,11 +1985,11 @@ class TinodeWeb extends React.Component {
|
|||||||
(_ => {this.setState({alertVisible: false}); this.state.alertParams.onConfirm();}) : null}
|
(_ => {this.setState({alertVisible: false}); this.state.alertParams.onConfirm();}) : null}
|
||||||
confirm={this.state.alertParams.confirm}
|
confirm={this.state.alertParams.confirm}
|
||||||
/> : null}
|
/> : null}
|
||||||
|
{!this.state.displayMobile || this.state.mobilePanel == 'sidepanel' ?
|
||||||
<SidepanelView
|
<SidepanelView
|
||||||
tinode={this.tinode}
|
tinode={this.tinode}
|
||||||
connected={this.state.connected}
|
connected={this.state.connected}
|
||||||
displayMobile={this.state.displayMobile}
|
displayMobile={this.state.displayMobile}
|
||||||
hideSelf={this.state.displayMobile && this.state.mobilePanel !== 'sidepanel'}
|
|
||||||
state={this.state.sidePanelSelected}
|
state={this.state.sidePanelSelected}
|
||||||
title={this.state.sidePanelTitle}
|
title={this.state.sidePanelTitle}
|
||||||
avatar={this.state.sidePanelAvatar}
|
avatar={this.state.sidePanelAvatar}
|
||||||
@@ -2056,7 +2056,9 @@ class TinodeWeb extends React.Component {
|
|||||||
onSearchContacts={this.handleSearchContacts}
|
onSearchContacts={this.handleSearchContacts}
|
||||||
|
|
||||||
showContextMenu={this.handleShowContextMenu} />
|
showContextMenu={this.handleShowContextMenu} />
|
||||||
|
: null}
|
||||||
|
|
||||||
|
{!this.state.displayMobile || (this.state.mobilePanel == 'topic-view' && !this.state.infoPanel) ?
|
||||||
<MessagesView
|
<MessagesView
|
||||||
tinode={this.tinode}
|
tinode={this.tinode}
|
||||||
connected={this.state.connected}
|
connected={this.state.connected}
|
||||||
@@ -2066,8 +2068,6 @@ class TinodeWeb extends React.Component {
|
|||||||
displayMobile={this.state.displayMobile}
|
displayMobile={this.state.displayMobile}
|
||||||
viewportWidth={this.state.viewportWidth}
|
viewportWidth={this.state.viewportWidth}
|
||||||
viewportHeight={this.state.viewportHeight}
|
viewportHeight={this.state.viewportHeight}
|
||||||
hideSelf={this.state.displayMobile &&
|
|
||||||
(this.state.mobilePanel !== 'topic-view' || this.state.infoPanel)}
|
|
||||||
topic={this.state.topicSelected}
|
topic={this.state.topicSelected}
|
||||||
myUserId={this.state.myUserId}
|
myUserId={this.state.myUserId}
|
||||||
// User public.fn.
|
// User public.fn.
|
||||||
@@ -2105,6 +2105,7 @@ class TinodeWeb extends React.Component {
|
|||||||
onNewChat={this.handleNewChatInvitation}
|
onNewChat={this.handleNewChatInvitation}
|
||||||
sendMessage={this.handleSendMessage}
|
sendMessage={this.handleSendMessage}
|
||||||
onVideoCallClosed={this.handleCallClose} />
|
onVideoCallClosed={this.handleCallClose} />
|
||||||
|
: null}
|
||||||
|
|
||||||
{this.state.infoPanel ?
|
{this.state.infoPanel ?
|
||||||
<InfoView
|
<InfoView
|
||||||
|
|||||||
+5
-10
@@ -6210,9 +6210,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
|
|||||||
formatMessage
|
formatMessage
|
||||||
} = this.props.intl;
|
} = this.props.intl;
|
||||||
let component;
|
let component;
|
||||||
if (this.props.hideSelf) {
|
if (!this.state.topic) {
|
||||||
component = null;
|
|
||||||
} else if (!this.state.topic) {
|
|
||||||
component = react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_logo_view_jsx__WEBPACK_IMPORTED_MODULE_13__["default"], {
|
component = react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_logo_view_jsx__WEBPACK_IMPORTED_MODULE_13__["default"], {
|
||||||
serverVersion: this.props.serverVersion,
|
serverVersion: this.props.serverVersion,
|
||||||
serverAddress: this.props.serverAddress
|
serverAddress: this.props.serverAddress
|
||||||
@@ -7019,8 +7017,7 @@ class SidepanelView extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo
|
|||||||
onCancel = this.props.onCancel;
|
onCancel = this.props.onCancel;
|
||||||
}
|
}
|
||||||
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
||||||
id: "sidepanel",
|
id: "sidepanel"
|
||||||
className: this.props.hideSelf ? 'nodisplay' : null
|
|
||||||
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_widgets_side_navbar_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], {
|
}, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_widgets_side_navbar_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], {
|
||||||
state: view,
|
state: view,
|
||||||
title: title,
|
title: title,
|
||||||
@@ -8963,11 +8960,10 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
this.state.alertParams.onConfirm();
|
this.state.alertParams.onConfirm();
|
||||||
} : null,
|
} : null,
|
||||||
confirm: this.state.alertParams.confirm
|
confirm: this.state.alertParams.confirm
|
||||||
}) : null, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_sidepanel_view_jsx__WEBPACK_IMPORTED_MODULE_11__["default"], {
|
}) : null, !this.state.displayMobile || this.state.mobilePanel == 'sidepanel' ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_sidepanel_view_jsx__WEBPACK_IMPORTED_MODULE_11__["default"], {
|
||||||
tinode: this.tinode,
|
tinode: this.tinode,
|
||||||
connected: this.state.connected,
|
connected: this.state.connected,
|
||||||
displayMobile: this.state.displayMobile,
|
displayMobile: this.state.displayMobile,
|
||||||
hideSelf: this.state.displayMobile && this.state.mobilePanel !== 'sidepanel',
|
|
||||||
state: this.state.sidePanelSelected,
|
state: this.state.sidePanelSelected,
|
||||||
title: this.state.sidePanelTitle,
|
title: this.state.sidePanelTitle,
|
||||||
avatar: this.state.sidePanelAvatar,
|
avatar: this.state.sidePanelAvatar,
|
||||||
@@ -9028,7 +9024,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
searchResults: this.state.searchResults,
|
searchResults: this.state.searchResults,
|
||||||
onSearchContacts: this.handleSearchContacts,
|
onSearchContacts: this.handleSearchContacts,
|
||||||
showContextMenu: this.handleShowContextMenu
|
showContextMenu: this.handleShowContextMenu
|
||||||
}), react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_messages_view_jsx__WEBPACK_IMPORTED_MODULE_10__["default"], {
|
}) : null, !this.state.displayMobile || this.state.mobilePanel == 'topic-view' && !this.state.infoPanel ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_messages_view_jsx__WEBPACK_IMPORTED_MODULE_10__["default"], {
|
||||||
tinode: this.tinode,
|
tinode: this.tinode,
|
||||||
connected: this.state.connected,
|
connected: this.state.connected,
|
||||||
ready: this.state.ready,
|
ready: this.state.ready,
|
||||||
@@ -9037,7 +9033,6 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
displayMobile: this.state.displayMobile,
|
displayMobile: this.state.displayMobile,
|
||||||
viewportWidth: this.state.viewportWidth,
|
viewportWidth: this.state.viewportWidth,
|
||||||
viewportHeight: this.state.viewportHeight,
|
viewportHeight: this.state.viewportHeight,
|
||||||
hideSelf: this.state.displayMobile && (this.state.mobilePanel !== 'topic-view' || this.state.infoPanel),
|
|
||||||
topic: this.state.topicSelected,
|
topic: this.state.topicSelected,
|
||||||
myUserId: this.state.myUserId,
|
myUserId: this.state.myUserId,
|
||||||
myUserName: this.state.sidePanelTitle,
|
myUserName: this.state.sidePanelTitle,
|
||||||
@@ -9068,7 +9063,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
onNewChat: this.handleNewChatInvitation,
|
onNewChat: this.handleNewChatInvitation,
|
||||||
sendMessage: this.handleSendMessage,
|
sendMessage: this.handleSendMessage,
|
||||||
onVideoCallClosed: this.handleCallClose
|
onVideoCallClosed: this.handleCallClose
|
||||||
}), this.state.infoPanel ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_info_view_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], {
|
}) : null, this.state.infoPanel ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_info_view_jsx__WEBPACK_IMPORTED_MODULE_9__["default"], {
|
||||||
tinode: this.tinode,
|
tinode: this.tinode,
|
||||||
connected: this.state.connected,
|
connected: this.state.connected,
|
||||||
displayMobile: this.state.displayMobile,
|
displayMobile: this.state.displayMobile,
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user