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.

add_depense.js 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. // display:"flex",
  28. // justifyContent: "center",
  29. // elevation:10,
  30. },
  31. button_add: {
  32. borderWidth: 1,
  33. borderRadius: 25,
  34. padding: 10,
  35. backgroundColor: "#FFFFFF",
  36. elevation:5,
  37. width: "100%",
  38. height: "100%",
  39. justifyContent: 'center',
  40. alignItems: 'center',
  41. },
  42. button_add_parent: {
  43. position: 'absolute',
  44. bottom: 10,
  45. right: 10,
  46. width:50,
  47. height:50,
  48. }
  49. });