-
Notifications
You must be signed in to change notification settings - Fork 318
/
NavbarButton.js
56 lines (51 loc) · 1.09 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import React from 'react';
import {
Text,
TouchableOpacity,
View,
} from 'react-native';
import PropTypes from 'prop-types'
import styles from './styles';
export default function NavbarButton(props) {
const {
style,
tintColor,
title,
handler,
disabled,
accessible,
accessibilityLabel
} = props;
return (
<TouchableOpacity
style={styles.navBarButton}
onPress={handler}
disabled={disabled}
accessible={accessible}
accessibilityLabel={accessibilityLabel}
>
<View style={style}>
<Text style={[styles.navBarButtonText, { color: tintColor }]}>{title}</Text>
</View>
</TouchableOpacity>
);
}
NavbarButton.propTypes = {
style: PropTypes.oneOfType([
PropTypes.object,
PropTypes.array,
]),
tintColor: PropTypes.string,
title: PropTypes.string,
handler: PropTypes.func,
disabled: PropTypes.bool,
accessible: PropTypes.bool,
accessibilityLabel: PropTypes.string,
};
NavbarButton.defaultProps = {
style: {},
title: '',
tintColor: '#0076FF',
disabled: false,
handler: () => ({}),
};