[FIX] Read receipts on tablet (#2297)

* fixes not working read receipts on tablet (#2295)

* fixing last commit it to make it work on both tablet and phone

* fix missing close button on tablet's modal view

* Update app/views/ReadReceiptView/index.js

* remove unnecessary param

Co-authored-by: Djorkaeff Alexandre <djorkaeff.unb@gmail.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
phriedrich 2020-07-17 19:13:44 +02:00 committed by GitHub
parent c6401a2d39
commit 812535da43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 4 deletions

View File

@ -201,7 +201,13 @@ const MessageActions = React.memo(forwardRef(({
hideActionSheet();
};
const handleReadReceipt = message => Navigation.navigate('ReadReceiptsView', { messageId: message.id });
const handleReadReceipt = (message) => {
if (isMasterDetail) {
Navigation.navigate('ModalStackNavigator', { screen: 'ReadReceiptsView', params: { messageId: message.id } });
} else {
Navigation.navigate('ReadReceiptsView', { messageId: message.id });
}
};
const handleToggleTranslation = async(message) => {
try {

View File

@ -189,7 +189,7 @@ const ModalStackNavigator = React.memo(({ navigation }) => {
<ModalStack.Screen
name='ReadReceiptsView'
component={ReadReceiptsView}
options={ReadReceiptsView.navigationOptions}
options={props => ReadReceiptsView.navigationOptions({ ...props, isMasterDetail: true })}
/>
<ModalStack.Screen
name='SettingsView'

View File

@ -8,6 +8,7 @@ import { connect } from 'react-redux';
import Avatar from '../../containers/Avatar';
import styles from './styles';
import ActivityIndicator from '../../containers/ActivityIndicator';
import { CloseModalButton } from '../../containers/HeaderButton';
import I18n from '../../i18n';
import RocketChat from '../../lib/rocketchat';
import StatusBar from '../../containers/StatusBar';
@ -17,8 +18,14 @@ import { getUserSelector } from '../../selectors/login';
import SafeAreaView from '../../containers/SafeAreaView';
class ReadReceiptView extends React.Component {
static navigationOptions = {
static navigationOptions = ({ navigation, isMasterDetail }) => {
const options = {
title: I18n.t('Read_Receipt')
};
if (isMasterDetail) {
options.headerLeft = () => <CloseModalButton navigation={navigation} testID='read-receipt-view-close' />;
}
return options;
}
static propTypes = {