From 955cbb8b2883f14e3a0f202bcaeac9bb4dd0740b Mon Sep 17 00:00:00 2001 From: Saul Carlin Date: Thu, 30 May 2024 21:55:27 -0700 Subject: [PATCH] Simplify the main convo list view --- src/components/ConversationListHeader.tsx | 116 ++++++++++++---------- src/i18n/locales/en.json | 19 +--- src/screens/ConversationListScreen.tsx | 22 +--- 3 files changed, 69 insertions(+), 88 deletions(-) diff --git a/src/components/ConversationListHeader.tsx b/src/components/ConversationListHeader.tsx index f89b95a..eae95b3 100644 --- a/src/components/ConversationListHeader.tsx +++ b/src/components/ConversationListHeader.tsx @@ -2,7 +2,6 @@ import {Box, HStack, VStack} from 'native-base'; import React, {FC, useCallback} from 'react'; import {Pressable} from 'react-native'; import {AvatarWithFallback} from '../components/AvatarWithFallback'; -import {Button} from '../components/common/Button'; import {Icon} from '../components/common/Icon'; import {Text} from '../components/common/Text'; import {useAddress} from '../hooks/useAddress'; @@ -10,7 +9,6 @@ import {useContactInfo} from '../hooks/useContactInfo'; import {useTypedNavigation} from '../hooks/useTypedNavigation'; import {translate} from '../i18n'; import {ScreenNames} from '../navigation/ScreenNames'; -import {colors} from '../theme/colors'; export interface ConversationListHeaderProps { list: 'ALL_MESSAGES' | 'MESSAGE_REQUESTS'; @@ -29,6 +27,10 @@ export const ConversationListHeader: FC = ({ const {address} = useAddress(); const {avatarUrl} = useContactInfo(address); + const handleNewMessagePress = useCallback(() => { + navigate(ScreenNames.Search); + }, [navigate]); + const handleAccountPress = useCallback(() => { navigate(ScreenNames.Account); }, [navigate]); @@ -52,13 +54,12 @@ export const ConversationListHeader: FC = ({ size={40} /> - + > - + } + */} + + {translate('group_chats')} + + + + + - - {list === 'MESSAGE_REQUESTS' ? ( - - - {translate('message_requests_from_new_addresses')} - - - ) : messageRequestCount > 0 ? ( - - - - - + {/* { + list === 'MESSAGE_REQUESTS' ? ( + - {translate('message_requests_count', { - count: String(messageRequestCount), - })} + typography="text-caption/regular" + textAlign={'center'} + color={colors.actionAlertText}> + {translate('message_requests_from_new_addresses')} - - + ) : messageRequestCount > 0 ? ( + + + + + + - - - - ) : ( - - )} - + typography="text-xs/bold"> + {translate('message_requests_count', { + count: String(messageRequestCount), + })} + + + + + + + ) : ( + + ) + } */} + ); }; diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index f3435c0..f959d8b 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -8,7 +8,6 @@ "create_new_wallet": "Create new wallet", "you": "You", "search": "Search", - "youve_got_no_messages": "You’ve got no messages", "start_a_conversation_to_get_going": "Start a conversation to get going!", "filter_conversations": "Filter conversations", @@ -19,34 +18,25 @@ "no": "No", "yes": "Yes", "start": "Start", - "recents": "Recents", "contacts": "Contacts", - "your_interoperable_web3_inbox": "Your interoperable web3 inbox", "youre_just_a_few_steps_away_from_secure_wallet_to_wallet_messaging": "You're just a few steps away from secure, wallet-to-wallet messaging", "connect_your_wallet": "Connect your wallet", "you_can_connect_or_create": "You can connect or create a wallet via Wallet Connect.", "whats_a_wallet": "What's a wallet?", "no_private_keys_will_be_shared": "No private keys will be shared", - "step_1_of_2": "Step 1 of 2", "create_your_xmtp_identity": "Create your XMTP identity", "now_that_your_wallet_is_connected": "Now that your wallet is connected, we’re going to create your XMTP identity on our network with a wallet signature.", "create_xmtp_identity": "Create XMTP identity", "step_2_of_2": "Step 2 of 2", - "domain_origin": "Domain origin", - "copy_your_code": "Copy your code", - "allow": "Allow", "block": "Block", - "yesterday": "Yesterday", - "conversation_image_alt": "Attached Image", - "walletconnect": "WalletConnect", "metamask": "Metamask", "coinbase_wallet": "Coinbase Wallet", @@ -54,7 +44,6 @@ "group_changed": "Group Changed", "add_to_group": "Add", "group": "Group", - "dev_screen": "Dev Screen", "client": "Client", "address": "Address", @@ -66,11 +55,9 @@ "get_groups": "Get Groups", "get_contacts": "Get Contacts", "group_name": "Group Name", - "valid_address": "Valid Ethereum Address", "message_requests_from_new_addresses": "Message requests from addresses you’ve never interacted with show up here", "not_on_xmtp_group": "User can't be added to group because they are not on XMTP Group network", - "wallet_error": "Wallet Error", "group_add_single": "%{initiatedByAddress} added %{address}", "group_add_plural": "%{initiatedByAddress} added %{addressCount} members", @@ -79,7 +66,7 @@ "error_group_remove": "An error occurred removing from group", "error_group_adding": "An error occurred adding to group", "reply": "Reply", - "conversation_replying_to": "Replying to %{name}", - "replied_to": "Replied to an earlier message" -} + "replied_to": "Replied to an earlier message", + "group_chats": "Group Chats" +} \ No newline at end of file diff --git a/src/screens/ConversationListScreen.tsx b/src/screens/ConversationListScreen.tsx index fc2de07..a30b523 100644 --- a/src/screens/ConversationListScreen.tsx +++ b/src/screens/ConversationListScreen.tsx @@ -1,6 +1,6 @@ import {useIsFocused} from '@react-navigation/native'; import {Group} from '@xmtp/react-native-sdk'; -import {Box, Center, Fab, FlatList, HStack, VStack} from 'native-base'; +import {Box, Center, FlatList, HStack, VStack} from 'native-base'; import React, {useCallback, useMemo, useState} from 'react'; import {ListRenderItem, Pressable} from 'react-native'; import {ConversationListHeader} from '../components/ConversationListHeader'; @@ -152,26 +152,6 @@ export const ConversationListScreen = () => { renderItem={renderItem} ListFooterComponent={} /> - {!showPickerModal && focused && ( - - } - /> - )}