forked from praneetrohida/Twitter-Clone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
61 lines (56 loc) · 1.56 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
import * as Expo from "expo";
import React, { Component } from "react";
import { StyleSheet } from "react-native";
import getTheme from "./native-base-theme/components";
import platform from "./native-base-theme/variables/platform";
import material from "./native-base-theme/variables/material";
import { StackNavigator } from "react-navigation";
import LoginScreen from "./screens/login";
import HomeScreen from "./screens/home";
import ProfileScreen from "./screens/profile";
import TweetDetailsScreen from "./screens/tweetDetails";
import { Root } from "native-base";
import { Provider } from "react-redux";
import store from "./store";
import "regenerator-runtime/runtime";
console.disableYellowBox = true;
const AppNavigator = StackNavigator(
{
Login: { screen: LoginScreen },
Home: { screen: HomeScreen },
Profile: { screen: ProfileScreen },
TweetDetails: { screen: TweetDetailsScreen }
},
{
initialRouteName: "Login",
headerMode: "none"
}
);
export default class App extends Component {
constructor() {
super();
this.state = {
isLoading: true
};
}
componentWillMount() {
this.loadFonts();
}
async loadFonts() {
await Expo.Font.loadAsync({
Roboto: require("native-base/Fonts/Roboto.ttf"),
Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf")
});
this.setState({ isLoading: false });
}
render() {
if (this.state.isLoading) {
return <Expo.AppLoading />;
} else
return (
<Provider store={store}>
<AppNavigator />
</Provider>
);
}
}