Fix critical bugs: SQL query, navigation, and Surface overflow warnings

This commit is contained in:
Bivekich
2025-08-06 05:36:22 +03:00
parent b3166b1dfe
commit 07eda45235
4 changed files with 97 additions and 12 deletions

View File

@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react';
import { View, StyleSheet, FlatList, ScrollView, Animated, TouchableOpacity } from 'react-native';
import { Searchbar, List, Avatar, Text, Chip, FAB, Divider, IconButton, SegmentedButtons, Surface, Button, ActivityIndicator, Badge } from 'react-native-paper';
import { Searchbar, List, Avatar, Text, Chip, FAB, Divider, IconButton, SegmentedButtons, Button, ActivityIndicator, Badge } from 'react-native-paper';
import { useQuery, useMutation } from '@apollo/client';
import { GET_USERS } from '../graphql/queries';
import { CREATE_PRIVATE_CONVERSATION } from '../graphql/mutations';
@ -88,7 +88,7 @@ export const ContactsScreen = ({ navigation }: any) => {
onPress={() => handleStartChat(item.id)}
disabled={isCreatingChat}
>
<Surface style={styles.userCard} elevation={1}>
<View style={[styles.userCard, styles.userCardShadow]}>
<View style={styles.userContent}>
<View style={styles.avatarContainer}>
<Avatar.Text
@ -145,7 +145,7 @@ export const ContactsScreen = ({ navigation }: any) => {
)}
</View>
</View>
</Surface>
</View>
</TouchableOpacity>
</Animated.View>
);
@ -180,7 +180,7 @@ export const ContactsScreen = ({ navigation }: any) => {
return (
<View style={styles.container}>
{/* Заголовок с поиском */}
<Surface style={styles.header} elevation={2}>
<View style={[styles.header, styles.headerShadow]}>
<View style={styles.searchContainer}>
<Searchbar
placeholder="Поиск по @username..."
@ -210,7 +210,7 @@ export const ContactsScreen = ({ navigation }: any) => {
<Text variant="bodySmall" style={styles.statLabel}>в сети</Text>
</View>
</View>
</Surface>
</View>
<SegmentedButtons
value={selectedTab}
@ -280,6 +280,7 @@ const styles = StyleSheet.create({
header: {
backgroundColor: '#ffffff',
paddingBottom: 16,
elevation: 2,
},
searchContainer: {
padding: 16,
@ -332,7 +333,26 @@ const styles = StyleSheet.create({
backgroundColor: '#ffffff',
borderRadius: 16,
marginBottom: 12,
overflow: 'hidden',
},
userCardShadow: {
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 1,
},
shadowOpacity: 0.1,
shadowRadius: 2,
elevation: 2,
},
headerShadow: {
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: 0.1,
shadowRadius: 4,
elevation: 4,
},
userContent: {
flexDirection: 'row',

View File

@ -122,7 +122,7 @@ export const ConversationsScreen = ({ navigation }: any) => {
<FAB
icon="plus"
style={styles.fab}
onPress={() => navigation.navigate('NewChat')}
onPress={() => navigation.navigate('Contacts')}
/>
</View>
);