-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathApp.js
56 lines (49 loc) · 1.68 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
/**
* This file is used by the native apps.
*/
import React from "react";
import { View, StatusBar } from "react-native";
import { Provider as StoreProvider } from "react-redux";
import { I18nextProvider } from "react-i18next";
import i18n from "./src/i18n/i18n";
import Routing, { Router, Switch } from "./src/utilities/routing/index";
import { BackButton } from "./src/utilities/routing/router";
import store from "./src/utilities/storage/store";
import Colors from "./src/styles/colors";
import LoginScreen from "./src/containers/LoginScreenContainer";
import RegisterScreen from "./src/containers/RegisterScreenContainer";
import RecentsScreen from "./src/containers/RecentsScreenContainer";
import ChatScreen from "./src/containers/ChatScreenContainer";
const Route = Routing.Route;
class App extends React.Component {
render() {
const App = (props, context) => (
<View style={{ height: "100%" }}>
<StatusBar
animated={true}
backgroundColor={Colors.ACCENT}
barStyle={"light-content"}
/>
{props.children}
</View>
);
return (
<StoreProvider store={store}>
<I18nextProvider i18n={i18n}>
<Router>
<App>
<BackButton />
<Switch>
<Route exact path="/" component={LoginScreen} />
<Route exact path="/auth/register" component={RegisterScreen} />
<Route exact path="/chat" component={RecentsScreen} />
<Route exact path="/chat/:pubkey" component={ChatScreen} />
</Switch>
</App>
</Router>
</I18nextProvider>
</StoreProvider>
);
}
}
export default App;