Skip to content

Commit

Permalink
Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
binoy14 committed Feb 11, 2017
1 parent 59af339 commit f85c004
Showing 1 changed file with 104 additions and 104 deletions.
208 changes: 104 additions & 104 deletions src/tile/FeaturedTile.js
Original file line number Diff line number Diff line change
@@ -1,117 +1,117 @@
import React, { PropTypes } from 'react';
import {
TouchableOpacity,
View,
Image,
StyleSheet,
Dimensions,
TouchableOpacity,
View,
Image,
StyleSheet,
Dimensions,
} from 'react-native';
import Text from '../text/Text';
import Icon from '../icons/Icon';

const FeaturedTile = ({
title,
icon,
caption,
imageSrc,
onPress,
activeOpacity,
containerStyle,
imageContainerStyle,
overlayContainerStyle,
titleStyle,
captionStyle,
width,
height,
title,
icon,
caption,
imageSrc,
onPress,
activeOpacity,
containerStyle,
imageContainerStyle,
overlayContainerStyle,
titleStyle,
captionStyle,
width,
height,
}) => {
if (!width) {
width = Dimensions.get('window').width;
}
if (!height) {
height = width * 0.8;
}
if (!width) {
width = Dimensions.get('window').width;
}
if (!height) {
height = width * 0.8;
}

const styles = StyleSheet.create({
container: {
width,
height,
},
imageContainer: {
alignItems: 'center',
justifyContent: 'center',
resizeMode: 'cover',
backgroundColor: '#ffffff',
width,
height,
},
overlayContainer: {
flex: 1,
alignItems: 'center',
backgroundColor: 'rgba(0,0,0,0.2)',
alignSelf: 'stretch',
justifyContent: 'center',
paddingLeft: 25,
paddingRight: 25,
paddingTop: 45,
paddingBottom: 40,
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
},
text: {
color: '#ffffff',
backgroundColor: 'rgba(0,0,0,0)',
marginBottom: 15,
textAlign: 'center',
},
});
const styles = StyleSheet.create({
container: {
width,
height,
},
imageContainer: {
alignItems: 'center',
justifyContent: 'center',
resizeMode: 'cover',
backgroundColor: '#ffffff',
width,
height,
},
overlayContainer: {
flex: 1,
alignItems: 'center',
backgroundColor: 'rgba(0,0,0,0.2)',
alignSelf: 'stretch',
justifyContent: 'center',
paddingLeft: 25,
paddingRight: 25,
paddingTop: 45,
paddingBottom: 40,
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
},
text: {
color: '#ffffff',
backgroundColor: 'rgba(0,0,0,0)',
marginBottom: 15,
textAlign: 'center',
},
});

return (
<TouchableOpacity
onPress={onPress}
activeOpacity={activeOpacity}
style={[
styles.container,
containerStyle && containerStyle,
]}
>
<Image
source={imageSrc}
style={[
styles.imageContainer,
imageContainerStyle && imageContainerStyle,
]}
>
<View
style={[
styles.overlayContainer,
overlayContainerStyle && overlayContainerStyle,
]}
>
{icon && <Icon {...icon} />}
<Text
h4
style={[
styles.text,
titleStyle && titleStyle,
]}
>
{title}
</Text>
<Text
style={[
styles.text,
captionStyle && captionStyle,
]}
>
{caption}
</Text>
</View>
</Image>
</TouchableOpacity>
);
return (
<TouchableOpacity
onPress={onPress}
activeOpacity={activeOpacity}
style={[
styles.container,
containerStyle && containerStyle,
]}
>
<Image
source={imageSrc}
style={[
styles.imageContainer,
imageContainerStyle && imageContainerStyle,
]}
>
<View
style={[
styles.overlayContainer,
overlayContainerStyle && overlayContainerStyle,
]}
>
{icon && <Icon {...icon} />}
<Text
h4
style={[
styles.text,
titleStyle && titleStyle,
]}
>
{title}
</Text>
<Text
style={[
styles.text,
captionStyle && captionStyle,
]}
>
{caption}
</Text>
</View>
</Image>
</TouchableOpacity>
);
};

FeaturedTile.propTypes = {
Expand Down

0 comments on commit f85c004

Please sign in to comment.