-
-
Save calvaradorivera/2b71bde3b5793be0ecc3458313db7aa4 to your computer and use it in GitHub Desktop.
Filtrar datos de un Json
This file contains 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
'use strict'; | |
import React, {Component} from 'react'; | |
import {View, Image, StyleSheet, Text, FlatList, TouchableHighlight, ScrollView} from 'react-native'; | |
import { Icon, Button, Container, Header, Content, Left } from 'native-base' | |
import AudiosData from '../../data/AudiosData.json'; | |
import MostrarAudios from './MostrarAudios' | |
export default class Audiolibros extends Component { | |
constructor(props) { | |
super (props) | |
this.state = { | |
TemaId: this.props.navigation.state.params.TemaId, | |
} | |
} | |
_renderSeparator = () => { | |
return ( | |
<View style={styles.flatseparator} /> | |
) | |
} | |
_renderItem(item) { | |
return ( | |
<TouchableHighlight style = { styles.flatview } onPress = { () => { navigate('MostrarAudios', {AudiosData}); } }> | |
<View style={{ flex: 1, justifyContent: 'center' }}> | |
if( {item.idcat} === {this.state.TemaId} ){ | |
<Text>{item.nombrelibro}</Text> | |
} | |
</View> | |
</TouchableHighlight> ) | |
} | |
render() { | |
return ( | |
<Container> | |
<Content> | |
<FlatList | |
data={AudiosData.Audiolibros} | |
keyExtractor={(item) => item.idlibro } | |
renderItem={({item}) => this._renderItem(item)} | |
ItemSeparatorComponent={this._renderSeparator}/> | |
</Content> | |
</Container>); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment