-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
124 lines (109 loc) · 3.21 KB
/
App.js
File metadata and controls
124 lines (109 loc) · 3.21 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import React from 'react';
import {createAppContainer, createSwitchNavigator} from 'react-navigation'
import {createStackNavigator} from 'react-navigation-stack'
import { createBottomTabNavigator } from 'react-navigation-tabs';
import LoadingScreen from './src/screens/LoadingScreen'
import HomeScreen from './src/screens/HomeScreen'
import MovieScreen from './src/screens/MovieScreen'
import LoginScreen from './src/screens/LoginScreen'
import RegisterScreen from './src/screens/RegisterScreen'
import WatchScreen from './src/screens/WatchScreen'
import TvHome from './src/screens/TvHome'
import TvScreen from './src/screens/TvScreen'
import ProfileScreen from './src/screens/ProfileScreen'
import * as firebase from 'firebase'
import Icon from 'react-native-vector-icons/FontAwesome';
var firebaseConfig = {
apiKey: "AIzaSyCeqXH2LySPklDbDEyRTJsi9veMFbrupmM",
authDomain: "reactfirebasetmr.firebaseapp.com",
databaseURL: "https://reactfirebasetmr.firebaseio.com",
projectId: "reactfirebasetmr",
storageBucket: "reactfirebasetmr.appspot.com",
messagingSenderId: "120139749864",
appId: "1:120139749864:web:99969dbb64ded7b55d6c5d",
measurementId: "G-80FKVPT660"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
const AppContainer = createStackNavigator(
{
default : createBottomTabNavigator(
{
Home : {
screen: HomeScreen,
navigationOptions: {
tabBarIcon: ({tintColor}) => <Icon name="rocket" size={24} color={tintColor} />
}
},
TV : {
screen: TvHome,
navigationOptions: {
tabBarIcon: ({tintColor}) => <Icon name="envelope" size={24} color={tintColor} />
}
},
Watchlist : {
screen: WatchScreen,
navigationOptions: {
tabBarIcon: ({tintColor}) => <Icon name="user" size={24} color={tintColor} />
}
},
Profile : {
screen: ProfileScreen,
navigationOptions: {
tabBarIcon: ({tintColor}) => <Icon name="user" size={24} color={tintColor} />
}
}
},
{
defaultNavigationOptions: {
tabBarOnPress: ({navigation, defaultHandler}) => {
if(navigation.state.key == "Profile"){
navigation.navigate("postModal")
}
else{
defaultHandler();
}
}
},
tabBarOptions: {
style: {
backgroundColor: '#0f0f0f',
},
activeTintColor: "#ff0000",
inactiveTintColor: "#474747",
showLabel: true
}
}
),
postModal: {
screen: ProfileScreen
}
},
{
mode: "modal",
headerMode: "none",
//initialRouteName: "postModal"
}
);
const AuthStack = createStackNavigator({
Login : LoginScreen,
Register : RegisterScreen,
})
// const DetailStack = createStackNavigator({
// MovieDetails : MovieScreen,
// TvDetails : TvScreen
// })
export default createAppContainer(
createSwitchNavigator(
{
Loading : LoadingScreen,
App : AppContainer,
Auth : AuthStack,
MovieDetails : MovieScreen,
TvDetails : TvScreen
},
{
initialRouteName : "Loading"
}
)
);