1- import React , { Component } from 'react' ;
1+ import React , { Component } from 'react' ;
22import {
33 Image ,
44 StyleSheet ,
@@ -8,40 +8,39 @@ import {
88import PropTypes from 'prop-types' ;
99
1010class ImageItem extends Component {
11- constructor ( props ) {
11+ constructor ( props ) {
1212 super ( props )
1313 }
1414
1515 componentWillMount ( ) {
16- var { width} = Dimensions . get ( 'window' ) ;
17- var { imageMargin, imagesPerRow, containerWidth} = this . props ;
16+ var { width } = Dimensions . get ( 'window' ) ;
17+ var { imageMargin, imagesPerRow, containerWidth } = this . props ;
1818
19- if ( typeof containerWidth != "undefined" ) {
19+ if ( typeof containerWidth != "undefined" ) {
2020 width = containerWidth ;
2121 }
2222 this . _imageSize = ( width - ( imagesPerRow + 1 ) * imageMargin ) / imagesPerRow ;
2323 }
2424
2525 render ( ) {
26- var { item, selected, selectedMarker, imageMargin} = this . props ;
26+ var { item, selected, selectedMarker, imageMargin } = this . props ;
2727
2828 var marker = selectedMarker ? selectedMarker :
29- < Image
30- style = { [ styles . marker , { width : 25 , height : 25 } ] }
31- source = { require ( './circle-check.png' ) }
32- /> ;
29+ < Image
30+ style = { [ styles . marker , { width : 25 , height : 25 } ] }
31+ source = { require ( './circle-check.png' ) }
32+ /> ;
3333
3434 var image = item . node . image ;
3535
3636 return (
3737 < TouchableOpacity
38- style = { { marginBottom : imageMargin , marginRight : imageMargin } }
38+ style = { { marginBottom : imageMargin , marginRight : imageMargin } }
3939 onPress = { ( ) => this . _handleClick ( image ) } >
4040 < Image
41- source = { { uri : image . uri } }
42- style = { { height : this . _imageSize , width : this . _imageSize } } >
43- { ( selected ) ? marker : null }
44- </ Image >
41+ source = { { uri : image . uri } }
42+ style = { { height : this . _imageSize , width : this . _imageSize } } />
43+ { ( selected ) ? marker : null }
4544 </ TouchableOpacity >
4645 ) ;
4746 }
0 commit comments