Fix critical bugs: SQL query, navigation, and Surface overflow warnings
This commit is contained in:
@ -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',
|
||||
|
@ -122,7 +122,7 @@ export const ConversationsScreen = ({ navigation }: any) => {
|
||||
<FAB
|
||||
icon="plus"
|
||||
style={styles.fab}
|
||||
onPress={() => navigation.navigate('NewChat')}
|
||||
onPress={() => navigation.navigate('Contacts')}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
|
Reference in New Issue
Block a user