Resolve "addButton (for demo)"
This commit is contained in:
parent
54b2b41ed2
commit
60712e8397
7 changed files with 210 additions and 25 deletions
|
|
@ -1,21 +1,27 @@
|
|||
import { useEffect } from 'react';
|
||||
import { Text } from 'react-native';
|
||||
import { executeQuery, initDatabase, addCategory } from '../../../services/database';
|
||||
import { StyleSheet, Text, View } from 'react-native';
|
||||
import { deleteExpenses } from '../../../services/database';
|
||||
|
||||
export default function Page() {
|
||||
|
||||
useEffect(() => {
|
||||
initDatabase().then();
|
||||
addCategory("Test Category 2", "FFFFFF", "budget").then();
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.text} onPress={() => {
|
||||
deleteExpenses().then(() => {
|
||||
console.log("Expenses Deleted!");
|
||||
})
|
||||
}}>Reset Expenses</Text>
|
||||
</View>);
|
||||
}
|
||||
|
||||
executeQuery("SELECT * FROM category").then((res) => {
|
||||
console.log(res);
|
||||
});;
|
||||
|
||||
//deleteDatabase();
|
||||
});
|
||||
|
||||
|
||||
|
||||
return <Text>Budget Page</Text>;
|
||||
}
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
},
|
||||
text: {
|
||||
textAlign: 'center',
|
||||
fontSize: 40,
|
||||
color: "red",
|
||||
}
|
||||
});
|
||||
Reference in a new issue