analuizaff
4 years ago
9 changed files with 164 additions and 8 deletions
-
4src/App.js
-
BINsrc/app/assets/chuva_forte.png
-
BINsrc/app/assets/chuva_fraca.png
-
BINsrc/app/assets/chuva_muito_forte.png
-
BINsrc/app/assets/chuva_pancadas.png
-
BINsrc/app/assets/sem_chuva.png
-
20src/app/navigation/RainSharingDataNavigator.js
-
125src/app/screens/RainSharingDataScreen.js
-
23src/app/screens/SharingDataScreen.js
After Width: 438 | Height: 444 | Size: 99 KiB |
After Width: 314 | Height: 314 | Size: 49 KiB |
After Width: 554 | Height: 548 | Size: 130 KiB |
After Width: 547 | Height: 566 | Size: 134 KiB |
After Width: 242 | Height: 242 | Size: 35 KiB |
@ -0,0 +1,20 @@ |
|||
import React, { Component } from 'react'; |
|||
import { Platform, StyleSheet, Text, View, YellowBox } from 'react-native'; |
|||
import { createStackNavigator } from 'react-navigation'; |
|||
import RainSharingDataScreen from '../screens/RainSharingDataScreen'; |
|||
import SharingDataScreen from '../screens/SharingDataScreen'; |
|||
|
|||
const RootStack = createStackNavigator( |
|||
{ |
|||
Home: { screen: SharingDataScreen }, |
|||
Profile: { screen: RainSharingDataScreen }, |
|||
}, |
|||
{ |
|||
initialRouteName: 'SharingData', |
|||
} |
|||
); |
|||
export default class App extends Component { |
|||
render() { |
|||
return <RootStack />; |
|||
} |
|||
} |
@ -0,0 +1,125 @@ |
|||
import React from "react"; |
|||
import { StyleSheet, View } from "react-native"; |
|||
import * as Yup from "yup"; |
|||
|
|||
import { |
|||
Form, |
|||
FormField, |
|||
FormPicker as Picker, |
|||
SubmitButton, |
|||
} from "../components/forms"; |
|||
import CategoryPickerItem from "../components/CategoryPickerItem"; |
|||
import Screen from "../components/Screen"; |
|||
import FormImagePicker from "../components/forms/FormImagePicker"; |
|||
import useLocation from "../hooks/useLocation"; |
|||
import { Image, Text, TouchableOpacity } from 'react-native'; |
|||
//1/3
|
|||
const styles = StyleSheet.create({ |
|||
container: { |
|||
paddingTop: 50, |
|||
}, |
|||
rainLogo: { |
|||
width: 110, |
|||
height: 100, |
|||
margin: 30, |
|||
}, |
|||
floodingLogo: { |
|||
width: 85, |
|||
height: 85, |
|||
marginTop: 30, |
|||
|
|||
}, |
|||
}) |
|||
|
|||
const validationSchema = Yup.object().shape({ |
|||
images: Yup.array().min(1, "Por favor, selecione ao menos uma imagem"), |
|||
description: Yup.string() |
|||
.label("Description") |
|||
.required("Por favor, forneça uma descrição"), |
|||
}); |
|||
|
|||
const RainSharingDataScreen = ({ navigation }) => { |
|||
return ( |
|||
<Screen style={styles.container}> |
|||
<Form |
|||
initialValues={{ |
|||
title: "", |
|||
price: "", |
|||
description: "", |
|||
category: null, |
|||
images: [], |
|||
}} |
|||
onSubmit={(values) => console.log("submissao")} |
|||
validationSchema={validationSchema} |
|||
> |
|||
<View> |
|||
<Text style={{ fontSize: 25, textAlign: 'center', backgroundColor: 'lightgray' }}> |
|||
Enviar uma informação |
|||
</Text> |
|||
<View style={{ flexDirection: 'row', justifyContent: 'space-around' }}> |
|||
|
|||
<View style={{ alignItems: 'center' }}> |
|||
<Image |
|||
style={styles.floodingLogo} |
|||
source={require("../assets/sem_chuva.png")} |
|||
/> |
|||
<Text style={{ fontSize: 20, textAlign: 'center', marginTop: 10 }}>Sem chuva</Text> |
|||
</View> |
|||
|
|||
<View style={{ alignItems: 'center' }}> |
|||
<Image |
|||
style={styles.floodingLogo} |
|||
source={require("../assets/chuva_peq.png")} |
|||
/> |
|||
<Text style={{ fontSize: 20, textAlign: 'center', marginTop: 10 }}>Chuva fraca</Text> |
|||
</View> |
|||
|
|||
<TouchableOpacity style={{ alignItems: 'center' }}> |
|||
<Image |
|||
style={styles.floodingLogo} |
|||
source={require("../assets/chuva_peq.png")} |
|||
/> |
|||
<Text style={{ fontSize: 20, textAlign: 'center', marginTop: 10 }}>Chuva{"\n"}moderada</Text> |
|||
</TouchableOpacity> |
|||
</View> |
|||
<View style={{ flexDirection: 'row' }}> |
|||
|
|||
</View> |
|||
|
|||
<View style={{ flexDirection: 'row', justifyContent: 'space-around' }}> |
|||
<View style={{ alignItems: 'center' }}> |
|||
<Image |
|||
style={styles.floodingLogo} |
|||
source={require("../assets/chuva_forte.png")} |
|||
/> |
|||
<Text style={{ fontSize: 20, textAlign: 'center', marginTop: 10 }}>Chuva forte</Text> |
|||
</View> |
|||
|
|||
<View style={{ alignItems: 'center' }}> |
|||
<Image |
|||
style={styles.floodingLogo} |
|||
source={require("../assets/chuva_muito_forte.png")} |
|||
/> |
|||
<Text style={{ fontSize: 20, textAlign: 'center', marginTop: 10 }}>Chuva muito{"\n"}forte</Text> |
|||
</View> |
|||
|
|||
<View style={{ alignContent: 'center' }}> |
|||
<Image |
|||
style={styles.floodingLogo} |
|||
source={require("../assets/chuva_pancadas.png")} |
|||
/> |
|||
<Text style={{ fontSize: 20, textAlign: 'center', marginTop: 10 }}>Pancada de{"\n"}chuva</Text> |
|||
</View> |
|||
</View> |
|||
<View style={{ flexDirection: 'row', justifyContent: 'space-around' }}> |
|||
|
|||
</View> |
|||
</View> |
|||
|
|||
<FormImagePicker backgroundColor="blue" name="images"/> |
|||
</Form> |
|||
</Screen> |
|||
); |
|||
} |
|||
|
|||
export default RainSharingDataScreen; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue