MM-41941 Gekidou Long Press Menu Post options - Reply (#5986)
* implementing reply option * update reply option * corrections
This commit is contained in:
parent
a14dd4928f
commit
39e5c2c07a
4 changed files with 25 additions and 11 deletions
|
|
@ -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 (
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -1,16 +1,27 @@
|
|||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React from 'react';
|
||||
import React, {useCallback} from 'react';
|
||||
|
||||
import {Screens} from '@constants';
|
||||
import {t} from '@i18n';
|
||||
import {dismissBottomSheet, goToScreen} from '@screens/navigation';
|
||||
|
||||
import BaseOption from './base_option';
|
||||
|
||||
const ReplyOption = () => {
|
||||
const handleReply = () => {
|
||||
//todo:
|
||||
};
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
|
||||
type Props = {
|
||||
post: PostModel;
|
||||
}
|
||||
const ReplyOption = ({post}: Props) => {
|
||||
const handleReply = useCallback(() => {
|
||||
//todo: @anurag Change below screen name to Screens.THREAD once implemented
|
||||
// https://mattermost.atlassian.net/browse/MM-39708
|
||||
goToScreen('THREADS_SCREEN_NOT_IMPLEMENTED_YET', '', {post});
|
||||
dismissBottomSheet(Screens.POST_OPTIONS);
|
||||
}, [post]);
|
||||
|
||||
return (
|
||||
<BaseOption
|
||||
i18nId={t('mobile.post_info.reply')}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ const PostOptions = ({
|
|||
return (
|
||||
<>
|
||||
{canAddReaction && <ReactionBar postId={post.id}/>}
|
||||
{canReply && <ReplyOption/>}
|
||||
{canReply && <ReplyOption post={post}/>}
|
||||
{shouldRenderFollow &&
|
||||
<FollowThreadOption
|
||||
location={location}
|
||||
|
|
|
|||
Loading…
Reference in a new issue