MM-41941 Gekidou Long Press Menu Post options - Reply (#5986)

* implementing reply option

* update reply option

* corrections
This commit is contained in:
Avinash Lingaloo
2022-02-21 16:29:58 +04:00
committed by GitHub
parent a14dd4928f
commit 39e5c2c07a
4 changed files with 25 additions and 11 deletions

View File

@@ -2,11 +2,12 @@
// See LICENSE.txt for license information.
import React, {useCallback} from 'react';
import {DeviceEventEmitter, Text, View} from 'react-native';
import {Text, View} from 'react-native';
import CompassIcon from '@components/compass_icon';
import TouchableWithFeedback from '@components/touchable_with_feedback';
import {SEARCH} from '@constants/screens';
import {goToScreen} from '@screens/navigation';
import {preventDoubleTap} from '@utils/tap';
import {makeStyleSheetFromTheme} from '@utils/theme';
@@ -47,7 +48,8 @@ const HeaderReply = ({commentCount, location, post, theme}: HeaderReplyProps) =>
const style = getStyleSheet(theme);
const onPress = useCallback(preventDoubleTap(() => {
DeviceEventEmitter.emit('goToThread', post);
// https://mattermost.atlassian.net/browse/MM-39708
goToScreen('THREADS_SCREEN_NOT_IMPLEMENTED_YET', '', {post});
}), []);
return (

View File

@@ -3,7 +3,7 @@
import React, {ReactNode, useMemo, useRef} from 'react';
import {useIntl} from 'react-intl';
import {DeviceEventEmitter, Keyboard, Platform, StyleProp, View, ViewStyle} from 'react-native';
import {Keyboard, Platform, StyleProp, View, ViewStyle} from 'react-native';
import {showPermalink} from '@actions/local/permalink';
import {removePost} from '@actions/local/post';
@@ -14,7 +14,7 @@ import * as Screens from '@constants/screens';
import {useServerUrl} from '@context/server';
import {useTheme} from '@context/theme';
import {useIsTablet} from '@hooks/device';
import {bottomSheetModalOptions, showModal, showModalOverCurrentContext} from '@screens/navigation';
import {bottomSheetModalOptions, goToScreen, showModal, showModalOverCurrentContext} from '@screens/navigation';
import {fromAutoResponder, isFromWebhook, isPostPendingOrFailed, isSystemMessage} from '@utils/post';
import {preventDoubleTap} from '@utils/tap';
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
@@ -137,7 +137,8 @@ const Post = ({
const isValidSystemMessage = isAutoResponder || !isSystemPost;
if (post.deleteAt === 0 && isValidSystemMessage && !isPendingOrFailed) {
if ([Screens.CHANNEL, Screens.PERMALINK].includes(location)) {
DeviceEventEmitter.emit('goToThread', post);
// https://mattermost.atlassian.net/browse/MM-39708
goToScreen('THREADS_SCREEN_NOT_IMPLEMENTED_YET', '', {post});
}
} else if ((isEphemeral || post.deleteAt > 0)) {
removePost(serverUrl, post);