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