fixed the budget element and implemented onPress
This commit is contained in:
parent
deda54152b
commit
7606c5d1b8
3 changed files with 50 additions and 26 deletions
|
|
@ -37,6 +37,10 @@ export default function Page() {
|
|||
}
|
||||
};
|
||||
|
||||
const handleCategoryPress = (item: {[column: string]: any;}) => {
|
||||
console.log(item.category_name);
|
||||
}
|
||||
|
||||
return (
|
||||
<SafeAreaView style={[styles.safeAreaViewStyle, {backgroundColor: containerColor}]}>
|
||||
<BudgetHeader selectedPage={selectedPage} handlePageSelection={handlePageSelection}/>
|
||||
|
|
@ -48,7 +52,15 @@ export default function Page() {
|
|||
{isLoading ? (<LoadingSymbol/>) : (
|
||||
<FlatList
|
||||
data={data}
|
||||
renderItem = {({item}) => <CategoryItem category={item.category_name} allocated_amount={item.allocated_amount ?? 0} color={item.category_color} category_guid={item.category_guid} total_expenses={item.total_expenses ?? 0}/>}
|
||||
renderItem = {({item}) => <CategoryItem
|
||||
category={item.category_name}
|
||||
allocated_amount={item.allocated_amount ?? 0}
|
||||
color={item.category_color}
|
||||
category_guid={item.category_guid}
|
||||
total_expenses={item.total_expenses ?? 0}
|
||||
onPress={() => {
|
||||
handleCategoryPress(item);
|
||||
}}/>}
|
||||
keyExtractor={item => item.category_guid}
|
||||
ItemSeparatorComponent={() => {
|
||||
return (<View style={styles.itemSeperatorStyle}/>);
|
||||
|
|
|
|||
Reference in a new issue