From 24550777c6863064a931b9c8394b074535b568ce Mon Sep 17 00:00:00 2001 From: Calin Chitu Date: Wed, 2 Jun 2021 13:25:32 +0300 Subject: [PATCH] feat(native-participants-pane) simplified props for hiding header with navigation --- .../base/modal/components/JitsiModal.js | 21 +++++++------- .../components/native/HeaderWithNavigation.js | 28 +++++++++++++------ react/features/chat/components/native/Chat.js | 3 +- .../components/native/SharedDocument.js | 1 - react/features/help/components/HelpView.js | 3 +- .../native/AddPeopleDialog.js | 3 +- .../dial-in-summary/native/DialInSummary.js | 1 - .../components/native/ParticipantsPane.js | 2 +- .../components/native/SettingsView.js | 3 +- 9 files changed, 35 insertions(+), 30 deletions(-) diff --git a/react/features/base/modal/components/JitsiModal.js b/react/features/base/modal/components/JitsiModal.js index d61cc86e7..d945ec8fc 100644 --- a/react/features/base/modal/components/JitsiModal.js +++ b/react/features/base/modal/components/JitsiModal.js @@ -50,6 +50,11 @@ type Props = { */ headerProps: Object, + /** + * True if the header with navigation should be hidden, false otherwise. + */ + hideHeaderWithNavigation?: boolean, + /** * The ID of the modal that is being rendered. This is used to show/hide the modal. */ @@ -66,11 +71,6 @@ type Props = { */ position?: string, - /** - * True if the header with navigation should be shown, false otherwise. - */ - showHeaderWithNavigation: boolean, - /** * Additional style to be appended to the View containing the content of the modal. */ @@ -83,7 +83,8 @@ type Props = { */ class JitsiModal extends PureComponent { static defaultProps = { - position: 'bottom' + position: 'bottom', + hideHeaderWithNavigation: false }; /** @@ -111,7 +112,7 @@ class JitsiModal extends PureComponent { footerComponent, headerProps, position, - showHeaderWithNavigation, + hideHeaderWithNavigation, style } = this.props; @@ -132,10 +133,10 @@ class JitsiModal extends PureComponent { _styles.page, style ] }> - {showHeaderWithNavigation - && } + hideHeaderWithNavigation = { hideHeaderWithNavigation } + onPressBack = { this._onRequestClose } /> { children } diff --git a/react/features/base/react/components/native/HeaderWithNavigation.js b/react/features/base/react/components/native/HeaderWithNavigation.js index 6619c51f7..cd2e6e5ba 100644 --- a/react/features/base/react/components/native/HeaderWithNavigation.js +++ b/react/features/base/react/components/native/HeaderWithNavigation.js @@ -27,6 +27,11 @@ type Props = { */ headerLabelKey: ?string, + /** + * True if the header with navigation should be hidden, false otherwise. + */ + hideHeaderWithNavigation?: boolean, + /** * Callback to be invoked on pressing the back button. */ @@ -48,17 +53,22 @@ class HeaderWithNavigation extends Component { * @inheritdoc */ render() { - const { onPressBack, onPressForward } = this.props; + const { hideHeaderWithNavigation, onPressBack, onPressForward } = this.props; return ( -
- { onPressBack && } - - { onPressForward && } -
+ <> + { + !hideHeaderWithNavigation + &&
+ { onPressBack && } + + { onPressForward && } +
+ } + ); } } diff --git a/react/features/chat/components/native/Chat.js b/react/features/chat/components/native/Chat.js index 39e232cc3..b1159a5c9 100644 --- a/react/features/chat/components/native/Chat.js +++ b/react/features/chat/components/native/Chat.js @@ -44,8 +44,7 @@ class Chat extends AbstractChat { headerLabelKey: 'chat.title' }} modalId = { CHAT_VIEW_MODAL_ID } - onClose = { this._onClose } - showHeaderWithNavigation = { true }> + onClose = { this._onClose }> diff --git a/react/features/etherpad/components/native/SharedDocument.js b/react/features/etherpad/components/native/SharedDocument.js index a191d7bd7..11cdf07b9 100644 --- a/react/features/etherpad/components/native/SharedDocument.js +++ b/react/features/etherpad/components/native/SharedDocument.js @@ -78,7 +78,6 @@ class SharedDocument extends PureComponent { headerLabelKey: 'documentSharing.title' }} modalId = { SHARE_DOCUMENT_VIEW_ID } - showHeaderWithNavigation = { true } style = { styles.webView }> { headerProps = {{ headerLabelKey: 'helpView.header' }} - modalId = { HELP_VIEW_MODAL_ID } - showHeaderWithNavigation = { true }> + modalId = { HELP_VIEW_MODAL_ID }> ); diff --git a/react/features/invite/components/add-people-dialog/native/AddPeopleDialog.js b/react/features/invite/components/add-people-dialog/native/AddPeopleDialog.js index b53ba4338..c03313d07 100644 --- a/react/features/invite/components/add-people-dialog/native/AddPeopleDialog.js +++ b/react/features/invite/components/add-people-dialog/native/AddPeopleDialog.js @@ -176,8 +176,7 @@ class AddPeopleDialog extends AbstractAddPeopleDialog { headerLabelKey: 'inviteDialog.header', onPressForward: this._onInvite }} - modalId = { ADD_PEOPLE_DIALOG_VIEW_ID } - showHeaderWithNavigation = { true }> + modalId = { ADD_PEOPLE_DIALOG_VIEW_ID }> diff --git a/react/features/invite/components/dial-in-summary/native/DialInSummary.js b/react/features/invite/components/dial-in-summary/native/DialInSummary.js index 0f4825240..fa87ca9c4 100644 --- a/react/features/invite/components/dial-in-summary/native/DialInSummary.js +++ b/react/features/invite/components/dial-in-summary/native/DialInSummary.js @@ -58,7 +58,6 @@ class DialInSummary extends Component { headerLabelKey: 'info.label' }} modalId = { DIAL_IN_SUMMARY_VIEW_ID } - showHeaderWithNavigation = { true } style = { styles.backDrop }>