Created
May 19, 2017 22:40
-
-
Save pporche87/9467da2bbca0b0ae19e81058f8b9e46e to your computer and use it in GitHub Desktop.
This file contains hidden or 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, | |
| 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