Added Header, Icon and MessageModal. Refactor screens into directories.

This commit is contained in:
John Lyon-Smith
2018-04-02 13:22:33 -07:00
parent aa622012cd
commit 410d2fde4f
56 changed files with 556 additions and 461 deletions

View File

@@ -0,0 +1,62 @@
import React, { Component } from 'react'
import Modal from 'react-native-modal'
import PropTypes from 'prop-types'
import { View, Text, TouchableOpacity } from 'react-native'
import { Icon } from '../ui'
import autobind from 'autobind-decorator'
export class MessageModal extends Component {
static propTypes = {
open: PropTypes.bool,
icon: PropTypes.string.isRequired,
message: PropTypes.string.isRequired,
detail: PropTypes.string,
onDismiss: PropTypes.func
}
@autobind
handleButtonPress() {
const { onDismiss } = this.props
if (onDismiss) {
onDismiss()
}
}
constructor(props) {
super(props)
this.state = {
}
}
render() {
const { open, icon, message, detail } = this.props
return (
<Modal isVisible={open}>
<View style={{ alignSelf: 'center', padding: 5, backgroundColor: '#FFFFFF', flexDirection: 'row' }}>
<Icon name={icon} size={130} margin={3} />
<View style={{ marginLeft: 20, marginRight: 20, flexGrow: 1, flexDirection: 'column' }}>
<Text style={{ marginTop: 5, fontSize: 18, alignSelf: 'center' }}>{message}</Text>
<Text style={{ marginTop: 20, alignSelf: 'center' }}>{detail}</Text>
<TouchableOpacity onPress={this.handleButtonPress}
style={{
alignSelf: 'center',
backgroundColor: 'blue',
marginTop: 20,
marginBottom: 10,
justifyContent: 'center',
paddingHorizontal: 10,
height: 40,
width: 100,
backgroundColor: '#3BB0FD'
}}>
<Text style={{ alignSelf: 'center', color: 'black' }}>OK</Text>
</TouchableOpacity>
</View>
</View>
</Modal>
)
}
}