From e5aaa667e7921a827df304b9d64320e14c7a55d3 Mon Sep 17 00:00:00 2001 From: Ezequiel de Oliveira Date: Fri, 24 Jul 2020 16:58:14 -0300 Subject: [PATCH] [FIX] MessagesView title not working (#2294) * Set title in header of room actions view items Signed-off-by: Ezequiel De Oliveira * Remove unneeded spaces Signed-off-by: Ezequiel De Oliveira * Set header title on constructor Signed-off-by: Ezequiel De Oliveira * Remove unused navigation options Signed-off-by: Ezequiel De Oliveira Co-authored-by: Diego Mello --- app/stacks/InsideStack.js | 1 - app/stacks/MasterDetailStack/index.js | 1 - app/views/MessagesView/index.js | 13 ++++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) 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 = () => { { ({ - 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) {