|
|
@ -6,19 +6,13 @@ import ErrorMessage from "./ErrorMessage"; |
|
|
|
import { View, Text } from "react-native"; |
|
|
|
import { TouchableOpacity } from "react-native-gesture-handler"; |
|
|
|
import colors from "../../config/colors"; |
|
|
|
import { Shadow } from "react-native-shadow-2"; |
|
|
|
import defaultStyles from "../../config/styles"; |
|
|
|
|
|
|
|
function IncreaseDecreaseButtons({ content }) { |
|
|
|
return ( |
|
|
|
<Shadow |
|
|
|
offset={[0, 3]} |
|
|
|
distance={3} |
|
|
|
radius={4} |
|
|
|
startColor="rgba(0, 0, 0, 0.15)" |
|
|
|
paintInside={true} |
|
|
|
> |
|
|
|
<View |
|
|
|
style={{ |
|
|
|
...defaultStyles.shadow, |
|
|
|
backgroundColor: colors.primary, |
|
|
|
width: 35, |
|
|
|
height: 48, |
|
|
@ -29,7 +23,6 @@ function IncreaseDecreaseButtons({ content }) { |
|
|
|
> |
|
|
|
<Text style={{ color: "white", fontSize: 24 }}>{content}</Text> |
|
|
|
</View> |
|
|
|
</Shadow> |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
@ -48,11 +41,12 @@ function RenderPluviometerInput({ |
|
|
|
}, [fieldVal]); |
|
|
|
|
|
|
|
const increase = () => { |
|
|
|
(Number(fieldVal) + 1) <= 999 && setFieldVal((Number(fieldVal) + 1).toString()); |
|
|
|
Number(fieldVal) + 1 <= 999 && |
|
|
|
setFieldVal((Number(fieldVal) + 1).toString()); |
|
|
|
}; |
|
|
|
|
|
|
|
const decrease = () => { |
|
|
|
(Number(fieldVal) - 1) >= 0 && setFieldVal((Number(fieldVal) - 1).toString()); |
|
|
|
Number(fieldVal) - 1 >= 0 && setFieldVal((Number(fieldVal) - 1).toString()); |
|
|
|
}; |
|
|
|
|
|
|
|
return ( |
|
|
@ -63,11 +57,11 @@ function RenderPluviometerInput({ |
|
|
|
> |
|
|
|
<View style={{ flex: 1, alignSelf: "stretch" }}> |
|
|
|
<TextInput |
|
|
|
height={38} |
|
|
|
onBlur={() => setFieldTouched(name)} |
|
|
|
onChangeText={(val) => { |
|
|
|
setFieldVal(val); |
|
|
|
}} |
|
|
|
width={width} |
|
|
|
value={fieldVal.toString()} |
|
|
|
{...otherProps} |
|
|
|
/> |
|
|
@ -79,7 +73,6 @@ function RenderPluviometerInput({ |
|
|
|
}} |
|
|
|
style={{ |
|
|
|
paddingLeft: 4, |
|
|
|
paddingBottom: 8, |
|
|
|
paddingRight: 1.5, |
|
|
|
}} |
|
|
|
> |
|
|
@ -92,7 +85,6 @@ function RenderPluviometerInput({ |
|
|
|
}} |
|
|
|
style={{ |
|
|
|
paddingLeft: 1.5, |
|
|
|
paddingBottom: 8, |
|
|
|
paddingRight: 16, |
|
|
|
}} |
|
|
|
> |
|
|
@ -109,6 +101,7 @@ function AppFormField({ |
|
|
|
flex = 0, |
|
|
|
paddingLeft = 16, |
|
|
|
paddingRight = 16, |
|
|
|
numberOfLines = 1, |
|
|
|
...otherProps |
|
|
|
}) { |
|
|
|
const { |
|
|
@ -130,6 +123,7 @@ function AppFormField({ |
|
|
|
> |
|
|
|
{name != "pluviometer" ? ( |
|
|
|
<TextInput |
|
|
|
height={numberOfLines <= 1 ? 48 : 60} |
|
|
|
onBlur={() => setFieldTouched(name)} |
|
|
|
onChangeText={handleChange(name)} |
|
|
|
width={width} |
|
|
|