Skip to content

Instantly share code, notes, and snippets.

@pporche87
Created May 19, 2017 22:40
Show Gist options
  • Select an option

  • Save pporche87/9467da2bbca0b0ae19e81058f8b9e46e to your computer and use it in GitHub Desktop.

Select an option

Save pporche87/9467da2bbca0b0ae19e81058f8b9e46e to your computer and use it in GitHub Desktop.
import React from 'react'
import {
Text,
View,
Image,
Linking
} from 'react-native'
import {
Card,
CardSection,
Button } from './components'
const GymDetail = ({ business }) => {
const {
name,
display_phone,
image_url,
url
} = business
const {
headerContentStyle,
headerTextStyle,
imageStyle
} = styles
return (
<Card>
<CardSection>
<View style={headerContentStyle}>
<Text style={headerTextStyle}>{name}</Text>
<Text>{display_phone}</Text>
</View>
</CardSection>
<CardSection>
<Image
style={imageStyle}
source={{ uri: image_url }}
/>
</CardSection>
<CardSection>
<Button onPress={() => Linking.openURL(url)}>
Check out on Yelp!
</Button>
</CardSection>
</Card>
)
}
const styles = {
headerContentStyle: {
flexDirection: 'column',
justifyContent: 'space-around',
},
headerTextStyle : {
fontSize: 18
},
imageStyle : {
height: 300,
flex: 1,
width: null
}
}
export default GymDetail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment