-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Managing App-wide State with Context API, Redux Toolkit
- Loading branch information
Showing
12 changed files
with
6,052 additions
and
5,543 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import {View, FlatList, StyleSheet} from 'react-native'; | ||
import MealItem from './MealItem'; | ||
|
||
function MealsList({items}) { | ||
function renderMealItem(itemData) { | ||
const item = itemData.item; | ||
|
||
const mealItemProps = { | ||
id:item.id, | ||
title: item.title, | ||
imageUrl: item.imageUrl, | ||
affordability: item.affordability, | ||
complexity: item.complexity, | ||
duration: item.duration, | ||
}; | ||
|
||
return <MealItem {...mealItemProps}/> | ||
} | ||
|
||
|
||
return ( | ||
<View style={styles.container}> | ||
<FlatList data={items} keyExtractor={(item) => item.id} renderItem={renderMealItem}/> | ||
</View> | ||
) | ||
} | ||
|
||
export default MealsList | ||
|
||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
padding: 16 | ||
} | ||
}); |
Oops, something went wrong.