Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.

Commit

Permalink
#154 aplicando redux na lista de medicos
Browse files Browse the repository at this point in the history
Signed-off-by: Ezequiel de Oliveira <[email protected]>
  • Loading branch information
EzequielDeOliveira authored and eliseuegewarth committed Apr 17, 2018
1 parent 77a12bd commit ef3b30d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Screens/ListScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React from 'react';
import {Text, FlatList, ScrollView, Alert} from 'react-native';
import UserItem from '../Components/UserItem';
import axios from 'axios';
import store from '../Reducers/store';


const styles = {
container: {
Expand Down Expand Up @@ -30,7 +32,7 @@ class ListScreen extends React.Component {
this.setState({loading: true});
axios.get(url, {
headers: {
'x-access-token': this.props.navigation.state.params.token
'x-access-token': store.getState().currentUser.token
}
})
.then((response) => {
Expand All @@ -50,7 +52,7 @@ class ListScreen extends React.Component {
data = {this.state.employees}
keyExtractor = {(item) => {return item._id.toString();}}
renderItem={(data) => {return <UserItem text={data.item.name}
onPress={() => this.props.navigation.navigate('profile', {userId: data.item._id, token: this.props.navigation.state.params.token})}
onPress={() => this.props.navigation.navigate('profile', {userId: data.item._id})}
/>;

}}
Expand Down

0 comments on commit ef3b30d

Please sign in to comment.