diff --git a/app.json b/app.json index 0ac3df179..c3fd8bf56 100644 --- a/app.json +++ b/app.json @@ -1,11 +1,11 @@ { "expo": { - "version": "2.0.9", + "version": "2.1.0", "ios": { - "buildNumber": "36" + "buildNumber": "40" }, "android": { - "versionCode": 234 + "versionCode": 239 } } } diff --git a/components/Chat/Chat.tsx b/components/Chat/Chat.tsx deleted file mode 100644 index 58e0d30ca..000000000 --- a/components/Chat/Chat.tsx +++ /dev/null @@ -1,638 +0,0 @@ -// import { useSelect } from "@data/store/storeHelpers"; -// import { FlashList } from "@shopify/flash-list"; -// import { itemSeparatorColor, tertiaryBackgroundColor } from "@styles/colors"; -// import { useAppTheme } from "@theme/useAppTheme"; -// import { getCleanAddress } from "@utils/evm/address"; -// import { FrameWithType, messageHasFrames } from "@utils/frames"; -// import differenceInCalendarDays from "date-fns/differenceInCalendarDays"; -// import React, { useCallback, useEffect, useMemo, useRef } from "react"; -// import { -// ColorSchemeName, -// Dimensions, -// FlatList, -// Keyboard, -// Platform, -// StyleSheet, -// View, -// useColorScheme, -// } from "react-native"; -// import Animated, { -// useAnimatedStyle, -// useDerivedValue, -// useSharedValue, -// } from "react-native-reanimated"; -// import { useSafeAreaInsets } from "react-native-safe-area-context"; -// import { useShallow } from "zustand/react/shallow"; - -// import { -// useChatStore, -// useCurrentAccount, -// useProfilesStore, -// useRecommendationsStore, -// } from "../../data/store/accountsStore"; -// import { XmtpConversationWithUpdate } from "../../data/store/chatStore"; -// import { useFramesStore } from "../../data/store/framesStore"; -// import { ExternalWalletPicker } from "../../features/ExternalWalletPicker/ExternalWalletPicker"; -// import { ExternalWalletPickerContextProvider } from "../../features/ExternalWalletPicker/ExternalWalletPicker.context"; -// import { -// ReanimatedFlashList, -// ReanimatedFlatList, -// ReanimatedView, -// } from "../../utils/animations"; -// import { useKeyboardAnimation } from "../../utils/animations/keyboardAnimation"; -// import { isAttachmentMessage } from "@utils/attachment/isAttachmentMessage"; -// import { useConversationContext } from "../../utils/conversation"; -// import { converseEventEmitter } from "../../utils/events"; -// import { getProfile, getProfileData } from "../../utils/profile"; -// import { UUID_REGEX } from "../../utils/regex"; -// import { isContentType } from "../../utils/xmtpRN/contentTypes"; -// import { Recommendation } from "../Recommendations/Recommendation"; -// import ChatPlaceholder from "./ChatPlaceholder/ChatPlaceholder"; -// import ConsentPopup from "./ConsentPopup/ConsentPopup"; -// import { GroupConsentPopup } from "./ConsentPopup/GroupConsentPopup"; -// import ChatInput from "./Input/Input"; -// import CachedChatMessage, { MessageToDisplay } from "./Message/Message"; -// import { useMessageReactionsStore } from "./Message/MessageReactions/MessageReactionsDrawer/MessageReactions.store"; -// import { MessageReactionsDrawer } from "./Message/MessageReactions/MessageReactionsDrawer/MessageReactionsDrawer"; - -// const usePeerSocials = () => { -// const conversation = useConversationContext("conversation"); -// const peerSocials = useProfilesStore( -// useShallow((s) => -// conversation?.peerAddress -// ? getProfile(conversation.peerAddress, s.profiles)?.socials -// : undefined -// ) -// ); - -// return peerSocials; -// }; - -// const useRenderItem = ({ -// xmtpAddress, -// conversation, -// messageFramesMap, -// colorScheme, -// }: { -// xmtpAddress: string; -// conversation: XmtpConversationWithUpdate | undefined; -// messageFramesMap: { -// [messageId: string]: FrameWithType[]; -// }; -// colorScheme: ColorSchemeName; -// }) => { -// return useCallback( -// ({ item }: { item: MessageToDisplay }) => { -// return ( -// -// ); -// }, -// [colorScheme, xmtpAddress, conversation?.isGroup, messageFramesMap] -// ); -// }; - -// const getItemType = (item: MessageToDisplay) => { -// const fromMeString = item.fromMe ? "fromMe" : "notFromMe"; -// return `${item.contentType}-${fromMeString}`; -// }; - -// const getListArray = ( -// xmtpAddress?: string, -// conversation?: XmtpConversationWithUpdate, -// lastMessages?: number // Optional parameter to limit the number of messages -// ) => { -// const messageAttachments = useChatStore.getState().messageAttachments; - -// const isAttachmentLoading = (messageId: string) => { -// const attachment = messageAttachments && messageAttachments[messageId]; -// return attachment?.loading; -// }; - -// if (!conversation) return []; -// const reverseArray = []; -// // Filter out unwanted content types before list or reactions out of order can mess up the logic -// const filteredMessageIds = conversation.messagesIds.filter((messageId) => { -// const message = conversation.messages.get(messageId) as MessageToDisplay; -// if (!message || (!message.content && !message.contentFallback)) -// return false; - -// // Reactions & read receipts are not displayed in the flow -// const notDisplayedContentTypes = [ -// "xmtp.org/reaction:", -// "xmtp.org/readReceipt:", -// ]; - -// if (isAttachmentMessage(message.contentType) && UUID_REGEX.test(message.id)) -// return false; - -// return !notDisplayedContentTypes.some((c) => -// message.contentType.startsWith(c) -// ); -// }); - -// let latestSettledFromMeIndex = -1; -// let latestSettledFromPeerIndex = -1; - -// for (let index = filteredMessageIds.length - 1; index >= 0; index--) { -// const messageId = filteredMessageIds[index]; -// const message = conversation.messages.get(messageId) as MessageToDisplay; - -// message.fromMe = -// !!xmtpAddress && -// xmtpAddress.toLowerCase() === message.senderAddress.toLowerCase(); - -// message.hasNextMessageInSeries = false; -// message.hasPreviousMessageInSeries = false; - -// if (index > 0) { -// const previousMessageId = filteredMessageIds[index - 1]; -// const previousMessage = conversation.messages.get(previousMessageId); - -// if (previousMessage) { -// message.dateChange = -// differenceInCalendarDays(message.sent, previousMessage.sent) > 0; - -// if ( -// previousMessage.senderAddress.toLowerCase() === -// message.senderAddress.toLowerCase() && -// !message.dateChange && -// !isContentType("groupUpdated", previousMessage.contentType) -// ) { -// message.hasPreviousMessageInSeries = true; -// } -// } -// } else { -// message.dateChange = true; -// } - -// if (index < filteredMessageIds.length - 1) { -// const nextMessageId = filteredMessageIds[index + 1]; -// const nextMessage = conversation.messages.get(nextMessageId); - -// if (nextMessage) { -// // Here we need to check if next message has a date change -// const nextMessageDateChange = -// differenceInCalendarDays(nextMessage.sent, message.sent) > 0; - -// if ( -// nextMessage.senderAddress.toLowerCase() === -// message.senderAddress.toLowerCase() && -// !nextMessageDateChange && -// !isContentType("groupUpdated", nextMessage.contentType) -// ) { -// message.hasNextMessageInSeries = true; -// } -// } -// } - -// if ( -// message.fromMe && -// message.status !== "sending" && -// message.status !== "prepared" && -// latestSettledFromMeIndex === -1 -// ) { -// latestSettledFromMeIndex = reverseArray.length; -// } - -// if (!message.fromMe && latestSettledFromPeerIndex === -1) { -// latestSettledFromPeerIndex = reverseArray.length; -// } - -// message.isLatestSettledFromMe = -// reverseArray.length === latestSettledFromMeIndex; -// message.isLatestSettledFromPeer = -// reverseArray.length === latestSettledFromPeerIndex; - -// if (index === filteredMessageIds.length - 1) { -// message.isLoadingAttachment = -// isAttachmentMessage(message.contentType) && -// isAttachmentLoading(message.id); -// } - -// if (index === filteredMessageIds.length - 2) { -// const nextMessageId = filteredMessageIds[index + 1]; -// const nextMessage = conversation.messages.get(nextMessageId); -// message.nextMessageIsLoadingAttachment = -// isAttachmentMessage(nextMessage?.contentType) && -// isAttachmentLoading(nextMessageId); -// } - -// reverseArray.push(message); -// } - -// // If lastMessages is defined, slice the array to return only the last n messages -// if (lastMessages !== undefined) { -// return reverseArray.slice(0, lastMessages); -// } - -// return reverseArray; -// }; - -// const useAnimatedListView = ( -// conversation: XmtpConversationWithUpdate | undefined -// ) => { -// // The first message was really buggy on iOS & Android and this is due to FlashList -// // so we keep FlatList for new convos and switch to FlashList for bigger convos -// // that need great perf. -// return useMemo(() => { -// const isConversationNotPending = conversation && !conversation.pending; -// return isConversationNotPending ? ReanimatedFlashList : ReanimatedFlatList; -// }, [conversation]); -// }; - -// const useIsShowingPlaceholder = ({ -// messages, -// isBlockedPeer, -// conversation, -// }: { -// messages: MessageToDisplay[]; -// isBlockedPeer: boolean; -// conversation: XmtpConversationWithUpdate | undefined; -// }): boolean => { -// return messages.length === 0 || isBlockedPeer || !conversation; -// }; - -// const keyExtractor = (item: MessageToDisplay) => item.id; - -// export function Chat() { -// const conversation = useConversationContext("conversation"); -// const AnimatedListView = useAnimatedListView(conversation); -// const isBlockedPeer = useConversationContext("isBlockedPeer"); -// const onReadyToFocus = useConversationContext("onReadyToFocus"); -// const frameTextInputFocused = useConversationContext("frameTextInputFocused"); -// const rolledUpReactions = -// useMessageReactionsStore.getState().rolledUpReactions; - -// const xmtpAddress = useCurrentAccount() as string; -// const peerSocials = usePeerSocials(); -// const recommendationsData = useRecommendationsStore( -// useShallow((s) => -// conversation?.peerAddress ? s.frens[conversation.peerAddress] : undefined -// ) -// ); - -// const colorScheme = useColorScheme(); -// const styles = useStyles(); - -// const messageAttachmentsLength = useChatStore( -// useShallow((s) => Object.keys(s.messageAttachments).length) -// ); - -// const listArray = useMemo( -// () => getListArray(xmtpAddress, conversation), -// // eslint-disable-next-line react-hooks/exhaustive-deps -// [ -// xmtpAddress, -// conversation, -// conversation?.lastUpdateAt, -// messageAttachmentsLength, -// ] -// ); - -// const DEFAULT_INPUT_HEIGHT = 58; -// const chatInputHeight = useSharedValue(0); -// const chatInputDisplayedHeight = useDerivedValue(() => { -// return frameTextInputFocused -// ? 0 -// : chatInputHeight.value + DEFAULT_INPUT_HEIGHT; -// }); - -// const insets = useSafeAreaInsets(); - -// const { height: keyboardHeight } = useKeyboardAnimation(); -// const tertiary = tertiaryBackgroundColor(colorScheme); - -// const showChatInput = !!( -// conversation && -// !isBlockedPeer && -// (!conversation.isGroup || -// conversation.groupMembers.includes(getCleanAddress(xmtpAddress))) -// ); - -// const textInputStyle = useAnimatedStyle( -// () => ({ -// position: "absolute", -// width: "100%", -// backgroundColor: tertiary, -// height: "auto", -// zIndex: 1, -// transform: [ -// { translateY: -Math.max(insets.bottom, keyboardHeight.value) }, -// ] as any, -// }), -// [keyboardHeight, insets.bottom] -// ); - -// useEffect(() => { -// const unsubscribe = useMessageReactionsStore.subscribe((state) => { -// if (state.rolledUpReactions) { -// Keyboard.dismiss(); -// } -// }); -// return unsubscribe; -// }, [rolledUpReactions]); - -// const chatContentStyle = useAnimatedStyle( -// () => ({ -// ...styles.chatContent, -// paddingBottom: showChatInput -// ? chatInputDisplayedHeight.value + -// Math.max(insets.bottom, keyboardHeight.value) -// : insets.bottom, -// }), -// [showChatInput, keyboardHeight, chatInputDisplayedHeight, insets.bottom] -// ); - -// const ListFooterComponent = useMemo(() => { -// const recommendationData = getProfileData(recommendationsData, peerSocials); -// if (!recommendationData || !conversation?.peerAddress) return null; -// return ( -// -// -// -// ); -// }, [ -// conversation?.peerAddress, -// peerSocials, -// recommendationsData, -// styles.inChatRecommendations, -// ]); - -// const { messageFramesMap, frames: framesStore } = useFramesStore( -// useSelect(["messageFramesMap", "frames"]) -// ); - -// const showPlaceholder = useIsShowingPlaceholder({ -// messages: listArray, -// isBlockedPeer, -// conversation, -// }); - -// const renderItem = useRenderItem({ -// xmtpAddress, -// conversation, -// messageFramesMap, -// colorScheme, -// }); - -// const messageListRef = useRef< -// FlatList | FlashList | undefined -// >(); - -// const scrollToMessage = useCallback( -// (data: { messageId?: string; index?: number; animated?: boolean }) => { -// let index = data.index; - -// if (index === undefined && data.messageId) { -// index = listArray.findIndex((m) => m.id === data.messageId); -// } - -// if (index !== undefined) { -// messageListRef.current?.scrollToIndex({ -// index, -// viewPosition: 0.5, -// animated: !!data.animated, -// }); -// } -// }, -// [listArray] -// ); - -// useEffect(() => { -// converseEventEmitter.on("scrollChatToMessage", scrollToMessage); - -// return () => { -// converseEventEmitter.off("scrollChatToMessage", scrollToMessage); -// }; -// }, [scrollToMessage]); - -// const handleOnLayout = useCallback(() => { -// setTimeout(() => { -// onReadyToFocus(); -// }, 50); -// }, [onReadyToFocus]); - -// return ( -// -// -// -// {conversation && listArray.length > 0 && !isBlockedPeer && ( -// { -// if (r) { -// messageListRef.current = r; -// } -// }} -// keyboardDismissMode="interactive" -// automaticallyAdjustContentInsets={false} -// contentInsetAdjustmentBehavior="never" -// // Causes a glitch on Android, no sure we need it for now -// // maintainVisibleContentPosition={{ -// // minIndexForVisible: 0, -// // autoscrollToTopThreshold: 100, -// // }} -// estimatedListSize={Dimensions.get("screen")} -// inverted -// keyExtractor={keyExtractor} -// getItemType={getItemType} -// keyboardShouldPersistTaps="handled" -// estimatedItemSize={80} -// // Size glitch on Android -// showsVerticalScrollIndicator={Platform.OS === "ios"} -// pointerEvents="auto" -// ListFooterComponent={ListFooterComponent} -// /> -// )} -// {conversation?.isGroup ? : } -// -// {showChatInput && ( -// <> -// -// -// -// -// -// )} -// -// -// -// -// ); -// } - -// // Lightweight chat preview component used for longpress on chat -// export function ChatPreview() { -// const conversation = useConversationContext("conversation"); -// const AnimatedListView = useAnimatedListView(conversation); -// const isBlockedPeer = useConversationContext("isBlockedPeer"); -// const onReadyToFocus = useConversationContext("onReadyToFocus"); - -// const xmtpAddress = useCurrentAccount() as string; -// const peerSocials = usePeerSocials(); - -// const colorScheme = useColorScheme(); -// const styles = useStyles(); -// const messageAttachmentsLength = useChatStore( -// useShallow((s) => Object.keys(s.messageAttachments).length) -// ); - -// const listArray = useMemo( -// // Get only the last 20 messages for performance in preview -// () => getListArray(xmtpAddress, conversation, 20), -// // eslint-disable-next-line react-hooks/exhaustive-deps -// [ -// xmtpAddress, -// conversation, -// conversation?.lastUpdateAt, -// messageAttachmentsLength, -// ] -// ); - -// const { frames: framesStore, messageFramesMap } = useFramesStore( -// useSelect(["frames", "messageFramesMap"]) -// ); - -// const showPlaceholder = useIsShowingPlaceholder({ -// messages: listArray, -// isBlockedPeer, -// conversation, -// }); - -// const renderItem = useRenderItem({ -// xmtpAddress, -// conversation, -// messageFramesMap, -// colorScheme, -// }); - -// const keyExtractor = useCallback((item: MessageToDisplay) => item.id, []); - -// const messageListRef = useRef< -// FlatList | FlashList | undefined -// >(); - -// const handleOnLayout = useCallback(() => { -// setTimeout(() => { -// onReadyToFocus(); -// }, 50); -// }, [onReadyToFocus]); - -// return ( -// -// -// {conversation && listArray.length > 0 && !isBlockedPeer && ( -// { -// if (r) { -// messageListRef.current = r; -// } -// }} -// keyboardDismissMode="interactive" -// automaticallyAdjustContentInsets={false} -// contentInsetAdjustmentBehavior="never" -// estimatedListSize={Dimensions.get("screen")} -// inverted -// keyExtractor={keyExtractor} -// getItemType={getItemType} -// keyboardShouldPersistTaps="handled" -// estimatedItemSize={80} -// showsVerticalScrollIndicator={false} -// pointerEvents="none" -// /> -// )} -// {showPlaceholder && !conversation?.isGroup && ( -// -// )} -// -// -// ); -// } - -// const useStyles = () => { -// const colorScheme = useColorScheme(); -// const { theme } = useAppTheme(); - -// return useMemo( -// () => -// StyleSheet.create({ -// chatContainer: { -// flex: 1, -// justifyContent: "flex-end", -// backgroundColor: theme.colors.background.surface, -// }, -// chatContent: { -// backgroundColor: theme.colors.background.surface, -// flex: 1, -// }, -// chatPreviewContent: { -// backgroundColor: theme.colors.background.surface, -// flex: 1, -// paddingBottom: 0, -// }, -// chat: { -// backgroundColor: theme.colors.background.surface, -// }, -// inputBottomFiller: { -// position: "absolute", -// width: "100%", -// bottom: 0, -// backgroundColor: theme.colors.background.surface, -// zIndex: 0, -// }, -// inChatRecommendations: { -// borderBottomWidth: 0.5, -// borderBottomColor: itemSeparatorColor(colorScheme), -// marginHorizontal: 20, -// marginBottom: 10, -// }, -// }), -// [colorScheme, theme] -// ); -// }; diff --git a/components/Chat/ChatDumb.tsx b/components/Chat/ChatDumb.tsx deleted file mode 100644 index c96644195..000000000 --- a/components/Chat/ChatDumb.tsx +++ /dev/null @@ -1,244 +0,0 @@ -import { FlashList, ListRenderItem } from "@shopify/flash-list"; -import { - backgroundColor, - itemSeparatorColor, - tertiaryBackgroundColor, -} from "@styles/colors"; -import React, { useCallback, useEffect, useMemo, useRef } from "react"; -import { - FlatList, - Platform, - StyleSheet, - View, - useColorScheme, -} from "react-native"; -import Animated, { - useAnimatedStyle, - useDerivedValue, - useSharedValue, -} from "react-native-reanimated"; -import { useSafeAreaInsets } from "react-native-safe-area-context"; -import { RemoteAttachmentContent } from "@xmtp/react-native-sdk"; -import { ReanimatedFlashList } from "../../utils/animations"; -import { useKeyboardAnimation } from "../../utils/animations/keyboardAnimation"; -import { converseEventEmitter } from "../../utils/events"; - -type ChatDumbProps = { - onReadyToFocus: () => void; - frameTextInputFocused: boolean; - items: T[]; - renderItem: ListRenderItem; - keyExtractor: (item: T) => string; - showChatInput: boolean; - ListFooterComponent: React.JSX.Element | null; - showPlaceholder: boolean; - key?: string; - displayList: boolean; - refreshing: boolean; - getItemType: ( - item: T, - index: number, - extraData?: any - ) => string | number | undefined; - placeholderComponent: React.JSX.Element | null; - extraData?: any; - itemToId: (id: T) => string; - onSend: (payload: { - text?: string; - referencedMessageId?: string; - attachment?: RemoteAttachmentContent; - }) => Promise; -}; - -const useStyles = () => { - const colorScheme = useColorScheme(); - return useMemo( - () => - StyleSheet.create({ - chatContainer: { - flex: 1, - justifyContent: "flex-end", - backgroundColor: backgroundColor(colorScheme), - }, - chatContent: { - backgroundColor: backgroundColor(colorScheme), - flex: 1, - }, - chatPreviewContent: { - backgroundColor: backgroundColor(colorScheme), - flex: 1, - paddingBottom: 0, - }, - chat: { - backgroundColor: backgroundColor(colorScheme), - }, - inputBottomFiller: { - position: "absolute", - width: "100%", - bottom: 0, - backgroundColor: backgroundColor(colorScheme), - zIndex: 0, - }, - inChatRecommendations: { - borderBottomWidth: 0.5, - borderBottomColor: itemSeparatorColor(colorScheme), - marginHorizontal: 20, - marginBottom: 10, - }, - }), - [colorScheme] - ); -}; - -export function ChatDumb({ - onReadyToFocus, - frameTextInputFocused, - items, - renderItem, - keyExtractor, - showChatInput, - showPlaceholder, - key, - displayList, - refreshing, - ListFooterComponent, - getItemType, - placeholderComponent, - extraData, - itemToId, - onSend, -}: ChatDumbProps) { - const colorScheme = useColorScheme(); - const styles = useStyles(); - - const hideInputIfFrameFocused = Platform.OS !== "web"; - - const DEFAULT_INPUT_HEIGHT = 58; - const chatInputHeight = useSharedValue(0); - const chatInputDisplayedHeight = useDerivedValue(() => { - return frameTextInputFocused && hideInputIfFrameFocused - ? 0 - : chatInputHeight.value + DEFAULT_INPUT_HEIGHT; - }); - - const insets = useSafeAreaInsets(); - - const { height: keyboardHeight } = useKeyboardAnimation(); - const tertiary = tertiaryBackgroundColor(colorScheme); - - const textInputStyle = useAnimatedStyle( - () => ({ - position: "absolute", - width: "100%", - backgroundColor: tertiary, - height: "auto", - zIndex: 1, - transform: [ - { translateY: -Math.max(insets.bottom, keyboardHeight.value) }, - ] as any, - }), - [keyboardHeight, colorScheme, insets.bottom] - ); - - const chatContentStyle = useAnimatedStyle( - () => ({ - ...styles.chatContent, - paddingBottom: showChatInput - ? chatInputDisplayedHeight.value + - Math.max(insets.bottom, keyboardHeight.value) - : insets.bottom, - }), - [showChatInput, keyboardHeight, chatInputDisplayedHeight, insets.bottom] - ); - - const messageListRef = useRef | FlashList | undefined>(); - - const scrollToMessage = useCallback( - (data: { messageId?: string; index?: number; animated?: boolean }) => { - let index = data.index; - if (index === undefined && data.messageId) { - index = items.findIndex((m) => itemToId(m) === data.messageId); - } - if (index !== undefined) { - messageListRef.current?.scrollToIndex({ - index, - viewPosition: 0.5, - animated: !!data.animated, - }); - } - }, - [itemToId, items] - ); - - useEffect(() => { - converseEventEmitter.on("scrollChatToMessage", scrollToMessage); - return () => { - converseEventEmitter.off("scrollChatToMessage", scrollToMessage); - }; - }, [scrollToMessage]); - - const handleOnLayout = useCallback(() => { - setTimeout(() => { - onReadyToFocus(); - }, 50); - }, [onReadyToFocus]); - - return ( - - - {displayList && ( - - )} - {showPlaceholder && placeholderComponent} - - {/* {showChatInput && ( - <> - - - - - - )} */} - - ); -} diff --git a/components/Chat/ChatPlaceholder/ChatPlaceholder.tsx b/components/Chat/ChatPlaceholder/ChatPlaceholder.tsx deleted file mode 100644 index 0849e2416..000000000 --- a/components/Chat/ChatPlaceholder/ChatPlaceholder.tsx +++ /dev/null @@ -1,165 +0,0 @@ -// import { Button } from "@design-system/Button/Button"; -// import { translate } from "@i18n"; -// import { actionSheetColors, textPrimaryColor } from "@styles/colors"; -// import { isV3Topic } from "@utils/groupUtils/groupId"; -// import { -// Keyboard, -// Platform, -// StyleSheet, -// Text, -// TouchableWithoutFeedback, -// useColorScheme, -// View, -// } from "react-native"; - -// import { -// currentAccount, -// useProfilesStore, -// useRecommendationsStore, -// useSettingsStore, -// } from "../../../data/store/accountsStore"; -// import { useConversationContext } from "../../../utils/conversation"; -// import { sendMessage } from "../../../utils/message"; -// import { getProfile, getProfileData } from "../../../utils/profile"; -// import { conversationName } from "../../../utils/str"; -// import ActivityIndicator from "../../ActivityIndicator/ActivityIndicator"; -// import { Recommendation } from "../../Recommendations/Recommendation"; -// import { showActionSheetWithOptions } from "../../StateHandlers/ActionSheetStateHandler"; -// import { consentToAddressesOnProtocolByAccount } from "@utils/xmtpRN/contacts"; -// import { DmWithCodecsType } from "@utils/xmtpRN/client"; -// import { useInboxProfileSocials } from "@hooks/useInboxProfileSocials"; - -// type Props = { -// messagesCount: number; -// dm: DmWithCodecsType | undefined | null; -// }; - -// export function DmChatPlaceholder({ messagesCount, dm }: Props) { -// const topic = useConversationContext("topic"); -// const onReadyToFocus = useConversationContext("onReadyToFocus"); -// const colorScheme = useColorScheme(); -// const styles = useStyles(); -// const { peerAddress } = useInboxProfileSocials(dm?.); -// const peerSocials = useProfilesStore((s) => -// dm?.peerAddress -// ? getProfile(conversation.peerAddress, s.profiles)?.socials -// : undefined -// ); -// const profileData = getProfileData(recommendationData, peerSocials); -// return ( -// { -// Keyboard.dismiss(); -// }} -// > -// { -// if (conversation && !isBlockedPeer && messagesCount === 0) { -// onReadyToFocus(); -// } -// }} -// style={styles.chatPlaceholder} -// > -// {!conversation && ( -// -// {!topic && } -// -// {topic -// ? isV3Topic(topic) -// ? translate("group_not_found") -// : translate("conversation_not_found") -// : translate("opening_conversation")} -// -// -// )} -// {conversation && isBlockedPeer && ( -// -// This user is blocked -//