Target tracking location, BoundHeader, WorkItem page done.

This commit is contained in:
John Lyon-Smith
2018-04-04 14:25:58 -07:00
parent 72af9a7035
commit e6bd1f8fed
18 changed files with 202 additions and 29 deletions

View File

@@ -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>
)
}