From 071c3640b7a3b623838df60fb03eba7a7a278e6c Mon Sep 17 00:00:00 2001 From: "Corentin \"Koroh\" RICHARD" Date: Sun, 9 Apr 2023 12:06:14 +0200 Subject: [PATCH] filter --- redux/actions/action_setCardsList.tsx | 2 +- screens/ListFav.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/redux/actions/action_setCardsList.tsx b/redux/actions/action_setCardsList.tsx index d89c3ae..708b5dd 100644 --- a/redux/actions/action_setCardsList.tsx +++ b/redux/actions/action_setCardsList.tsx @@ -5,7 +5,7 @@ import {Card} from '../../models/Card' export const setCardsList = (List: Card[]) => { return { - type: "FETCH_DATA", + type: FETCH_DATA, payload: List, }; } \ No newline at end of file diff --git a/screens/ListFav.tsx b/screens/ListFav.tsx index 1f96496..6e2768a 100644 --- a/screens/ListFav.tsx +++ b/screens/ListFav.tsx @@ -32,6 +32,9 @@ export default function ListScreen({navigation}){ const [searchValue, setSearchValue] = useState(''); + const filteredList = nList.filter(item => item.name.toLowerCase().includes(searchValue.toLowerCase())); + + return ( @@ -44,7 +47,7 @@ export default function ListScreen({navigation}){ navigation.navigate("ListFav")}>