You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import React from 'react';
  2. import { StyleSheet, Text, View, TextInput, Button, Pressable } from 'react-native';
  3. import DepenseForm from './depense_edit/depense_form';
  4. export default function AddDepense(props){
  5. const [addingDepense, onAddDepense] = React.useState(false);
  6. return (<View style={ add_depenses_styles.overlay }>
  7. <View >
  8. {addingDepense ?
  9. <DepenseForm fetchDepenses={props.fetchDepenses} onAddDepense={onAddDepense}/>
  10. : <View/>}
  11. </View>
  12. <View style={ add_depenses_styles.button_add_parent }>
  13. <Pressable
  14. style={add_depenses_styles.button_add}
  15. onPress={() => onAddDepense(!addingDepense)}>
  16. <Text>{!addingDepense ? "+" : "-"}</Text>
  17. </Pressable>
  18. </View>
  19. </View>
  20. );
  21. }
  22. const add_depenses_styles = StyleSheet.create({
  23. overlay: {
  24. height: "100%",
  25. width: "100%",
  26. position: 'absolute',
  27. },
  28. button_add: {
  29. borderWidth: 1,
  30. padding: 10,
  31. },
  32. button_add_parent: {
  33. position: 'absolute',
  34. bottom: 10,
  35. right: 10,
  36. }
  37. });