last changes
This commit is contained in:
parent
7a5ace403e
commit
899b50ded4
16 changed files with 53 additions and 89 deletions
|
|
@ -5,7 +5,7 @@ import { SafeAreaView } from 'react-native-safe-area-context';
|
|||
import { AutoDecimalInput, CustomColorPicker, NavigationButton, TypeSelectorSwitch } from "../../../components";
|
||||
import { addCategory } from "../../../services/database";
|
||||
import { useTheme } from "../../contexts/ThemeContext";
|
||||
import { CategoryType } from "../../../services/database";
|
||||
import { CategoryType } from "../../../types/dbItems";
|
||||
|
||||
export default function Page() {
|
||||
const {colors} = useTheme();
|
||||
|
|
|
|||
|
|
@ -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()]});
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ export default function Page() {
|
|||
})
|
||||
}, [data, searchString, selectedPage]);
|
||||
|
||||
console.log(selectedPage)
|
||||
return (
|
||||
<SafeAreaView style={[styles.safeAreaViewStyle, {backgroundColor: containerColor}]}>
|
||||
<View style={{flex: 1, marginHorizontal: 10}}>
|
||||
|
|
|
|||
Reference in a new issue