diff --git a/native/chat/chat.react.js b/native/chat/chat.react.js
--- a/native/chat/chat.react.js
+++ b/native/chat/chat.react.js
@@ -221,18 +221,15 @@
return {
// This is a render prop, not a component
// eslint-disable-next-line react/display-name
- headerTitle: () => (
+ headerTitle: props => (
),
- headerTitleContainerStyle: {
- marginHorizontal: Platform.select({ ios: 80, default: 0 }),
- flex: 1,
- },
headerRight:
Platform.OS === 'android' && areSettingsEnabled
? // This is a render prop, not a component
diff --git a/native/chat/message-list-header-title.react.js b/native/chat/message-list-header-title.react.js
--- a/native/chat/message-list-header-title.react.js
+++ b/native/chat/message-list-header-title.react.js
@@ -1,6 +1,9 @@
// @flow
-import { HeaderTitle } from '@react-navigation/elements';
+import {
+ HeaderTitle,
+ type StackHeaderTitleInputProps,
+} from '@react-navigation/elements';
import * as React from 'react';
import { View, Platform } from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
@@ -18,6 +21,7 @@
+navigate: $PropertyType, 'navigate'>,
+isSearchEmpty: boolean,
+areSettingsEnabled: boolean,
+ ...StackHeaderTitleInputProps,
};
type Props = {
...BaseProps,
@@ -25,38 +29,37 @@
};
class MessageListHeaderTitle extends React.PureComponent {
render() {
+ const {
+ threadInfo,
+ navigate,
+ isSearchEmpty,
+ areSettingsEnabled,
+ styles,
+ ...rest
+ } = this.props;
+
let icon, fakeIcon;
- if (Platform.OS === 'ios' && this.props.areSettingsEnabled) {
+ if (Platform.OS === 'ios' && areSettingsEnabled) {
icon = (
-
+
);
fakeIcon = (
-
+
);
}
- const title = this.props.isSearchEmpty
- ? 'New Message'
- : this.props.threadInfo.uiName;
+ const title = isSearchEmpty ? 'New Message' : threadInfo.uiName;
return (