diff --git a/app/(tabs)/budget/_layout.tsx b/app/(tabs)/budget/_layout.tsx
index 238abc6..ce907f3 100644
--- a/app/(tabs)/budget/_layout.tsx
+++ b/app/(tabs)/budget/_layout.tsx
@@ -5,6 +5,7 @@ export default function _Layout() {
+
);
}
\ No newline at end of file
diff --git a/app/(tabs)/budget/addCategory.tsx b/app/(tabs)/budget/addCategory.tsx
index c211406..904f37c 100644
--- a/app/(tabs)/budget/addCategory.tsx
+++ b/app/(tabs)/budget/addCategory.tsx
@@ -9,8 +9,8 @@ const addCategory = () => {
const parameters = useLocalSearchParams();
- const [categoryName, setCartegoryName] = useState("Enter Category Name...");
- const [categoryColor, setCartegoryColor] = useState(null);
+ const [categoryName, setCategoryName] = useState("Enter Category Name...");
+ const [categoryColor, setCategoryColor] = useState(null);
const [selectedType, setSelectedType] = useState("expense");
return (
@@ -20,7 +20,7 @@ const addCategory = () => {
{
- setCartegoryName(newName);
+ setCategoryName(newName);
}}/>
@@ -33,7 +33,7 @@ const addCategory = () => {
{
- setCartegoryColor(color);
+ setCategoryColor(color);
}}/>
diff --git a/app/(tabs)/budget/category.tsx b/app/(tabs)/budget/category.tsx
new file mode 100644
index 0000000..dc283bf
--- /dev/null
+++ b/app/(tabs)/budget/category.tsx
@@ -0,0 +1,95 @@
+import { FontAwesome } from "@expo/vector-icons";
+import { router, useLocalSearchParams } from "expo-router";
+import { FlatList, SafeAreaView, StyleSheet, Text, TouchableOpacity, View } from "react-native";
+import { ExpenseItem, LoadingSymbol, TextInputBar } from "../../../components";
+import useFetch from "../../../hooks/useFetch";
+import { useTheme } from "../../contexts/ThemeContext";
+
+export default function Page() {
+ const {colors} = useTheme();
+ const {category_guid, category_name} = useLocalSearchParams();
+
+ const {data, isLoading, reFetch} = useFetch({sql: "SELECT e.guid AS expense_guid, e.name AS expense_name, c.name AS category_name, e.datetime AS expense_datetime, e.amount AS expense_amount, c.color AS category_color FROM expense e JOIN category c ON e.category_guid = c.guid WHERE c.guid = ? ORDER BY expense_datetime desc;", args: [category_guid]});
+
+ const handleEditCategory = () => {
+ console.log("edit category");
+ }
+
+ const handleBackButton = () => {
+ router.back();
+ }
+
+ return (
+
+
+
+ Back
+
+
+
+ {category_name}
+
+
+
+
+
+ {isLoading ? () : (
+ }
+ keyExtractor={item => item.guid}
+ ItemSeparatorComponent={() => {
+ return ();
+ }}
+ />
+ )}
+
+ );
+}
+
+const styles = StyleSheet.create({
+ safeAreaView: {
+ flex: 1,
+ },
+ itemSeperator: {
+ margin: 5,
+ },
+ categoryEditTouchableOpacity: {
+ borderRadius: 10,
+ flexDirection: "row",
+ justifyContent: "space-around",
+ margin: 10,
+ },
+ editButtonText: {
+ fontSize: 30,
+ padding: 10,
+ fontWeight: "bold",
+ },
+ iconEdit: {
+ paddingVertical: 10,
+ paddingRight: 10,
+ },
+ searchBar: {
+ marginHorizontal: 10,
+ marginBottom:20,
+ },
+ iconBack: {
+ paddingLeft: 10,
+ paddingRight: 5,
+ },
+ backText: {
+ fontSize: 20,
+ padding: 5,
+ },
+ backContainer: {
+ flexDirection: "row",
+ justifyContent: "flex-start",
+ }
+});
diff --git a/app/(tabs)/budget/index.tsx b/app/(tabs)/budget/index.tsx
index b2a2b29..9131dc7 100644
--- a/app/(tabs)/budget/index.tsx
+++ b/app/(tabs)/budget/index.tsx
@@ -38,7 +38,7 @@ export default function Page() {
};
const handleCategoryPress = (item: {[column: string]: any;}) => {
- console.log(item.category_name);
+ router.push({pathname: "/(tabs)/budget/category", params: {category_guid: item.category_guid, category_name: item.category_name}})
}
return (
@@ -46,7 +46,7 @@ export default function Page() {
{
- router.push({pathname: '/(tabs)/budget/addCategory', params: { guid: '123'}}); //This needs to be changed to a regular push, without parameters
+ router.push({pathname: '/(tabs)/budget/addCategory'});
}}/>
{isLoading ? () : (
diff --git a/app/(tabs)/stats/index.tsx b/app/(tabs)/stats/index.tsx
index 9a2033a..b7e477d 100644
--- a/app/(tabs)/stats/index.tsx
+++ b/app/(tabs)/stats/index.tsx
@@ -53,16 +53,10 @@ export default function Page() {
-
+
-
-
-
-
-
-
);
diff --git a/components/stats/BudgetRemaining.tsx b/components/stats/BudgetRemaining.tsx
index 1eb038e..6207ead 100644
--- a/components/stats/BudgetRemaining.tsx
+++ b/components/stats/BudgetRemaining.tsx
@@ -8,7 +8,7 @@ interface BudgetRemainingProps {
}
const BudgetRemaining: React.FC = ({ budget, spent }) => {
- const { colors, theme } = useTheme();
+ const { colors } = useTheme();
const remaining = budget - spent;
diff --git a/components/stats/CategoryProgressBarList.tsx b/components/stats/CategoryProgressBarList.tsx
index 566f352..42cfcf7 100644
--- a/components/stats/CategoryProgressBarList.tsx
+++ b/components/stats/CategoryProgressBarList.tsx
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import { View, Text, Button, StyleSheet, TouchableOpacity } from 'react-native';
import CategoryProgressBar from './CategoryProgressBar';
-import { useTheme } from '../../app/contexts/ThemeContext';
interface CategoryItem {
name: string;
diff --git a/components/stats/Widget.tsx b/components/stats/Widget.tsx
index 153ed65..f4e3e0b 100644
--- a/components/stats/Widget.tsx
+++ b/components/stats/Widget.tsx
@@ -44,7 +44,7 @@ const Widget: React.FC = ({ title, text, children, image }) => { //
},
imageStyle: {
width: '100%',
- height: 200,
+ height: 500,
borderRadius: 5,
marginBottom: 8,
},