Skip to content

Commit

Permalink
Passa dados para PlaceDetails
Browse files Browse the repository at this point in the history
  • Loading branch information
victormiguez committed Sep 27, 2017
1 parent 075d46a commit f26e53c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export default function PlaceDetails(props) {

return (
<View>
<Text>ID: {id}</Text>
<Image
source={{ uri: image }}
style={styles.image} />
Expand Down
16 changes: 3 additions & 13 deletions dojos/20170927-react-native/demo/screens/Details.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
View,
} from 'react-native';

import PlaceDetails from '../components/PlaceDetails.js';

class Details extends React.Component {
static navigationOptions = {
title: 'Detalhes',
Expand Down Expand Up @@ -34,21 +36,9 @@ class Details extends React.Component {

render() {
return (
<View>
<Image
source={{ uri: this.state.place.image }}
style={styles.image} />
<Text>{this.state.place.name}</Text>
</View>
<PlaceDetails data={this.state.place}/>
);
}
}

const styles = StyleSheet.create({
image: {
height: 100,
width: 320,
},
});

export default Details;

0 comments on commit f26e53c

Please sign in to comment.