Created
February 28, 2017 22:10
-
-
Save hgale/11fa2d4fb16033241d2dfdbc9a15deeb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { Text, View, Button, Dimensions, Image, ScrollView } from 'react-native' | |
import { FlickrImages } from './FlickrImages' | |
import { BgView } from './Background' | |
import style from './Style' | |
class HomeScreen extends React.Component { | |
renderCells (data) { | |
return data.map((cell, index) => { | |
const {uri} = cell | |
return ( | |
<View key={index} style={style.cellContainer}> | |
<Image style={style.imageContainer} source={{uri:uri}}> | |
</Image> | |
</View> | |
) | |
}) | |
} | |
renderImageCells (cellData) { | |
return ( | |
<View style={style.imageCellsContainer}> | |
{this.renderCells(cellData)} | |
</View> | |
) | |
} | |
render() { | |
const { height } = Dimensions.get('window') | |
let cells = this.renderImageCells(FlickrImages) | |
return ( | |
<BgView> | |
<ScrollView contentContainerStyle={{justifyContent: 'center'}} style={[{height:height}]}> | |
{cells} | |
</ScrollView> | |
</BgView> | |
); | |
} | |
} | |
export default HomeScreen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment