Browse Source

fixing datepicker erro - ios

master
analuizaff 4 years ago
parent
commit
6ce0d040f8
  1. 18
      src/app/screens/PluviometerSharingDataScreen.js

18
src/app/screens/PluviometerSharingDataScreen.js

@ -18,6 +18,7 @@ import DateTimePicker from '@react-native-community/datetimepicker';
import { FontAwesome5 } from '@expo/vector-icons'; import { FontAwesome5 } from '@expo/vector-icons';
import { showMessage } from "react-native-flash-message"; import { showMessage } from "react-native-flash-message";
import moment from 'moment'; import moment from 'moment';
import colors from "../config/colors";
const validationSchema = Yup.object().shape({ const validationSchema = Yup.object().shape({
pluviometer: Yup.number().required().min(1).max(10000).label("pluviometer"), pluviometer: Yup.number().required().min(1).max(10000).label("pluviometer"),
@ -141,10 +142,10 @@ function PluviometerSharingDataScreen(props) {
flexDirection: 'row', flexDirection: 'row',
}} }}
activeOpacity={1} activeOpacity={1}
visible={show}>
onPress={() => setShow(false)}
visible={show}
onPress={() => setShow(false)}>
<TouchableHighlight <TouchableHighlight
underlayColor={''}
underlayColor={'#f8f4f4'}
style={{ style={{
flex: 1, flex: 1,
borderTopColor: 'primary', borderTopColor: 'primary',
@ -158,20 +159,20 @@ function PluviometerSharingDataScreen(props) {
overflow: 'hidden', overflow: 'hidden',
}}> }}>
<View style={{ marginTop: 20 }}> <View style={{ marginTop: 20 }}>
{ renderDatePicker }
{renderDatePicker()}
</View> </View>
<TouchableHighlight <TouchableHighlight
underlayColor={'transparent'} underlayColor={'transparent'}
onPress={() => onCancelPress()}
onPress={() => console.log('Datepicker press')}
style={(styles.btnText, styles.btnCancel)}> style={(styles.btnText, styles.btnCancel)}>
<Text>Cancelar</Text> <Text>Cancelar</Text>
</TouchableHighlight> </TouchableHighlight>
<TouchableHighlight <TouchableHighlight
underlayColor={'transparent'} underlayColor={'transparent'}
onPress={() => onDonePress()}
onPress={() => console.log('Datepicker press')}
style={(styles.btnText, styles.btnDone)}> style={(styles.btnText, styles.btnDone)}>
<Text>OK</Text>
<Text>Ok</Text>
</TouchableHighlight> </TouchableHighlight>
</View> </View>
</TouchableHighlight> </TouchableHighlight>
@ -234,7 +235,8 @@ const styles = StyleSheet.create({
paddingHorizontal: 20, paddingHorizontal: 20,
flexDirection: "row", flexDirection: "row",
alignItems: "center", alignItems: "center",
justifyContent: "center"
justifyContent: "center",
color: colors.primary,
}, },
btnCancel: { btnCancel: {
left: 0, left: 0,

Loading…
Cancel
Save