last changes

This commit is contained in:
Jakob Stornig 2024-01-25 20:35:09 +01:00
parent 7a5ace403e
commit 899b50ded4
16 changed files with 53 additions and 89 deletions

View file

@ -6,6 +6,7 @@ import useFetch from "../../../hooks/useFetch";
import { deleteCategory, deleteExpense, updateCategory } from "../../../services/database";
import { useTheme } from "../../contexts/ThemeContext";
import { SafeAreaView } from 'react-native-safe-area-context';
import { CategoryType } from "../../../types/dbItems";
const addCategory = () => {
const {colors} = useTheme();
@ -13,7 +14,7 @@ const addCategory = () => {
const [categoryName, setCategoryName] = useState(category_name.toString());
const [categoryColor, setCategoryColor] = useState(category_color.toString());
const [selectedType, setSelectedType] = useState(category_type.toString());
const [selectedType, setSelectedType] = useState<CategoryType>(category_type === "expense" ? CategoryType.EXPENSE : CategoryType.SAVING);
const [amount, setAmount] = useState(Number.parseFloat(category_amount.toString()));
const {data} = useFetch({sql: "SELECT * FROM expense WHERE category_guid = ?", args: [category_guid.toString()]});