Skip to content

Commit

Permalink
feat: revamp error message screen w/copy error button
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexogamer committed Dec 28, 2023
1 parent 61843c8 commit acdc55e
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {withTranslation} from 'react-i18next';
// import ConfirmHcaptcha from '@hcaptcha/react-native-hcaptcha';
import notifee, {EventType} from '@notifee/react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
import Clipboard from '@react-native-clipboard/clipboard';
import {GestureHandlerRootView} from 'react-native-gesture-handler';
import MaterialIcon from 'react-native-vector-icons/MaterialIcons';
import SideMenuBase from '@rexovolt/react-native-side-menu';
Expand Down Expand Up @@ -606,11 +607,9 @@ function ErrorMessage({
}) {
console.error(`[APP] Uncaught error: ${error}`);
return (
<>
<View style={{flex: 1, padding: 16, justifyContent: 'center'}}>
<Text
style={{
flex: 1,
padding: 15,
alignItems: 'center',
justifyContent: 'center',
textAlign: 'center',
Expand All @@ -620,17 +619,33 @@ function ErrorMessage({
</Text>
We made a fucky wucky!! A wittle fucko boingo! The code monkeys at our
headquarters are working VEWY HAWD to fix this! {'>w<\n\n'}
<Text style={{color: '#ff5555', fontWeight: 'regular'}}>
On a more serious note, please let us know that you experienced the
following error:
</Text>
<View
style={{
backgroundColor: currentTheme.background,
borderRadius: 8,
marginVertical: 16,
padding: 16,
}}>
<Text font={'JetBrains Mono'} colour={'#ff5555'}>
{error.toString()}
</Text>
</Text>
</View>
<Button
onPress={() => {
Clipboard.setString(error.toString());
}}>
<Text>Copy error message</Text>
</Button>
<Button
onPress={() => {
resetErrorBoundary();
}}>
<Text>Reload app</Text>
</Button>
</>
</View>
);
}

Expand Down

0 comments on commit acdc55e

Please sign in to comment.