diff --git a/react/features/base/react/components/native/HeaderWithNavigation.js b/react/features/base/react/components/native/HeaderWithNavigation.js new file mode 100644 index 000000000..6619c51f7 --- /dev/null +++ b/react/features/base/react/components/native/HeaderWithNavigation.js @@ -0,0 +1,66 @@ +// @flow + +import React, { Component } from 'react'; + +import { translate } from '../../../i18n'; + +import BackButton from './BackButton'; +import ForwardButton from './ForwardButton'; +import Header from './Header'; +import HeaderLabel from './HeaderLabel'; + + +type Props = { + + /** + * Boolean to set the forward button disabled. + */ + forwardDisabled: boolean, + + /** + * The i18n key of the the forward button label. + */ + forwardLabelKey: ?string, + + /** + * The i18n key of the header label (title) + */ + headerLabelKey: ?string, + + /** + * Callback to be invoked on pressing the back button. + */ + onPressBack: ?Function, + + /** + * Callback to be invoked on pressing the forward button. + */ + onPressForward: ?Function, +} + +/** + * Implements a header with the standard navigation content. + */ +class HeaderWithNavigation extends Component { + /** + * Implements {@code Component#render}. + * + * @inheritdoc + */ + render() { + const { onPressBack, onPressForward } = this.props; + + return ( +
+ { onPressBack && } + + { onPressForward && } +
+ ); + } +} + +export default translate(HeaderWithNavigation); diff --git a/react/features/base/react/components/native/index.js b/react/features/base/react/components/native/index.js index 7c0afe178..643c24772 100644 --- a/react/features/base/react/components/native/index.js +++ b/react/features/base/react/components/native/index.js @@ -8,6 +8,7 @@ export { default as Container } from './Container'; export { default as ForwardButton } from './ForwardButton'; export { default as Header } from './Header'; export { default as HeaderLabel } from './HeaderLabel'; +export { default as HeaderWithNavigation } from './HeaderWithNavigation'; export { default as Image } from './Image'; export { default as Link } from './Link'; export { default as LoadingIndicator } from './LoadingIndicator'; diff --git a/react/features/chat/components/native/Chat.js b/react/features/chat/components/native/Chat.js index 1272adbad..8109c6c9e 100644 --- a/react/features/chat/components/native/Chat.js +++ b/react/features/chat/components/native/Chat.js @@ -5,12 +5,7 @@ import { KeyboardAvoidingView, SafeAreaView } from 'react-native'; import { translate } from '../../../base/i18n'; -import { - BackButton, - Header, - HeaderLabel, - SlidingView -} from '../../../base/react'; +import { HeaderWithNavigation, SlidingView } from '../../../base/react'; import { connect } from '../../../base/redux'; import AbstractChat, { @@ -41,10 +36,9 @@ class Chat extends AbstractChat { -
- - -
+ 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 3a94c32c5..ae0016c2b 100644 --- a/react/features/invite/components/add-people-dialog/native/AddPeopleDialog.js +++ b/react/features/invite/components/add-people-dialog/native/AddPeopleDialog.js @@ -16,10 +16,7 @@ import { Icon } from '../../../../base/font-icons'; import { translate } from '../../../../base/i18n'; import { AvatarListItem, - BackButton, - ForwardButton, - Header, - HeaderLabel, + HeaderWithNavigation, Modal, type Item } from '../../../../base/react'; @@ -146,14 +143,12 @@ class AddPeopleDialog extends AbstractAddPeopleDialog { -
- - - -
+ diff --git a/react/features/settings/components/native/SettingsView.js b/react/features/settings/components/native/SettingsView.js index 62d5329ec..7486533af 100644 --- a/react/features/settings/components/native/SettingsView.js +++ b/react/features/settings/components/native/SettingsView.js @@ -5,7 +5,7 @@ import { Alert, NativeModules, SafeAreaView, ScrollView, Switch, Text, TextInput import { ColorSchemeRegistry } from '../../../base/color-scheme'; import { translate } from '../../../base/i18n'; -import { BackButton, Header, Modal } from '../../../base/react'; +import { HeaderWithNavigation, Modal } from '../../../base/react'; import { connect } from '../../../base/redux'; import { @@ -18,7 +18,6 @@ import FormRow from './FormRow'; import FormSectionHeader from './FormSectionHeader'; import { normalizeUserInputURL } from '../../functions'; import styles from './styles'; -import { HeaderLabel } from '../../../base/react/components/native'; /** * Application information module. @@ -213,10 +212,9 @@ class SettingsView extends AbstractSettingsView { */ _renderHeader() { return ( -
- - -
+ ); }