From 5a9b76a3ff9cd2281aefb68067767f92ad39b9d2 Mon Sep 17 00:00:00 2001 From: Thomas Schleicher Date: Wed, 20 Dec 2023 18:36:43 +0000 Subject: [PATCH] Resolve "Budget" --- app/(tabs)/_layout.tsx | 5 +- app/(tabs)/budget/index.tsx | 47 ++++++++++--------- app/(tabs)/home/index.tsx | 4 +- app/(tabs)/stats/index.tsx | 27 ++++++++++- .../common/{customCard => }/CustomCard.tsx | 2 +- .../common/{searchBar => }/SearchBar.tsx | 4 +- .../{loadingSymbol => }/loadingSymbol.tsx | 0 components/common/{plus => }/plus.tsx | 2 +- components/home/expenseItem/expenseItem.tsx | 2 +- 9 files changed, 60 insertions(+), 33 deletions(-) rename components/common/{customCard => }/CustomCard.tsx (95%) rename components/common/{searchBar => }/SearchBar.tsx (94%) rename components/common/{loadingSymbol => }/loadingSymbol.tsx (100%) rename components/common/{plus => }/plus.tsx (93%) diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx index ab3ebb5..616b2d3 100644 --- a/app/(tabs)/_layout.tsx +++ b/app/(tabs)/_layout.tsx @@ -16,10 +16,11 @@ export default function Layout() { const styles = StyleSheet.create({ sceneContainer: { - backgroundColor: useThemeColor("backgroundColor"), + backgroundColor: useThemeColor("containerColor"), }, tabBar: { backgroundColor: useThemeColor("backgroundColor"), + borderTopColor: useThemeColor("backgroundColor"), } }); @@ -42,6 +43,7 @@ export default function Layout() { tabBarLabel: "Budget", tabBarIcon: ({size, color}) => ( ), + unmountOnBlur: true, } }/> ( ), + unmountOnBlur: true, } }/> diff --git a/app/(tabs)/budget/index.tsx b/app/(tabs)/budget/index.tsx index 275373d..62b3162 100644 --- a/app/(tabs)/budget/index.tsx +++ b/app/(tabs)/budget/index.tsx @@ -1,27 +1,28 @@ -import { StyleSheet, Text, View } from 'react-native'; -import { deleteExpenses } from '../../../services/database'; +import { SafeAreaView, StyleSheet, Switch, Text } from 'react-native'; export default function Page() { - return ( - - { - deleteExpenses().then(() => { - console.log("Expenses Deleted!"); - }) - }}>Reset Expenses - ); -} + const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + }, + switch: { + transform: [{ scaleX: 1.3 }, { scaleY: 1.3 }], + }, + text: { + color: "red", + fontSize: 40, + } + }); -const styles = StyleSheet.create({ - container: { - flex: 1, - justifyContent: 'center', - alignItems: 'center', - }, - text: { - textAlign: 'center', - fontSize: 40, - color: "red", - } -}); \ No newline at end of file + // const {data, isLoading, reFetch} = useFetch(); + + return ( + + Hallo wo bin ich?! + + + ); +} \ No newline at end of file diff --git a/app/(tabs)/home/index.tsx b/app/(tabs)/home/index.tsx index 132c2cf..aa1ef7e 100644 --- a/app/(tabs)/home/index.tsx +++ b/app/(tabs)/home/index.tsx @@ -14,8 +14,8 @@ export default function Page() { //Styles const styles = StyleSheet.create({ safeAreaViewStyle: { - flex: 1, - backgroundColor: useThemeColor("backgroundColor") + flex: 1, + backgroundColor: useThemeColor("containerColor"), }, container: { flex: 1, diff --git a/app/(tabs)/stats/index.tsx b/app/(tabs)/stats/index.tsx index 3efc6c1..85c1636 100644 --- a/app/(tabs)/stats/index.tsx +++ b/app/(tabs)/stats/index.tsx @@ -1,5 +1,28 @@ -import { Text } from 'react-native'; +import { StyleSheet, Text, View } from 'react-native'; +import { deleteExpenses } from '../../../services/database'; export default function Page() { - return Stats Page; + const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + }, + text: { + textAlign: 'center', + fontSize: 40, + color: "red", + } + }); + + + + return ( + + { + deleteExpenses().then(() => { + console.log("Expenses Deleted!"); + }) + }}>Reset Expenses + ); } diff --git a/components/common/customCard/CustomCard.tsx b/components/common/CustomCard.tsx similarity index 95% rename from components/common/customCard/CustomCard.tsx rename to components/common/CustomCard.tsx index b19eea5..dccc478 100644 --- a/components/common/customCard/CustomCard.tsx +++ b/components/common/CustomCard.tsx @@ -1,7 +1,7 @@ import React from 'react' import { Platform, StyleSheet, View } from 'react-native' import { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes' -import { useThemeColor } from '../../../hooks/useThemeColor' +import { useThemeColor } from '../../hooks/useThemeColor' function generateBoxShadowStyle( xOffset: number, diff --git a/components/common/searchBar/SearchBar.tsx b/components/common/SearchBar.tsx similarity index 94% rename from components/common/searchBar/SearchBar.tsx rename to components/common/SearchBar.tsx index fe538f6..7b7e01f 100644 --- a/components/common/searchBar/SearchBar.tsx +++ b/components/common/SearchBar.tsx @@ -1,8 +1,8 @@ import { AntDesign } from '@expo/vector-icons'; import React from 'react'; import { StyleSheet, TextInput, TouchableOpacity, View, ViewProps } from 'react-native'; -import { SIZES } from '../../../constants/theme'; -import { useThemeColor } from '../../../hooks/useThemeColor'; +import { SIZES } from '../../constants/theme'; +import { useThemeColor } from '../../hooks/useThemeColor'; type SearchBarProps = {placeholder: string} & ViewProps diff --git a/components/common/loadingSymbol/loadingSymbol.tsx b/components/common/loadingSymbol.tsx similarity index 100% rename from components/common/loadingSymbol/loadingSymbol.tsx rename to components/common/loadingSymbol.tsx diff --git a/components/common/plus/plus.tsx b/components/common/plus.tsx similarity index 93% rename from components/common/plus/plus.tsx rename to components/common/plus.tsx index 8ae1b15..374dad8 100644 --- a/components/common/plus/plus.tsx +++ b/components/common/plus.tsx @@ -1,7 +1,7 @@ import { AntDesign } from '@expo/vector-icons' import React from 'react' import { StyleSheet, TouchableOpacity, ViewProps } from 'react-native' -import { useThemeColor } from '../../../hooks/useThemeColor' +import { useThemeColor } from '../../hooks/useThemeColor' type PlusProps = ViewProps & {onPress? : ()=> void | undefined} diff --git a/components/home/expenseItem/expenseItem.tsx b/components/home/expenseItem/expenseItem.tsx index b103132..81ce109 100644 --- a/components/home/expenseItem/expenseItem.tsx +++ b/components/home/expenseItem/expenseItem.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { ColorValue, StyleSheet, Text, View } from 'react-native'; import { SIZES } from '../../../constants/theme'; import { useThemeColor } from '../../../hooks/useThemeColor'; -import CustomCard from "../../common/customCard/CustomCard"; +import CustomCard from "../../common/CustomCard"; export type ExpenseItemProps = {color: ColorValue, category: string, title: string, date: string, value : string} export default function ExpenseItem(itemProps : ExpenseItemProps) {