diff --git a/app/stacks/InsideStack.js b/app/stacks/InsideStack.js index e29c39dd9..8a0f2e919 100644 --- a/app/stacks/InsideStack.js +++ b/app/stacks/InsideStack.js @@ -112,7 +112,6 @@ const ChatsStackNavigator = () => { <ChatsStack.Screen name='MessagesView' component={MessagesView} - options={MessagesView.navigationOptions} /> <ChatsStack.Screen name='AutoTranslateView' diff --git a/app/stacks/MasterDetailStack/index.js b/app/stacks/MasterDetailStack/index.js index 93edefba4..854112c92 100644 --- a/app/stacks/MasterDetailStack/index.js +++ b/app/stacks/MasterDetailStack/index.js @@ -139,7 +139,6 @@ const ModalStackNavigator = React.memo(({ navigation }) => { <ModalStack.Screen name='MessagesView' component={MessagesView} - options={MessagesView.navigationOptions} /> <ModalStack.Screen name='AutoTranslateView' diff --git a/app/views/MessagesView/index.js b/app/views/MessagesView/index.js index 1a55b72f3..4e826d3fc 100644 --- a/app/views/MessagesView/index.js +++ b/app/views/MessagesView/index.js @@ -18,10 +18,6 @@ import { withActionSheet } from '../../containers/ActionSheet'; import SafeAreaView from '../../containers/SafeAreaView'; class MessagesView extends React.Component { - static navigationOptions = ({ route }) => ({ - title: I18n.t(route.params?.name) - }); - static propTypes = { user: PropTypes.object, baseUrl: PropTypes.string, @@ -39,6 +35,7 @@ class MessagesView extends React.Component { messages: [], fileLoading: true }; + this.setHeader(); this.rid = props.route.params?.rid; this.t = props.route.params?.t; this.content = this.defineMessagesViewContent(props.route.params?.name); @@ -65,10 +62,16 @@ class MessagesView extends React.Component { if (fileLoading !== nextState.fileLoading) { return true; } - return false; } + setHeader = () => { + const { route, navigation } = this.props; + navigation.setOptions({ + title: I18n.t(route.params?.name) + }); + } + navToRoomInfo = (navParam) => { const { navigation, user } = this.props; if (navParam.rid === user.id) {