diff --git a/src/components/Card.js b/src/components/Card.js new file mode 100644 index 0000000..62ed520 --- /dev/null +++ b/src/components/Card.js @@ -0,0 +1,72 @@ +import React, { PropTypes } from 'react'; +import { + Text, + Image, + StyleSheet, + View +} from 'react-native'; + +const defaultProps = { + title: '', + subTitle: '', + image: '', + imagePosition: 'left', + backgroundColor: 'rgb(238, 219, 214)' +}; + +const propTypes = { + title: PropTypes.string, + image: PropTypes.object, + subTitle: PropTypes.string, + imagePosition: PropTypes.string, +}; + +const styles = StyleSheet.create({ + container: { + height: 200, + }, + img: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + // height: 200, + }, + desc: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + }, + title: { + fontSize: 20, + fontFamily: 'Cochin', + fontWeight: 'bold', + color: '#2c2c2c', + textDecorationLine: 'underline', + marginBottom: 10, + }, + subTitle: { + fontSize: 14, + fontFamily: 'Cochin', + fontWeight: 'bold', + color: '#2c2c2c' + } +}); + +const Card = (props) => { + let flexDirection = props.imagePosition === 'left' ? 'row' : 'row-reverse'; + return( + + + + {props.title} + {props.subTitle} + + + ); +} + + +Card.propTypes = propTypes; +Card.defaultProps = defaultProps; + +export default Card; diff --git a/src/containers/Home.js b/src/containers/Home.js index 33c5baf..104ae76 100644 --- a/src/containers/Home.js +++ b/src/containers/Home.js @@ -5,6 +5,7 @@ import { View, } from 'react-native'; import Banner from '../components/Banner' +import Card from '../components/Card' const styles = StyleSheet.create({ container: { @@ -32,6 +33,18 @@ export default class Login extends Component { return ( + + ); }