[FIX] MessagesView title not working (#2294)
* Set title in header of room actions view items Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com> * Remove unneeded spaces Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com> * Set header title on constructor Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com> * Remove unused navigation options Signed-off-by: Ezequiel De Oliveira <ezequiel1de1oliveira@gmail.com> Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
parent
5532d0f368
commit
e5aaa667e7
|
@ -112,7 +112,6 @@ const ChatsStackNavigator = () => {
|
|||
<ChatsStack.Screen
|
||||
name='MessagesView'
|
||||
component={MessagesView}
|
||||
options={MessagesView.navigationOptions}
|
||||
/>
|
||||
<ChatsStack.Screen
|
||||
name='AutoTranslateView'
|
||||
|
|
|
@ -139,7 +139,6 @@ const ModalStackNavigator = React.memo(({ navigation }) => {
|
|||
<ModalStack.Screen
|
||||
name='MessagesView'
|
||||
component={MessagesView}
|
||||
options={MessagesView.navigationOptions}
|
||||
/>
|
||||
<ModalStack.Screen
|
||||
name='AutoTranslateView'
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue