-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathApp.js
62 lines (54 loc) · 1.67 KB
/
App.js
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import React from 'react';
import { StoreProvider } from 'easy-peasy';
import { ActionSheetProvider } from '@expo/react-native-action-sheet';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { AppearanceProvider } from 'react-native-appearance';
import Main from 'src/Main';
import Message from 'src/screens/Message/Message'
import device from 'src/utils/device';
import store from 'src/features/store';
class App extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
hasError: false,
};
}
componentDidCatch(e) {
return this.setState({
hasError: true,
errorMessage: device('web')
? e.stack
: `${e.toString()}\n${e.stack}`,
});
}
render() {
return (
<SafeAreaProvider>
<StoreProvider store={store}>
<AppearanceProvider>
<ActionSheetProvider>
<>
{!this.state.hasError && <Main/>}
{this.state.hasError && (
<Message
error
title="ごめんなさい!"
errorMessage={this.state.errorMessage}
description={
"Something went wrong and Juken has crashed. Reporting " +
"this error along with the screenshot of this screen and " +
"steps of reproduction would be very much appreciated!"
}
/>
)}
</>
</ActionSheetProvider>
</AppearanceProvider>
</StoreProvider>
</SafeAreaProvider>
);
}
}
App.propTypes = {};
export default App;