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

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