123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import React from 'react';
- import { StyleSheet, Text, View, TextInput, Button, Pressable } from 'react-native';
- import DepenseForm from './depense_edit/depense_form';
-
-
- export default function AddDepense(props){
- const [addingDepense, onAddDepense] = React.useState(false);
-
- return (<View style={ add_depenses_styles.overlay }>
- <View >
- {addingDepense ?
- <DepenseForm fetchDepenses={props.fetchDepenses} onAddDepense={onAddDepense}/>
- : <View/>}
- </View>
- <View style={ add_depenses_styles.button_add_parent }>
- <Pressable
- style={add_depenses_styles.button_add}
- onPress={() => onAddDepense(!addingDepense)}>
-
- <Text>{!addingDepense ? "+" : "-"}</Text>
-
- </Pressable>
- </View>
- </View>
- );
- }
-
-
- const add_depenses_styles = StyleSheet.create({
- overlay: {
- height: "100%",
- width: "100%",
- position: 'absolute',
- },
-
- button_add: {
- borderWidth: 1,
- padding: 10,
- },
- button_add_parent: {
- position: 'absolute',
- bottom: 10,
- right: 10,
- }
- });
|