-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathErrorPage.tsx
35 lines (31 loc) · 1.04 KB
/
ErrorPage.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import {NativeStackNavigationProp} from '@react-navigation/native-stack';
import React from 'react';
import {Text, View, TouchableOpacity, Image} from 'react-native';
import {RootStackParamList} from '../../App';
import {style} from './Styles';
type Props = {
navigation: NativeStackNavigationProp<RootStackParamList, 'ErrorPage'>;
};
const ErrorPage: React.FC<Props> = ({navigation}) => {
const goBackToFirstPage = () => {
navigation.navigate('SearchPage');
};
return (
<View style={style.container} testID="error-page-test">
<Image
source={{
uri: 'https://cdn0.iconfinder.com/data/icons/shift-interfaces/32/Error-512.png',
}}
style={style.img}
/>
<Text style={style.text}>
Sorry, a technical error has occurred. You may have entered a
nonexistent username.
</Text>
<TouchableOpacity onPress={goBackToFirstPage} style={style.button}>
<Text style={style.button_text}>Close</Text>
</TouchableOpacity>
</View>
);
};
export default ErrorPage;