-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathBackButton.js
More file actions
58 lines (50 loc) · 988 Bytes
/
BackButton.js
File metadata and controls
58 lines (50 loc) · 988 Bytes
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
import React, { Children, PropTypes as T } from 'react'
import {
View,
Text,
StyleSheet,
Animated,
TouchableHighlight
} from 'react-native'
import Button from './Button'
import Icon from 'react-native-vector-icons/FontAwesome'
export class BackButton extends React.Component {
static propTypes = {
backgroundColor: T.string,
style: T.oneOfType([T.object, T.array]),
onBack: T.func
}
static defaultProps = {
backgroundColor: '#feff00',
style: {}
}
onPress(evt) {
if (this.props.onBack) {
this.props.onBack(evt);
}
}
render() {
return (
<Button
onPress={this.onPress.bind(this)}>
<Icon name="chevron-left" size={20} />
</Button>
)
}
}
const styles = StyleSheet.create({
wrapper: {
flex: 1,
padding: 10
},
button: {
flex: 1,
borderRadius: 2,
alignItems: 'center',
alignSelf: 'center'
},
buttonContent: {
flex: 1,
}
})
export default BackButton;