Browse Source

Merge branch 'main' of github.com:IGSD-UoW/WPD-MobileApp into main

master
GabrielTrettel 4 years ago
parent
commit
84a6309412
  1. BIN
      src/app/assets/diario_pluviometrico.png
  2. BIN
      src/app/assets/nivel_rio.png
  3. 139
      src/app/screens/SharingDataScreen.js

BIN
src/app/assets/diario_pluviometrico.png

After

Width: 650  |  Height: 601  |  Size: 153 KiB

BIN
src/app/assets/nivel_rio.png

After

Width: 433  |  Height: 437  |  Size: 137 KiB

139
src/app/screens/SharingDataScreen.js

@ -1,5 +1,5 @@
import React from "react"; import React from "react";
import { StyleSheet } from "react-native"; import { StyleSheet, View } from "react-native";
import * as Yup from "yup"; import * as Yup from "yup";
import { import {
@ -12,98 +12,65 @@ import CategoryPickerItem from "../components/CategoryPickerItem";
import Screen from "../components/Screen"; import Screen from "../components/Screen";
import FormImagePicker from "../components/forms/FormImagePicker"; import FormImagePicker from "../components/forms/FormImagePicker";
import useLocation from "../hooks/useLocation"; import useLocation from "../hooks/useLocation";
import { Image, Text } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
//1/3
const styles = StyleSheet.create({
container:{
paddingTop:50,
},
rainLogo: {
width: 110,
height:100,
margin:30,
},
floodingLogo: {
width: 85,
height:85,
marginTop: 70,
const validationSchema = Yup.object().shape({ },
title: Yup.string().required().min(1).label("Title"), })
price: Yup.number().required().min(1).max(10000).label("Price"),
description: Yup.string().label("Description"),
category: Yup.object().required().nullable().label("Category"),
images: Yup.array().min(1, "Please select at least one image."),
});
const categories = [
{
backgroundColor: "#2e53ff",
icon: "wave",
label: "Pontos de alagamento",
value: 1,
},
{
backgroundColor: "#2e53ff",
icon: "weather-pouring",
label: "Chuva",
value: 2,
},
{
backgroundColor: "#2e53ff",
icon: "waves",
label: "Diário do pluviômetro",
value: 3,
},
{
backgroundColor: "#2e53ff",
icon: "waves",
label: "Diário do pluviômetro",
value: 3,
},
{
backgroundColor: "#2e53ff",
icon: "water-percent",
label: "Nível do rio",
value: 4,
},
];
function SharingDataScreen() {
const location = useLocation();
return ( const SharingDataScreen = () => {
<Screen style={styles.container}> return(
<Form <View style={styles.container}>
initialValues={{ <Text style={{ fontSize: 25, textAlign: 'center', backgroundColor: 'lightgray'}}>
title: "", Enviar uma informação
price: "", </Text>
description: "", <View style={{flexDirection:'row', justifyContent: 'space-around'}}>
category: null, <Image
images: [], style = {styles.floodingLogo}
}} source={require("../assets/pontos_alagamento_peq.png")}
onSubmit={(values) => console.log(location)} />
validationSchema={validationSchema} <Image
> style = {styles.floodingLogo}
<FormImagePicker name="images" /> source={require("../assets/chuva_peq.png")}
<FormField maxLength={255} name="title" placeholder="Título" />
<FormField
keyboardType="numeric"
maxLength={8}
name="price"
placeholder="Valor"
width={120}
/> />
<Picker </View>
items={categories} <View style={{flexDirection:'row'}}>
name="category" <Text style={{ fontSize: 20, textAlign: 'center', marginTop: 10, marginLeft: 50}}>Pontos de {"\n"}alagamento</Text>
numberOfColumns={3} <Text style={{ fontSize: 20, textAlign: 'center', marginTop: 10, marginLeft: 130}}>Chuva</Text>
PickerItemComponent={CategoryPickerItem} </View>
placeholder="Categoria" <View style={{flexDirection:'row', justifyContent: 'space-around'}}>
width="50%" <Image
style = {styles.floodingLogo}
source={require("../assets/diario_pluviometrico.png")}
/> />
<FormField <Image
maxLength={255} style = {styles.floodingLogo}
multiline source={require("../assets/nivel_rio.png")}
name="description"
numberOfLines={3}
placeholder="Descrição"
/> />
<SubmitButton title="Post" /> </View>
</Form> <View style={{flexDirection:'row', justifyContent: 'space-around'}}>
</Screen> <Text style={{ fontSize: 20, textAlign: 'center', marginTop: 10}}>Diário do{"\n"}pluviômetro</Text>
<Text style={{ fontSize: 20, textAlign: 'center', marginTop: 10}}>Nível de água {"\n"}no rio</Text>
</View>
</View>
); );
} }
const styles = StyleSheet.create({
container: {
padding: 10,
},
});
export default SharingDataScreen; export default SharingDataScreen;
|||||||
100:0
Loading…
Cancel
Save