forked from Kureev/react-native-navbar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNavbarButton.js
40 lines (35 loc) · 930 Bytes
/
NavbarButton.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
import React, { Component, PropTypes } from 'react';
import {
Text,
TouchableOpacity,
View,
} from 'react-native';
import styles from './styles';
export default class NavbarButton extends Component {
render() {
const { style, tintColor, margin, title, handler, disabled } = this.props;
return (
<TouchableOpacity style={styles.navBarButton} onPress={handler} disabled={disabled}>
<View style={style}>
<Text style={[styles.navBarButtonText, { color: tintColor, }, ]}>{title}</Text>
</View>
</TouchableOpacity>
);
}
static propTypes = {
style: PropTypes.oneOfType([
PropTypes.object,
PropTypes.array,
]),
tintColor: PropTypes.string,
title: PropTypes.string,
handler: PropTypes.func,
disabled: PropTypes.bool,
};
static defaultProps = {
style: {},
title: '',
tintColor: '#0076FF',
onPress: () => ({}),
};
}