Commit a9c5a990 authored by Borja's avatar Borja

Addd list and item click

parent 1dcf41fd
{
"devToolsPort": 19002,
"expoServerPort": 19000,
"packagerPort": null,
"packagerPid": null,
"packagerPort": 19001,
"packagerPid": 9700,
"expoServerNgrokUrl": "https://mf-kzf.anonymous.subastasaeat.exp.direct",
"packagerNgrokUrl": "https://packager.mf-kzf.anonymous.subastasaeat.exp.direct",
"ngrokPid": 1164
"ngrokPid": 13932,
"webpackServerPort": null
}
\ No newline at end of file
import React, { Component } from 'react';
import { FlatList, ActivityIndicator } from 'react-native';
import AuctionListItem from '../components/AuctionListItem';
import AuctionList from '../components/AuctionList';
import {
Image,
......@@ -11,13 +9,13 @@ import {
Text,
TouchableOpacity,
View,
ActivityIndicator
} from 'react-native';
import { WebBrowser } from 'expo';
import { MonoText } from '../components/StyledText';
export default class HomeScreen extends React.Component {
static navigationOptions = {
header: null,
......@@ -25,7 +23,7 @@ export default class HomeScreen extends React.Component {
constructor(props){
super(props);
this.state ={ isLoading: true}
this.state = { isLoading: true}
}
componentDidMount(){
......@@ -48,13 +46,13 @@ export default class HomeScreen extends React.Component {
render() {
if(this.state.isLoading){
return(
<View style={{flex: 1, padding: 20}}>
<ActivityIndicator/>
</View>
)
}
if(this.state.isLoading){
return(
<View style={{flex: 1, padding: 20}}>
<ActivityIndicator/>
</View>
)
}
return (
<View style={styles.container}>
......@@ -76,14 +74,9 @@ export default class HomeScreen extends React.Component {
Bienvenido a la primera app de recopilación de subastas públicas. :)
</Text>
</View>
<AuctionList dataSource={this.state.dataSource}></AuctionList>
<View style={styles.container}>
<FlatList
data={this.state.dataSource}
renderItem={({item}) => <AuctionListItem element={item}></AuctionListItem>}
keyExtractor={({id}, index) => id}
/>
</View>
</ScrollView>
</View>
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment