diff --git a/frontend/app/(tabs)/inbox.tsx b/frontend/app/(tabs)/inbox.tsx index 4c9d2a9..a0384b8 100644 --- a/frontend/app/(tabs)/inbox.tsx +++ b/frontend/app/(tabs)/inbox.tsx @@ -3,11 +3,13 @@ import { ActivityIndicator, Animated, FlatList, + Keyboard, Platform, Pressable, StyleSheet, Text, TextInput, + TouchableWithoutFeedback, View, } from 'react-native'; import { BlurView } from 'expo-blur'; @@ -242,90 +244,104 @@ export default function InboxScreen() { const isSearching = searchText.trim().length > 0; return ( - - - {topSafeSpace > 0 && } - - - - - - - {searchText.length > 0 ? ( - setSearchText('')} - accessibilityLabel="Clear search" - accessibilityRole="button" - hitSlop={8} - style={styles.clearButton} - > - - - ) : null} - - - item._id} - style={styles.list} - contentContainerStyle={[ - styles.listContent, - { paddingBottom: insets.bottom + spacing.xxl }, - ]} - contentInsetAdjustmentBehavior="automatic" - keyboardShouldPersistTaps="handled" - ListEmptyComponent={ - - + + + {topSafeSpace > 0 && } + + + + - - } - renderItem={({ item, index }) => { - const conversation = item as ConversationRowItem; - const pictureId = - typeof conversation.otherUser?.picture === 'string' - ? conversation.otherUser.picture - : null; - const avatarUrl = pictureId ? (resolvedOtherUserAvatarUrls[pictureId] ?? null) : null; - return ( - - router.push({ - pathname: '/conversations/[id]', - params: { id: String(item._id) }, - } as never) - } + + { + Keyboard.dismiss(); + }} /> - ); - }} - ItemSeparatorComponent={ItemSeparator} - /> + {searchText.length > 0 ? ( + setSearchText('')} + accessibilityLabel="Clear search" + accessibilityRole="button" + hitSlop={8} + style={styles.clearButton} + > + + + ) : null} + + + item._id} + style={styles.list} + contentContainerStyle={[ + styles.listContent, + { paddingBottom: insets.bottom + spacing.xxl }, + ]} + contentInsetAdjustmentBehavior="automatic" + keyboardShouldPersistTaps="handled" + ListEmptyComponent={ + + + + } + renderItem={({ item, index }) => { + const conversation = item as ConversationRowItem; + const pictureId = + typeof conversation.otherUser?.picture === 'string' + ? conversation.otherUser.picture + : null; + const avatarUrl = pictureId ? (resolvedOtherUserAvatarUrls[pictureId] ?? null) : null; + return ( + + router.push({ + pathname: '/conversations/[id]', + params: { id: String(item._id) }, + } as never) + } + /> + ); + }} + ItemSeparatorComponent={ItemSeparator} + /> + - + ); }