♻️ Update categ filter id to type

part3
Antoine PEREDERII 1 year ago
parent 37f093fc75
commit 086ea9fd3d

@ -11,7 +11,7 @@ export default function Categs(props: JokeListItemProps) {
return ( return (
<FlatList showsHorizontalScrollIndicator={false} horizontal={true} <FlatList showsHorizontalScrollIndicator={false} horizontal={true}
data={props.jokes} data={props.jokes}
keyExtractor={(item) => item.summary().toString()} keyExtractor={(item) => item.type.toString()}
renderItem={ renderItem={
({ item }: { item: CustomJoke | SampleJoke }) => ( ({ item }: { item: CustomJoke | SampleJoke }) => (
<Categ joke={item}/> <Categ joke={item}/>

@ -107,6 +107,6 @@ export abstract class Joke {
* @return {string} Une description textuelle de la blague. * @return {string} Une description textuelle de la blague.
*/ */
public description(): string { public description(): string {
return this.type + this.summary(); return this.type + ", " + this.summary();
} }
} }
Loading…
Cancel
Save