A few changes:

Auto fill amount category edit
Empty list component
calendar filtering
in category screen, expenses can be added directly
This commit is contained in:
Jakob Stornig 2024-01-25 19:18:15 +01:00
parent e0f3cf947c
commit 8149ec234f
10 changed files with 97 additions and 42 deletions

View file

@ -3,7 +3,7 @@ import { NativeScrollEvent, NativeSyntheticEvent, StyleSheet, View } from 'react
import { Calendar } from 'react-native-calendars';
import { FlatList, RefreshControl } from 'react-native-gesture-handler';
import { SafeAreaView } from 'react-native-safe-area-context';
import { ExpenseItem, LoadingSymbol, Plus, TextInputBar, Welcome } from '../../../components';
import { EmptyListCompenent, ExpenseItem, LoadingSymbol, Plus, TextInputBar, Welcome } from '../../../components';
import useFetch from '../../../hooks/useFetch';
import { useRouter } from "expo-router";
@ -126,7 +126,10 @@ export default function Page() {
}, [navigation]);
const hanldeDaySelect = (date: string | undefined) => {
setFilter({...filter, day: date});
if(filter.day === date)
setFilter({...filter, day: undefined});
else
setFilter({...filter, day: date});
}
const handleMonthSelect = (date: string | undefined) => {
setFilter({...filter, month: date, day: undefined});
@ -171,9 +174,6 @@ export default function Page() {
onDayPress={(date) => {
hanldeDaySelect(date.dateString)
}}
onDayLongPress={(date) => {
hanldeDaySelect(undefined)
}}
onMonthChange={(date) => {
handleMonthSelect(date.dateString)
}}
@ -201,6 +201,7 @@ export default function Page() {
}
onScroll={handleScroll}
scrollEventThrottle={20}
ListEmptyComponent={EmptyListCompenent}
/>
</SafeAreaView>
);