From bc40d6db80fa86d453eb02dfa44bb2441f5c9049 Mon Sep 17 00:00:00 2001 From: Louis Date: Tue, 27 Aug 2024 16:01:47 +0200 Subject: [PATCH 1/7] Show removed group conversation messages instead of unblock button Linked to issue #559 --- .../ChatPlaceholder/GroupChatPlaceholder.tsx | 52 +++---------------- 1 file changed, 7 insertions(+), 45 deletions(-) diff --git a/components/Chat/ChatPlaceholder/GroupChatPlaceholder.tsx b/components/Chat/ChatPlaceholder/GroupChatPlaceholder.tsx index cafec112a..4ad9d9684 100644 --- a/components/Chat/ChatPlaceholder/GroupChatPlaceholder.tsx +++ b/components/Chat/ChatPlaceholder/GroupChatPlaceholder.tsx @@ -3,7 +3,7 @@ import { useGroupMembers } from "@hooks/useGroupMembers"; import { useGroupName } from "@hooks/useGroupName"; import { translate } from "@i18n"; import { useGroupQuery } from "@queries/useGroupQuery"; -import { actionSheetColors, textPrimaryColor } from "@styles/colors"; +import { textPrimaryColor } from "@styles/colors"; import { useCallback, useMemo } from "react"; import { Keyboard, @@ -20,7 +20,6 @@ import { useConversationContext } from "../../../utils/conversation"; import { sendMessage } from "../../../utils/message"; import ActivityIndicator from "../../ActivityIndicator/ActivityIndicator"; import Button from "../../Button/Button"; -import { showActionSheetWithOptions } from "../../StateHandlers/ActionSheetStateHandler"; type Props = { messagesCount: number; @@ -77,26 +76,6 @@ export function GroupChatPlaceholder({ messagesCount }: Props) { } }, [conversation, messagesCount, onReadyToFocus]); - const onUnblock = useCallback(() => { - showActionSheetWithOptions( - { - options: [translate("unblock"), translate("cancel")], - cancelButtonIndex: 1, - destructiveButtonIndex: isBlockedGroup ? undefined : 0, - title: translate("if_you_unblock_group"), - ...actionSheetColors(colorScheme), - }, - (selectedIndex?: number) => { - if (selectedIndex === 0) { - allowGroup({ - includeCreator: false, - includeAddedBy: false, - }); - } - } - ); - }, [isBlockedGroup, colorScheme, allowGroup]); - return ( @@ -108,38 +87,21 @@ export function GroupChatPlaceholder({ messagesCount }: Props) { )} - {conversation && isBlockedGroup && ( + {conversation && messagesCount === 0 && !groupCreatedByUser && ( - {translate("this_group_is_blocked")} + This is the beginning of your{"\n"}conversation in {groupName} +