-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
117 lines (107 loc) · 2.99 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
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
import * as React from 'react';
import { View, StyleSheet, Text, StatusBar, ActivityIndicator } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import SearchScreen from './app/screens/SearchScreen';
import { MaterialCommunityIcons } from 'react-native-vector-icons';
import { Feather } from 'react-native-vector-icons';
import thunk from 'redux-thunk';
import { Provider } from 'react-redux';
import { applyMiddleware, combineReducers, createStore } from 'redux';
import reducers from './app/reducers';
import MySongs from './app/containers/songsContainer';
import Home from './app/screens/Home';
import MyTabs from './app/screens/MyTabsScreen';
const rootReducer = combineReducers({...reducers});
const store = createStore(rootReducer, applyMiddleware(thunk));
function HomeFeed() {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: 'white'}}>
<Home />
</View>
);
}
function MyFavTabs() {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: 'white' }}>
<MyTabs/>
</View>
);
}
function MyFavSongs() {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: 'white' }}>
<MySongs />
</View>
);
}
function Search() {
return (
<View>
<SearchScreen/>
</View>
);
}
const Tab = createBottomTabNavigator();
function BottomNavTabs() {
return (
<Tab.Navigator
initialRouteName="HomeFeed"
tabBarOptions={{
activeTintColor: 'rgb(87, 198, 175)',
// activeBackgroundColor: '#83FAE7',
}}
>
<Tab.Screen
name="HomeFeed"
component={HomeFeed}
options={{
tabBarLabel: 'Home',
tabBarIcon: ({ color }) => (
<MaterialCommunityIcons name="home" color={color} size={20} />
),
}}
/>
<Tab.Screen
name="MyFavTabs"
component={MyFavTabs}
options={{
tabBarLabel: 'My Tabs',
tabBarIcon: ({ color }) => (
<MaterialCommunityIcons name="guitar-acoustic" color={color} size={20} />
),
}}
/>
<Tab.Screen
name="MyFavSongs"
component={MyFavSongs}
options={{
tabBarLabel: 'Songs',
tabBarIcon: ({ color }) => (
<MaterialCommunityIcons name="library-music" color={color} size={20} />
),
}}
/>
<Tab.Screen
name="Search"
component={Search}
options={{
tabBarLabel: 'Search',
tabBarIcon: ({ color }) => (
<Feather name="search" color={color} size={20} />
),
}}
/>
</Tab.Navigator>
);
}
const App = () => {
return (
<Provider store={store}>
<NavigationContainer>
<BottomNavTabs />
</NavigationContainer>
</Provider>
);
};
export default App;