diff --git a/src/app/components/ConfirmationModal.js b/src/app/components/ConfirmationModal.js
new file mode 100644
index 0000000..c8cfd66
--- /dev/null
+++ b/src/app/components/ConfirmationModal.js
@@ -0,0 +1,96 @@
+import React from "react";
+import {
+ Modal,
+ StyleSheet,
+ Text,
+ TouchableHighlight,
+ View,
+} from "react-native";
+
+import { MaterialCommunityIcons } from "@expo/vector-icons";
+import colors from "../config/colors";
+import { dimensions } from "../config/dimensions";
+import { TouchableOpacity } from "react-native-gesture-handler";
+
+function Btn({ label, onPress, bgColor, txtColor }) {
+ return (
+ onPress()}>
+
+ {label}
+
+
+ );
+}
+
+export default function ConfirmationModal({
+ show,
+ title = "",
+ description = "",
+ confirmationLabel = "",
+ declineLabel = "",
+ onConfirm = () => {},
+ onDecline = () => {},
+}) {
+ console.log("show: " + show);
+ return (
+
+
+
+
+ {title}
+
+
+ {description}
+
+
+
+
+
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ width: "80%",
+ height: 150,
+ justifyContent: "center",
+ alignSelf: "center",
+ backgroundColor: colors.lightestGray,
+ borderColor: colors.primary,
+ borderWidth: 2,
+ borderRadius: 12,
+ padding: 12,
+ },
+ text: {
+ fontSize: dimensions.text.default,
+ textAlign: "left",
+ fontWeight: "bold",
+ },
+});
diff --git a/src/app/screens/AccountScreen.js b/src/app/screens/AccountScreen.js
index aa2ab7f..83f1fd9 100644
--- a/src/app/screens/AccountScreen.js
+++ b/src/app/screens/AccountScreen.js
@@ -1,4 +1,4 @@
-import React, { useContext } from "react";
+import React, { useContext, useState } from "react";
import { Text, Image, View, StyleSheet, ScrollView } from "react-native";
import Screen from "../components/Screen";
import { AuthContext } from "../auth/context";
@@ -7,11 +7,8 @@ import { TouchableOpacity } from "react-native-gesture-handler";
import assets from "../config/assets";
import { MaterialCommunityIcons, FontAwesome } from "@expo/vector-icons";
import colors from "../config/colors";
+import ConfirmationModal from "../components/ConfirmationModal";
-function handleLogOut(setUser) {
- setUser(null);
- authStorage.removeToken();
-}
function UserHeader({ name, fone }) {
return (
@@ -77,6 +74,13 @@ function ProfileItensList({ icon, IconProvider, title, onPress }) {
function AccountScreen(props) {
const { user, setUser } = useContext(AuthContext);
+ const [ showLog, setShowLog ] = useState(false);
+
+ const logout = () => {
+ setUser(null);
+ authStorage.removeToken();
+ };
+
const profileItems = [
{
icon: "account",
@@ -123,17 +127,17 @@ function AccountScreen(props) {
IconProvider: MaterialCommunityIcons,
title: "sair",
onPress: () => {
- handleLogOut(setUser);
- },
- },
- {
- icon: "trash-can",
- IconProvider: MaterialCommunityIcons,
- title: "DESATIVAR CONTA",
- onPress: () => {
- console.log("7");
+ setShowLog(true)
},
},
+ // {
+ // icon: "trash-can",
+ // IconProvider: MaterialCommunityIcons,
+ // title: "DESATIVAR CONTA",
+ // onPress: () => {
+ // console.log("7");
+ // },
+ // },
];
return (
@@ -158,6 +162,15 @@ function AccountScreen(props) {
))}
+ setShowLog(false)}
+ />