Target tracking location, BoundHeader, WorkItem page done.
This commit is contained in:
@@ -9,17 +9,36 @@ const headerButtonShape = { icon: PropTypes.string.isRequired, onPress: PropType
|
||||
export class Header extends Component {
|
||||
static propTypes = {
|
||||
title: PropTypes.string.isRequired,
|
||||
leftButton: PropTypes.shape(headerButtonShape),
|
||||
leftButton: PropTypes.shape(headerButtonShape).isRequired,
|
||||
rightButton: PropTypes.shape(headerButtonShape),
|
||||
disabled: PropTypes.bool,
|
||||
}
|
||||
|
||||
static defaultProps = {
|
||||
rightButton: { icon: 'none' },
|
||||
leftButton: { icon: 'none' },
|
||||
visible: true,
|
||||
}
|
||||
|
||||
render() {
|
||||
const { title, leftButton, rightButton } = this.props
|
||||
const { title, leftButton, rightButton, disabled, visible } = this.props
|
||||
let right = null
|
||||
|
||||
if (!rightButton) {
|
||||
right = (
|
||||
<Icon name='' size={24} style={{ marginRight: 15 }} />
|
||||
)
|
||||
} else if (disabled) {
|
||||
right = (
|
||||
<Icon name={rightButton.icon} size={24} style={{ marginRight: 15, tintColor: 'lightgrey' }} />
|
||||
)
|
||||
} else {
|
||||
right = (
|
||||
<TouchableOpacity onPress={rightButton.onPress}>
|
||||
<Icon name={rightButton.icon} size={24} style={{ marginRight: 15, tintColor: 'grey' }} />
|
||||
</TouchableOpacity>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={{
|
||||
@@ -35,9 +54,7 @@ export class Header extends Component {
|
||||
<Icon name={leftButton.icon} size={24} style={{ marginLeft: 15, tintColor: 'gray' }} />
|
||||
</TouchableOpacity>
|
||||
<Text style={{ color: 'gray', fontSize: 18, }}>{title}</Text>
|
||||
<TouchableOpacity onPress={rightButton.onPress}>
|
||||
<Icon name={rightButton.icon} size={24} style={{ marginRight: 15, tintColor: 'gray' }} />
|
||||
</TouchableOpacity>
|
||||
{right}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user