Work Item and Activity screens mostly complete

This commit is contained in:
John Lyon-Smith
2018-04-03 17:25:59 -07:00
parent 410d2fde4f
commit 72af9a7035
25 changed files with 512 additions and 141 deletions

View File

@@ -1,5 +1,5 @@
import React, { Component } from 'react'
import { Image } from 'react-native'
import { Image, View } from 'react-native'
import PropTypes from 'prop-types'
const images = {
@@ -11,6 +11,8 @@ const images = {
rightArrow: require('./images/right-arrow.png'),
search: require('./images/search.png'),
settings: require('./images/settings.png'),
add: require('./images/add.png'),
done: require('./images/done.png'),
}
export class Icon extends Component {
@@ -27,11 +29,14 @@ export class Icon extends Component {
}
render() {
let { size, name, margin, style } = this.props
let source = images[name] || images['hand']
let { name, margin, style } = this.props
let size = this.props.size - (margin * 2)
let source = images[name]
size -= margin * 2
return <Image style={[{ width: size, height: size, margin }, style]} source={source} resizeMode='stretch' />
if (!source) {
return <View style={{ width: size, height: size, margin }} />
} else {
return <Image style={[{ width: size, height: size, margin }, style]} source={source} resizeMode='stretch' />
}
}
}