From 4884513eedbb419df5a6224d44351b21601efb9c Mon Sep 17 00:00:00 2001 From: analuizaff Date: Wed, 8 Dec 2021 22:53:49 -0300 Subject: [PATCH] standardazing modal messages --- src/app/components/ConfirmationModal.js | 67 ++++++++++++------- src/app/components/LoadingMarkersModal.js | 4 +- src/app/components/SvgLabeledButton.js | 5 +- .../components/forms/OnSubmitAwaitModal.js | 59 ++++++++-------- .../components/forms/OnSubmitMessageModal.js | 6 +- src/app/screens/AccountScreen.js | 2 +- src/app/screens/SharingDataScreen.js | 5 +- 7 files changed, 82 insertions(+), 66 deletions(-) diff --git a/src/app/components/ConfirmationModal.js b/src/app/components/ConfirmationModal.js index de45bdf..44ffaba 100644 --- a/src/app/components/ConfirmationModal.js +++ b/src/app/components/ConfirmationModal.js @@ -2,10 +2,11 @@ import React from "react"; import { Modal, StyleSheet, Text, TouchableOpacity, View } from "react-native"; import colors from "../config/colors"; import { dimensions } from "../config/dimensions"; +import { Ionicons } from "@expo/vector-icons"; function Btn({ label, onPress, bgColor, txtColor }) { return ( - + - {label} + {label} ); @@ -23,11 +24,12 @@ function Btn({ label, onPress, bgColor, txtColor }) { export default function ConfirmationModal({ show, onConfirm, - onDecline, + onDecline, confirmationLabel, declineLabel, - title = "", + title = null, description = "", + icon = null, }) { return ( - - - {title} - + {title && ( + + + {title} + + + )} + + {icon && ( + + + + )} + {description} - {description} - {onConfirm && confirmationLabel && } - {onDecline && declineLabel && } + {onConfirm && confirmationLabel && ( + + )} + {onDecline && declineLabel && ( + + )} @@ -82,7 +97,7 @@ export default function ConfirmationModal({ const styles = StyleSheet.create({ container: { - width: "80%", + width: "85%", justifyContent: "center", alignSelf: "center", backgroundColor: colors.lightestGray, @@ -90,7 +105,7 @@ const styles = StyleSheet.create({ borderWidth: 2, borderRadius: 12, paddingVertical: 16, - paddingHorizontal: 12 + paddingHorizontal: 12, }, text: { fontSize: dimensions.text.default, diff --git a/src/app/components/LoadingMarkersModal.js b/src/app/components/LoadingMarkersModal.js index eff0cb5..d100b20 100644 --- a/src/app/components/LoadingMarkersModal.js +++ b/src/app/components/LoadingMarkersModal.js @@ -40,7 +40,7 @@ export default function LoadingMarkersModal({ show }) { style={{ alignSelf: "center", marginBottom: 12 }} /> - Aguarde um momento enquanto os dados são carregados + Aguarde um momento enquanto os dados são carregados. ); @@ -65,7 +65,7 @@ const styles = StyleSheet.create({ text: { fontSize: dimensions.text.secondary, textAlign: "center", - color: colors.primary, + color: colors.black, fontWeight: "bold", }, }); diff --git a/src/app/components/SvgLabeledButton.js b/src/app/components/SvgLabeledButton.js index 5187de2..6ceb91e 100644 --- a/src/app/components/SvgLabeledButton.js +++ b/src/app/components/SvgLabeledButton.js @@ -23,6 +23,9 @@ export default function SvgLabeledButton({ active = true, inactiveOnPress = () => {}, }) { + if(!active){ + normalBgcolor = colors.grayBG; + } const dims = scaleDimsFromWidth(width, height, 16); return ( - + {label} diff --git a/src/app/components/forms/OnSubmitAwaitModal.js b/src/app/components/forms/OnSubmitAwaitModal.js index 8258aa2..d2e5ca8 100644 --- a/src/app/components/forms/OnSubmitAwaitModal.js +++ b/src/app/components/forms/OnSubmitAwaitModal.js @@ -6,41 +6,38 @@ import { MaterialCommunityIcons } from "@expo/vector-icons"; import { dimensions, screen_height } from "../../config/dimensions"; const OnSubmitAwaitModal = ({ show }) => { - if(show){ - return ( - - - - - Aguarde um momento. Estamos enviando o formulário. - - - - - ); - }else{ - return( - <> - ); - } + if (show) { + return ( + + + + + Aguarde um momento enquanto registramos o dado. + + + + ); + } else { + return <>; + } }; const styles = StyleSheet.create({ container: { position: "absolute", - width: "80%", + width: "85%", height: 170, // justifyContent: "center", alignSelf: "center", @@ -53,7 +50,7 @@ const styles = StyleSheet.create({ text: { fontSize: dimensions.text.secondary, textAlign: "center", - color: colors.primary, + color: colors.black, fontWeight: "bold", }, }); diff --git a/src/app/components/forms/OnSubmitMessageModal.js b/src/app/components/forms/OnSubmitMessageModal.js index 93bfc36..dcecfd4 100644 --- a/src/app/components/forms/OnSubmitMessageModal.js +++ b/src/app/components/forms/OnSubmitMessageModal.js @@ -28,7 +28,7 @@ const onModalClose = () =>{ @@ -41,7 +41,7 @@ const onModalClose = () =>{ @@ -64,7 +64,7 @@ const styles = StyleSheet.create({ container: { flex: 1, position: "absolute", - width: "80%", + width: "85%", height: 170, // justifyContent: "center", alignSelf: "center", diff --git a/src/app/screens/AccountScreen.js b/src/app/screens/AccountScreen.js index 39439e0..04788ba 100644 --- a/src/app/screens/AccountScreen.js +++ b/src/app/screens/AccountScreen.js @@ -198,7 +198,7 @@ function AccountScreen(props) { onConfirmPluv()} //{setShowLogPluv(false), navigation.navigate("Perfil")}} onDecline={() => setShowLogPluv(false)} /> authContext.setUser(false)} onDecline={() => setShowLog(false)}