Browse Source

Changing keyboard type to decimal for IOS compatibility and minor

refactoring.
master
GabrielTrettel 4 years ago
parent
commit
ead3412f65
  1. 1
      src/app/config/colors.js
  2. 31
      src/app/screens/PluviometerSharingDataScreen.js

1
src/app/config/colors.js

@ -8,4 +8,5 @@ export default {
dark: "#0c0c0c",
danger: "#ff5252",
lightGray: "#d3d3d3",
gray: "gray",
};

31
src/app/screens/PluviometerSharingDataScreen.js

@ -1,14 +1,6 @@
import React, { useState } from "react";
import {
StyleSheet,
Text,
View,
Image,
ScrollView,
} from "react-native";
import { StyleSheet, Text, View, Image, ScrollView } from "react-native";
import * as Yup from "yup";
import {
Form,
FormField,
@ -22,6 +14,7 @@ import { insertPluviometerData } from "../database/databaseLoader";
import { showMessage } from "react-native-flash-message";
import { scaleDimsFromWidth } from "../config/dimensions";
import FormDatePicker from "../components/forms/FormDatePicker";
import colors from "../config/colors/";
const dims = scaleDimsFromWidth(85, 85, 25);
@ -35,7 +28,6 @@ const validationSchema = Yup.object().shape({
images: Yup.array(),
});
function PluviometerSharingDataScreen(props) {
const location = useLocation();
@ -48,7 +40,9 @@ function PluviometerSharingDataScreen(props) {
style={styles.image}
source={require("../assets/pluviometro.png")}
/>
<Text style={{ fontSize: 18, fontWeight: "bold", color: "#1976D2" }}>
<Text
style={{ fontSize: 18, fontWeight: "bold", color: colors.primary }}
>
Pluviômetro
</Text>
</View>
@ -56,7 +50,6 @@ function PluviometerSharingDataScreen(props) {
<Form
initialValues={{
pluviometer: "",
//data: "",
images: [],
}}
onSubmit={(values) => {
@ -74,7 +67,7 @@ function PluviometerSharingDataScreen(props) {
<View style={{ marginTop: 30, flex: 1 }}>
<Text style={styles.labelStyle}>Quantidade de chuva:</Text>
<FormField
keyboardType="number-pad"
keyboardType="decimal-pad"
maxLength={200}
name="pluviometer"
placeholder="Digite a quantidade de chuva"
@ -82,20 +75,20 @@ function PluviometerSharingDataScreen(props) {
</View>
<View style={{ marginTop: 10, flex: 1 }}>
<Text style={styles.labelStyle}>Data da coleta:</Text>
<Text style={styles.labelStyle}>Data da coleta:</Text>
<FormDatePicker
textStyle={{
padding: 15,
borderColor: "gray",
borderColor: colors.gray,
borderWidth: 3,
}}
defaultDate={new Date()}
onDateChange={(value) => setDateTime(value)}
/>
</View>
<FormImagePicker
backgroundColor="#1976D2"
backgroundColor={colors.primary}
name="images"
styles={{ width: 50 }}
/>
@ -107,8 +100,6 @@ function PluviometerSharingDataScreen(props) {
);
}
const styles = StyleSheet.create({
container: {
padding: 10,
@ -124,7 +115,7 @@ const styles = StyleSheet.create({
fontSize: 16,
fontWeight: "bold",
textAlign: "left",
color: "#1976D2",
color: colors.primary,
marginBottom: 5,
},
});

Loading…
Cancel
Save