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.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import React from 'react';
  2. import { StyleSheet, Text, View, TextInput, Button, Pressable } from 'react-native';
  3. import { SafeAreaView } from 'react-native-safe-area-context';
  4. import DepenseForm from './depense_edit/depense_form';
  5. export default function AddDepense(props){
  6. const [addingDepense, onAddDepense] = React.useState(false);
  7. return (<SafeAreaView pointerEvents="box-none" style={ add_depenses_styles.overlay }>
  8. <View >
  9. {addingDepense ?
  10. <DepenseForm fetchDepenses={props.fetchDepenses} onAddDepense={onAddDepense}/>
  11. : <View/>}
  12. </View>
  13. <View style={ add_depenses_styles.button_add_parent }>
  14. <Pressable
  15. style={add_depenses_styles.button_add}
  16. onPress={() => onAddDepense(!addingDepense)}>
  17. <Text>{!addingDepense ? "+" : "-"}</Text>
  18. </Pressable>
  19. </View>
  20. </SafeAreaView>
  21. );
  22. }
  23. const add_depenses_styles = StyleSheet.create({
  24. overlay: {
  25. height: "100%",
  26. width: "100%",
  27. position: 'absolute',
  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. });