[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:
parent
c6401a2d39
commit
812535da43
|
@ -201,7 +201,13 @@ const MessageActions = React.memo(forwardRef(({
|
||||||
hideActionSheet();
|
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) => {
|
const handleToggleTranslation = async(message) => {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -189,7 +189,7 @@ const ModalStackNavigator = React.memo(({ navigation }) => {
|
||||||
<ModalStack.Screen
|
<ModalStack.Screen
|
||||||
name='ReadReceiptsView'
|
name='ReadReceiptsView'
|
||||||
component={ReadReceiptsView}
|
component={ReadReceiptsView}
|
||||||
options={ReadReceiptsView.navigationOptions}
|
options={props => ReadReceiptsView.navigationOptions({ ...props, isMasterDetail: true })}
|
||||||
/>
|
/>
|
||||||
<ModalStack.Screen
|
<ModalStack.Screen
|
||||||
name='SettingsView'
|
name='SettingsView'
|
||||||
|
|
|
@ -8,6 +8,7 @@ import { connect } from 'react-redux';
|
||||||
import Avatar from '../../containers/Avatar';
|
import Avatar from '../../containers/Avatar';
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
import ActivityIndicator from '../../containers/ActivityIndicator';
|
import ActivityIndicator from '../../containers/ActivityIndicator';
|
||||||
|
import { CloseModalButton } from '../../containers/HeaderButton';
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../i18n';
|
||||||
import RocketChat from '../../lib/rocketchat';
|
import RocketChat from '../../lib/rocketchat';
|
||||||
import StatusBar from '../../containers/StatusBar';
|
import StatusBar from '../../containers/StatusBar';
|
||||||
|
@ -17,8 +18,14 @@ import { getUserSelector } from '../../selectors/login';
|
||||||
import SafeAreaView from '../../containers/SafeAreaView';
|
import SafeAreaView from '../../containers/SafeAreaView';
|
||||||
|
|
||||||
class ReadReceiptView extends React.Component {
|
class ReadReceiptView extends React.Component {
|
||||||
static navigationOptions = {
|
static navigationOptions = ({ navigation, isMasterDetail }) => {
|
||||||
title: I18n.t('Read_Receipt')
|
const options = {
|
||||||
|
title: I18n.t('Read_Receipt')
|
||||||
|
};
|
||||||
|
if (isMasterDetail) {
|
||||||
|
options.headerLeft = () => <CloseModalButton navigation={navigation} testID='read-receipt-view-close' />;
|
||||||
|
}
|
||||||
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
|
Loading…
Reference in New Issue