forked from catalinmiron/react-native-dating-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
119 lines (110 loc) · 3.22 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
118
119
import React, { Component } from 'react';
import { Constants, Components } from 'expo';
import {
LayoutAnimation,
ScrollView,
Animated,
TouchableOpacity,
Alert,
Image,
Dimensions,
Text,
View,
StyleSheet,
StatusBar
} from 'react-native';
import styles, { BAR_HEIGHT } from './components/styles.js';
import Header from './components/Header';
const { Svg } = Components;
const { Stop, Defs, LinearGradient, G, Use, Circle, Ellipse } = Components.Svg;
import { Ionicons } from '@expo/vector-icons';
import Router from './AppRouter';
var { height, width } = Dimensions.get('window');
import {
NavigationProvider,
StackNavigation,
SharedElementOverlay
} from '@expo/ex-navigation';
class TopHeader extends Component {
render() {
return (
<Svg height={BAR_HEIGHT} width={width} style={styles.headerShadow}>
<Defs>
<LinearGradient id="grad" x1="0%" y1="0%" x2="0%" y2="100%">
<Stop offset="0" stopColor="#FF0EE5" stopOpacity="1" />
<Stop offset="1" stopColor="#FF0088" stopOpacity="1" />
</LinearGradient>
<G id="shape">
<G>
<Ellipse
cx={width / 2}
cy="0"
rx={100 + width / 2}
ry={BAR_HEIGHT}
/>
</G>
</G>
</Defs>
<Use href="#shape" x="0" y="0" fill="url(#grad)" />
</Svg>
);
}
}
export default class App extends Component {
componentDidMount() {
StatusBar.setBarStyle('light-content');
}
render() {
return (
<NavigationProvider router={Router}>
<SharedElementOverlay>
<StackNavigation
initialRoute="home"
defaultRouteConfig={{
navigationBar: {
tintColor: '#FFF',
renderLeft: props => (
<Ionicons
name="ios-menu"
size={34}
onPress={() => Alert.alert('button pressed')}
style={[
styles.shadow,
{
backgroundColor: 'transparent',
marginTop: 4,
marginLeft: 14,
shadowColor: '#000'
}
]}
color={props.config.navigationBar.tintColor}
/>
),
renderRight: props => (
<Ionicons
name="ios-options"
onPress={() => Alert.alert('button pressed')}
size={30}
style={[
styles.shadow,
{
backgroundColor: 'transparent',
marginTop: 8,
marginRight: 14
}
]}
color={props.config.navigationBar.tintColor}
/>
),
renderTitle: props => (
<Header {...props.config.navigationBar} />
),
renderBackground: () => <TopHeader />
}
}}
/>
</SharedElementOverlay>
</NavigationProvider>
);
}
}