Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import { StyleSheet, Text, View, FlatList } from 'react-native';
- import { ListItem } from 'react-native-elements';
- const list = [
- {
- name: JSON.stringify(friend),
- subtitle: JSON.stringify(phone)
- }
- ]
- const FriendDetails = ({ route, navigation }) => {
- const { friend } = route.params;
- const { phone } = route.params;
- keyExtractor = (item, index) => index.toString()
- renderItem = ({ item }) => (
- <ListItem
- title={item.name}
- subtitle={item.subtitle}
- //leftAvatar={{ source: { uri: item.avatar_url } }}
- bottomDivider
- chevron
- />
- )
- //keyExtractor = (item, index) => index.toString()
- //renderItem = ({ item }) => (
- // return (
- // <ListItem
- // title= {JSON.stringify(friend)}
- // subtitle={JSON.stringify(phone)}
- // leftAvatar={{ source: { uri: 'https://s3.amazonaws.com/uifaces/faces/twitter/adhamdannaway/128.jpg'} }}
- // bottomDivider
- // />
- //<View style={styles.container}>
- // <Text>{JSON.stringify(friend)} {JSON.stringify(phone)}</Text>
- // </View>
- //);
- }
- render () {
- return (
- <FlatList
- keyExtractor={this.keyExtractor}
- data={list}
- renderItem={this.renderItem}
- />
- )
- }
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- backgroundColor: '#fff',
- alignItems: 'center',
- justifyContent: 'center',
- },
- });
- export default FriendDetails;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement