Browse Source

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

master
analuizaff 2 years ago
parent
commit
526a1d73ec
  1. 2
      src/app/components/MapModal.js
  2. 2
      src/app/navigation/AccountNavigator.js
  3. 2
      src/app/navigation/AuthNavigator.js
  4. 2
      src/app/screens/AccountScreen.js
  5. 9
      src/app/screens/PasswordRecoveryScreen.js
  6. 21
      src/app/screens/RainSharingDataScreen.js
  7. 8
      src/app/screens/RiverFloodSharingDataScreen.js
  8. 10
      src/app/screens/SharingFloodZonesScreen.js
  9. 41432
      src/package-lock.json
  10. 2
      src/package.json

2
src/app/components/MapModal.js

@ -257,8 +257,6 @@ function componentBody(props) {
{iconTextRow({ name: "map-marker", description: address })} {iconTextRow({ name: "map-marker", description: address })}
{!isPluviometer(props.name) && {!isPluviometer(props.name) &&
iconTextRow({ name: "calendar", description: date })} iconTextRow({ name: "calendar", description: date })}
{!isOfficialPluviometer(props.name) &&
iconImageRow({ name: "camera", pic: pictures })}
</View> </View>
</View> </View>
); );

2
src/app/navigation/AccountNavigator.js

@ -82,7 +82,7 @@ const AccountNavigator = () => (
<Stack.Screen <Stack.Screen
name="PasswordRecovery" name="PasswordRecovery"
component={PasswordRecovery} component={PasswordRecovery}
initialParams={{ user : {} }}
initialParams={{ user : {}, title: "Alterar senha" }}
options={{ headerTitle: "" }} options={{ headerTitle: "" }}
/> />

2
src/app/navigation/AuthNavigator.js

@ -30,7 +30,7 @@ const AuthNavigator = () => (
<Stack.Screen <Stack.Screen
name="PasswordRecovery" name="PasswordRecovery"
component={PasswordRecovery} component={PasswordRecovery}
initialParams={{ user : {} }}
initialParams={{ user : {}, title: "Recuperação de senha" }}
options={{ headerTitle: "" }} options={{ headerTitle: "" }}
/> />

2
src/app/screens/AccountScreen.js

@ -130,7 +130,7 @@ function AccountScreen(props) {
const profileItems = [ const profileItems = [
{ {
icon: "lock", icon: "lock",
show: true,
show: isRegistered,
IconProvider: MaterialCommunityIcons, IconProvider: MaterialCommunityIcons,
title: "alterar senha", title: "alterar senha",
onPress: () => { onPress: () => {

9
src/app/screens/PasswordRecoveryScreen.js

@ -68,6 +68,7 @@ const validationSchema = Yup.object().shape({
export default function PasswordRecovery({ navigation, route }) { export default function PasswordRecovery({ navigation, route }) {
const user = route.params.user; const user = route.params.user;
const title = route.params.title;
const [showLoading, setShowLoading] = useState(false); const [showLoading, setShowLoading] = useState(false);
const [confirmatioModalData, setConfirmatioModalData] = useState({ const [confirmatioModalData, setConfirmatioModalData] = useState({
@ -88,7 +89,7 @@ export default function PasswordRecovery({ navigation, route }) {
const userExists = await existUsername(number); const userExists = await existUsername(number);
if (userExists.data == null) { if (userExists.data == null) {
setConfirmatioModalData({ setConfirmatioModalData({
message: "Número de telefone inválido",
message: "Um erro inesperado ocorreu. Tente novamente mais tarde",
show: true, show: true,
}); });
setShowLoading(false); setShowLoading(false);
@ -135,10 +136,6 @@ export default function PasswordRecovery({ navigation, route }) {
<ConfirmationModal <ConfirmationModal
show={confirmatioModalData.show} show={confirmatioModalData.show}
description={confirmatioModalData.message} description={confirmatioModalData.message}
confirmationLabel="OK"
onConfirm={() =>
setConfirmatioModalData({ ...confirmatioModalData, show: false })
}
/> />
<KeyboardAwareScrollView> <KeyboardAwareScrollView>
@ -154,7 +151,7 @@ export default function PasswordRecovery({ navigation, route }) {
}} }}
> >
<View style={{ padding: 16 }}> <View style={{ padding: 16 }}>
<Text style={styles.textHeader}>Recuperação de senha</Text>
<Text style={styles.textHeader}>{title}</Text>
<Text style={styles.textSubtitle}> <Text style={styles.textSubtitle}>
Responda à pergunta de segurança, isso ajuda a mostrar que essa Responda à pergunta de segurança, isso ajuda a mostrar que essa
conta realmente pertence a você conta realmente pertence a você

21
src/app/screens/RainSharingDataScreen.js

@ -4,17 +4,9 @@ import * as Yup from "yup";
import { Form, SubmitButton, FormField } from "../components/forms"; import { Form, SubmitButton, FormField } from "../components/forms";
import Screen from "../components/Screen"; import Screen from "../components/Screen";
import FormImagePicker from "../components/forms/FormImagePicker";
import { Text } from "react-native"; import { Text } from "react-native";
import colors from "../config/colors"; import colors from "../config/colors";
import { TouchableNativeFeedback } from "react-native-gesture-handler";
import { insertRainData } from "../database/databaseLoader";
import { showMessage } from "react-native-flash-message";
import {
scaleDimsFromWidth,
dimensions,
screen_height,
} from "../config/dimensions";
import { scaleDimsFromWidth, dimensions, screen_height } from "../config/dimensions";
import assets from "../config/assets"; import assets from "../config/assets";
import moment from "moment"; import moment from "moment";
import { EventLocationContext } from "../context/EventLocationContext"; import { EventLocationContext } from "../context/EventLocationContext";
@ -39,8 +31,6 @@ function RainSharingDataScreen(props) {
const [rainSituation, setRainSituation] = useState(null); const [rainSituation, setRainSituation] = useState(null);
const [error, setError] = useState(false); const [error, setError] = useState(false);
const dims = scaleDimsFromWidth(85, 85, 27);
const [date, setDate] = useState(moment()); const [date, setDate] = useState(moment());
const [time, setTime] = useState(moment()); const [time, setTime] = useState(moment());
const context = useContext(EventLocationContext); const context = useContext(EventLocationContext);
@ -91,8 +81,10 @@ function RainSharingDataScreen(props) {
}; };
return ( return (
<Screen style={styles.container}>
<OnSubmitAwaitModal show={showAwaitModal} />
<Screen>
<OnSubmitAwaitModal
show={showAwaitModal}
/>
<OnSubmitMessageModal <OnSubmitMessageModal
show={showMessageModal} show={showMessageModal}
setShow={setShowMessageModal} setShow={setShowMessageModal}
@ -220,9 +212,6 @@ function RainSharingDataScreen(props) {
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: {
backgroundColor: colors.white,
},
error_txt: { error_txt: {
paddingHorizontal: 16, paddingHorizontal: 16,
marginTop: 12, marginTop: 12,

8
src/app/screens/RiverFloodSharingDataScreen.js

@ -4,11 +4,8 @@ import * as Yup from "yup";
import { Form, SubmitButton, FormField } from "../components/forms"; import { Form, SubmitButton, FormField } from "../components/forms";
import Screen from "../components/Screen"; import Screen from "../components/Screen";
import FormImagePicker from "../components/forms/FormImagePicker";
import { Text } from "react-native"; import { Text } from "react-native";
import colors from "../config/colors"; import colors from "../config/colors";
import { insertRiverData } from "../database/databaseLoader";
import { showMessage } from "react-native-flash-message";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
import assets from "../config/assets"; import assets from "../config/assets";
import { dimensions } from "../config/dimensions"; import { dimensions } from "../config/dimensions";
@ -84,7 +81,7 @@ function RiverFloodSharingDataScreen(props) {
}; };
return ( return (
<Screen style={styles.container}>
<Screen>
<OnSubmitAwaitModal show={showAwaitModal} /> <OnSubmitAwaitModal show={showAwaitModal} />
<OnSubmitMessageModal <OnSubmitMessageModal
show={showMessageModal} show={showMessageModal}
@ -221,9 +218,6 @@ function RiverFloodSharingDataScreen(props) {
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: {
backgroundColor: colors.white,
},
imgs_row: { imgs_row: {
flexDirection: "row", flexDirection: "row",
justifyContent: "space-between", justifyContent: "space-between",

10
src/app/screens/SharingFloodZonesScreen.js

@ -3,11 +3,8 @@ import { StyleSheet, Text, View } from "react-native";
import * as Yup from "yup"; import * as Yup from "yup";
import { Form, SubmitButton, FormField } from "../components/forms"; import { Form, SubmitButton, FormField } from "../components/forms";
import FormImagePicker from "../components/forms/FormImagePicker";
import colors from "../config/colors"; import colors from "../config/colors";
import { scaleDimsFromWidth, dimensions } from "../config/dimensions";
import { insertFloodZone } from "../database/databaseLoader";
import { showMessage } from "react-native-flash-message";
import { dimensions } from "../config/dimensions";
import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view"; import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
import Screen from "../components/Screen"; import Screen from "../components/Screen";
import assets from "../config/assets"; import assets from "../config/assets";
@ -82,7 +79,7 @@ function SharingFloodZonesScreen(props) {
}; };
return ( return (
<Screen style={styles.container}>
<Screen>
<OnSubmitAwaitModal show={showAwaitModal} /> <OnSubmitAwaitModal show={showAwaitModal} />
<OnSubmitMessageModal <OnSubmitMessageModal
show={showMessageModal} show={showMessageModal}
@ -181,9 +178,6 @@ function SharingFloodZonesScreen(props) {
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: {
backgroundColor: colors.white,
},
imgs_container: { imgs_container: {
paddingTop: 16, paddingTop: 16,
flexDirection: "row", flexDirection: "row",

41432
src/package-lock.json
File diff suppressed because it is too large
View File

2
src/package.json

@ -16,7 +16,7 @@
}, },
"dependencies": { "dependencies": {
"@expo/metro-config": "^0.2.8", "@expo/metro-config": "^0.2.8",
"@react-native-async-storage/async-storagde94d72999594291828f1714c9346e8db5e2ac74e": "^1.17.2",
"@react-native-async-storage/async-storage": "~1.15.0",
"@react-native-community/checkbox": "^0.5.9", "@react-native-community/checkbox": "^0.5.9",
"@react-native-community/datetimepicker": "3.5.2", "@react-native-community/datetimepicker": "3.5.2",
"@react-native-community/masked-view": "^0.1.11", "@react-native-community/masked-view": "^0.1.11",

Loading…
Cancel
Save