diff --git a/js/Background.js b/js/Background.js index c81f8ef..dc1a358 100644 --- a/js/Background.js +++ b/js/Background.js @@ -1,6 +1,6 @@ import React from 'react' import { Image, View } from 'react-native' -import bgImage from './assets/bg_transparent.png' +import bgImage from './assets/bg_solid.png' import style from './Style' @@ -13,16 +13,12 @@ export const BaseView = (props) => { } export const BgView = (props) => { - const propStyle = { - backgroundColor: 'transparent' - } return ( ) diff --git a/js/HomeScreen.js b/js/HomeScreen.js index 74d2e17..b855baf 100644 --- a/js/HomeScreen.js +++ b/js/HomeScreen.js @@ -1,42 +1,30 @@ import React from 'react' -import { Text, View, Button, Dimensions, Image, ScrollView } from 'react-native' +import { ListView } from 'react-native' import { FlickrImages } from './FlickrImages' - +import ImageRow from './ImageRow' import { BgView } from './Background' import style from './Style' class HomeScreen extends React.Component { - renderCells (data) { - return data.map((cell, index) => { - const {uri} = cell - return ( - - - - - ) - }) - } - - renderImageCells (cellData) { - return ( - - {this.renderCells(cellData)} - - ) + constructor(props) { + super(props) + const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1.uri !== r2.uri}) + this.state = { + dataSource: ds.cloneWithRows(FlickrImages) + } } render() { - const { height } = Dimensions.get('window') - let cells = this.renderImageCells(FlickrImages) return ( - - {cells} - + } + /> - ); + ) } } diff --git a/js/ImageRow.js b/js/ImageRow.js new file mode 100644 index 0000000..eaa9b35 --- /dev/null +++ b/js/ImageRow.js @@ -0,0 +1,12 @@ + +import React from 'react' +import { View, Image } from 'react-native' + +import style from './Style' + +const ImageRow = (props) => ( + + + +) +export default ImageRow diff --git a/js/Style.js b/js/Style.js index 2e55a83..22a2354 100644 --- a/js/Style.js +++ b/js/Style.js @@ -5,7 +5,6 @@ export default StyleSheet.create({ flexDirection: 'column', flex:1, justifyContent:'center', - backgroundColor: 'transparent', paddingTop: 20, paddingLeft: 24, paddingRight: 24, @@ -15,12 +14,14 @@ export default StyleSheet.create({ }, cellContainer: { flexDirection: 'row', - paddingBottom: 10 + paddingTop: 10, + paddingLeft: 24, + paddingRight: 24, + elevation: 2 }, imageContainer: { height: 200, flex: 0.8, - resizeMode: 'cover', justifyContent:'flex-end' }, cellTitle: { @@ -34,7 +35,6 @@ export default StyleSheet.create({ flexDirection: 'column', justifyContent: 'flex-start', alignItems: 'stretch', - backgroundColor: '#2B2C2C', paddingTop: 80, paddingRight: 12, paddingBottom: 20, @@ -43,7 +43,6 @@ export default StyleSheet.create({ pageBackground: { flex: 1, width: null, - height: null, - backgroundColor: '#2B2C2C' + height: null } })