forked from cemaden-educacao/WPD-MobileApp
GabrielTrettel
3 years ago
9 changed files with 395 additions and 103 deletions
-
3src/app/components/LoadingMarkersModal.js
-
12src/app/components/forms/AssembleIngestionObject.js
-
61src/app/components/forms/OnSubmitAwaitModal.js
-
93src/app/components/forms/OnSubmitMessageModal.js
-
105src/app/screens/PluviometerRegisterScreen.js
-
48src/app/screens/PluviometerSharingDataScreen.js
-
67src/app/screens/RainSharingDataScreen.js
-
52src/app/screens/RiverFloodSharingDataScreen.js
-
53src/app/screens/SharingFloodZonesScreen.js
@ -0,0 +1,61 @@ |
|||||
|
import React, { useState } from "react"; |
||||
|
import { Modal, StyleSheet, Text, TouchableOpacity, View } from "react-native"; |
||||
|
import colors from "../../config/colors"; |
||||
|
|
||||
|
import { MaterialCommunityIcons } from "@expo/vector-icons"; |
||||
|
import { dimensions, screen_height } from "../../config/dimensions"; |
||||
|
|
||||
|
const OnSubmitAwaitModal = ({ show }) => { |
||||
|
if(show){ |
||||
|
return ( |
||||
|
<Modal |
||||
|
transparent={true} |
||||
|
isVisible={show} |
||||
|
style={{ |
||||
|
justifyContent: "flex-start", |
||||
|
alignSelf: "flex-end", |
||||
|
}} |
||||
|
> |
||||
|
<View style={[styles.container, { bottom: (screen_height - 267) / 2 }]}> |
||||
|
<MaterialCommunityIcons |
||||
|
name="sync" |
||||
|
size={48} |
||||
|
color={colors.primary} |
||||
|
style={{ alignSelf: "center", marginBottom: 12 }} |
||||
|
/> |
||||
|
<Text style={styles.text}> |
||||
|
Aguarde um momento. Estamos enviando o formulário. |
||||
|
</Text> |
||||
|
</View> |
||||
|
</Modal> |
||||
|
|
||||
|
); |
||||
|
}else{ |
||||
|
return( |
||||
|
<></> |
||||
|
); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
const styles = StyleSheet.create({ |
||||
|
container: { |
||||
|
position: "absolute", |
||||
|
width: "80%", |
||||
|
height: 170, |
||||
|
// justifyContent: "center",
|
||||
|
alignSelf: "center", |
||||
|
backgroundColor: colors.lightestGray, |
||||
|
borderColor: colors.primary, |
||||
|
borderWidth: 2, |
||||
|
borderRadius: 12, |
||||
|
padding: 12, |
||||
|
}, |
||||
|
text: { |
||||
|
fontSize: dimensions.text.secondary, |
||||
|
textAlign: "center", |
||||
|
color: colors.primary, |
||||
|
fontWeight: "bold", |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
export default OnSubmitAwaitModal; |
@ -0,0 +1,93 @@ |
|||||
|
import React, { useState } from "react"; |
||||
|
import { Modal, StyleSheet, Text, TouchableOpacity, View } from "react-native"; |
||||
|
import colors from "../../config/colors"; |
||||
|
|
||||
|
import { AntDesign } from "@expo/vector-icons"; |
||||
|
import { MaterialCommunityIcons } from "@expo/vector-icons"; |
||||
|
import { dimensions, screen_height } from "../../config/dimensions"; |
||||
|
import ConfirmationModal from "../ConfirmationModal"; |
||||
|
|
||||
|
function OnSubmitMessageModal({ show, setShow, sucess, navigation }){ |
||||
|
const onModalClose = () =>{ |
||||
|
setShow(false); |
||||
|
navigation.navigate("Home"); |
||||
|
} |
||||
|
if (show) { |
||||
|
return ( |
||||
|
<Modal |
||||
|
transparent={true} |
||||
|
isVisible={show} |
||||
|
style={{ |
||||
|
justifyContent: "flex-start", |
||||
|
alignSelf: "flex-end", |
||||
|
}} |
||||
|
> |
||||
|
<View style={[styles.container, { bottom: (screen_height - 267) / 2 }]}> |
||||
|
<View style={{ flex: 0.85 }}> |
||||
|
{!sucess && ( |
||||
|
<View> |
||||
|
<AntDesign |
||||
|
name="warning" |
||||
|
size={48} |
||||
|
color={colors.primary} |
||||
|
style={{ alignSelf: "center", marginBottom: 12 }} |
||||
|
/> |
||||
|
<Text style={styles.text}> |
||||
|
Erro ao enviar informação. Por favor, tente mais tarde! |
||||
|
</Text> |
||||
|
</View> |
||||
|
)} |
||||
|
{sucess && ( |
||||
|
<View> |
||||
|
<MaterialCommunityIcons |
||||
|
name="check-all" |
||||
|
size={48} |
||||
|
color={colors.primary} |
||||
|
style={{ alignSelf: "center", marginBottom: 12 }} |
||||
|
/> |
||||
|
<Text style={styles.text}>Informação enviada com sucesso!</Text> |
||||
|
</View> |
||||
|
)} |
||||
|
</View> |
||||
|
<View style={{ flex: 0.15 }}> |
||||
|
<Text style={styles.btn} onPress={()=> onModalClose()}>OK</Text> |
||||
|
</View> |
||||
|
</View> |
||||
|
</Modal> |
||||
|
); |
||||
|
} else { |
||||
|
return <></>; |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
const styles = StyleSheet.create({ |
||||
|
container: { |
||||
|
flex: 1, |
||||
|
position: "absolute", |
||||
|
width: "80%", |
||||
|
height: 170, |
||||
|
// justifyContent: "center",
|
||||
|
alignSelf: "center", |
||||
|
backgroundColor: colors.lightestGray, |
||||
|
borderColor: colors.primary, |
||||
|
borderWidth: 2, |
||||
|
borderRadius: 12, |
||||
|
padding: 12, |
||||
|
}, |
||||
|
text: { |
||||
|
fontSize: dimensions.text.secondary, |
||||
|
textAlign: "center", |
||||
|
color: colors.black, |
||||
|
fontWeight: "bold", |
||||
|
alignSelf: "center", |
||||
|
}, |
||||
|
btn: { |
||||
|
fontSize: dimensions.text.secondary, |
||||
|
textAlign: "right", |
||||
|
alignContent: "center", |
||||
|
color: colors.primary, |
||||
|
fontWeight: "bold", |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
export default OnSubmitMessageModal; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue