-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathArrow.js
More file actions
63 lines (56 loc) · 1.16 KB
/
Arrow.js
File metadata and controls
63 lines (56 loc) · 1.16 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
import React from 'react';
import {
StyleSheet,
ScrollView,
Text,
View,
Dimensions,
PanResponder,
Animated,
TouchableHighlight,
} from 'react-native';
const BaseArrow = ({rotationStyle}) => {
return (
<View style={[styles.root, rotationStyle]}>
<View style={[styles.arrow, styles.top]}/>
<View style={[styles.arrow, styles.bottom]}/>
</View>
)
}
const styles = StyleSheet.create({
root: {
width: '100%',
height: '100%',
flex: 1,
justifyContent: 'center',
alignItems: 'center',
position: 'relative',
},
rootRight: {
transform: [{ rotate: '180deg'}],
},
arrow: {
position: 'absolute',
height: 10,
width: 2,
backgroundColor: 'white'
},
top: {
transform: [{ rotate: '20deg'}],
borderTopLeftRadius: 2,
borderTopRightRadius: 2,
bottom: '49%',
},
bottom: {
transform: [{ rotate: '-20deg'}],
borderBottomLeftRadius: 2,
borderBottomRightRadius: 2,
top: '49%',
}
});
export const Left = props => (
<BaseArrow { ...props } rotationStyle={styles.rootLeft} />
);
export const Right = props => (
<BaseArrow { ...props } rotationStyle={styles.rootRight} />
);