/
lvoff
/
world_ocean
Обзор
Документация
Войти
/
lvoff
/
world_ocean
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/components/ConnectionErrorScreen.tsx
78 строк
2 KB
dlvoff
Добавил анимации
26 июн 2025, 14:05
26 июн 2025, 14:05
c80e42b
Код
Авторство
О чём код?
import React from 'react'; import { View, Text, TouchableOpacity, StyleSheet } from 'react-native'; interface ConnectionErrorScreenProps { error: string; onRetry: () => void; } const ConnectionErrorScreen: React.FC<ConnectionErrorScreenProps> = ({ error, onRetry }) => { return ( <View style={styles.container}> <Text style={styles.title}>Нет подключения</Text> <Text style={styles.text}> {error || 'Проверьте интернет-соединение'} </Text> <View style={styles.iconContainer}> <Text style={styles.icon}>!</Text> </View> <TouchableOpacity style={styles.button} onPress={onRetry}> <Text style={styles.buttonText}>Повторить попытку</Text> </TouchableOpacity> </View> ); }; const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#fff', padding: 20, }, title: { fontSize: 24, fontWeight: 'bold', marginBottom: 10, color: '#333', }, text: { fontSize: 18, textAlign: 'center', marginBottom: 20, color: '#666', }, iconContainer: { width: 80, height: 80, borderRadius: 40, backgroundColor: '#ff6b6b', justifyContent: 'center', alignItems: 'center', marginBottom: 20, }, icon: { fontSize: 40, fontWeight: 'bold', color: '#fff', }, button: { backgroundColor: '#4a90e2', paddingVertical: 12, paddingHorizontal: 30, borderRadius: 5, }, buttonText: { color: 'white', fontSize: 18, fontWeight: 'bold', }, }); export default ConnectionErrorScreen;