-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
113 lines (109 loc) · 3.9 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
import * as React from 'react';
import { Image, TouchableOpacity } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import Home from './src/Screens/Home';
import Songs from './src/Screens/Songs';
import Player from './src/Components/Player/index';
import reducers from './src/Services/redux/reducers';
import { applyMiddleware, createStore } from 'redux';
import ReduxThunk from 'redux-thunk';
import { Provider } from 'react-redux';
const store = createStore(
reducers,
{},
applyMiddleware(ReduxThunk)
);
const Stack = createStackNavigator();
function App() {
return (
<Provider store={store}>
<Player />
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen
name="Home"
component={Home}
options={({route}) => ({
headerLeft: () => (
<TouchableOpacity onPress={() => alert('Menu')}>
<Image
source={
route && route.params && route.params.isHeaderImageHidden
? require('./assets/icons/menu_black.png')
: require('./assets/icons/menu_white.png')
}
style={{height: 15, width: 25, marginLeft: 10}}
resizeMode={'stretch'}
/>
</TouchableOpacity>
),
headerRight: () => (
<TouchableOpacity onPress={() => alert('Search')}>
<Image
source={
route && route.params && route.params.isHeaderImageHidden
? require('./assets/icons/search_black.png')
: require('./assets/icons/search_white.png')
}
style={{
height: 20,
width: 20,
marginRight: 10,
}}
resizeMode={'stretch'}
/>
</TouchableOpacity>
),
headerBackTitleVisible: false,
headerTitle: false,
headerTransparent: true,
headerTintColor: '#fff',
})}
/>
<Stack.Screen
name="Songs"
component={Songs}
options={({route, navigation}) => ({
headerLeft: () => (
<TouchableOpacity onPress={() => navigation.pop()}>
<Image
source={
route && route.params && route.params.isHeaderImageHidden
? require('./assets/icons/back_black.png')
: require('./assets/icons/back_white.png')
}
style={{height: 20, width: 13, marginLeft: 10}}
resizeMode={'stretch'}
/>
</TouchableOpacity>
),
headerRight: () => (
<TouchableOpacity onPress={() => alert('Search')}>
<Image
source={
route && route.params && route.params.isHeaderImageHidden
? require('./assets/icons/search_black.png')
: require('./assets/icons/search_white.png')
}
style={{
height: 20,
width: 20,
marginRight: 10,
}}
resizeMode={'stretch'}
/>
</TouchableOpacity>
),
headerBackTitleVisible: false,
headerTitle: false,
headerTransparent: true,
headerTintColor: '#fff',
})}
/>
</Stack.Navigator>
</NavigationContainer>
</Provider>
);
}
export default App;