continue generating flow, add backend connection on main tabs
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { View, Text } from "react-native";
|
||||
import { View } from "react-native";
|
||||
import React from "react";
|
||||
import Page from "../../layouts/Page";
|
||||
import { background } from "../../assets";
|
||||
@@ -9,6 +9,7 @@ import BorderGradientButton from "../../components/BorderGradientButton";
|
||||
import { SheetManager } from "react-native-actions-sheet";
|
||||
import { navigate } from "../../navigation/NavigationService";
|
||||
import { Routes } from "../../navigation";
|
||||
import { useUserData } from "../../providers/UserDataProvider";
|
||||
|
||||
const SETTINGS = [
|
||||
{
|
||||
@@ -42,6 +43,17 @@ const SETTINGS = [
|
||||
];
|
||||
|
||||
const Settings = () => {
|
||||
const { onSignOut } = useUserData();
|
||||
|
||||
const handleSignOut = async () => {
|
||||
try {
|
||||
await onSignOut();
|
||||
} catch (e) {
|
||||
console.log("Sign out error", e?.message);
|
||||
} finally {
|
||||
navigate(Routes.Login);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Page
|
||||
headerType="NAVIGATION"
|
||||
@@ -65,10 +77,7 @@ const Settings = () => {
|
||||
))}
|
||||
</View>
|
||||
<View style={{ width: "80%", gap: 5, alignSelf: "center" }}>
|
||||
<BorderGradientButton
|
||||
title="Déconnexion"
|
||||
onPress={() => navigate(Routes.Login)}
|
||||
/>
|
||||
<BorderGradientButton title="Déconnexion" onPress={handleSignOut} />
|
||||
<BorderGradientButton
|
||||
title="Supprimer mon profil"
|
||||
titleStyle={{
|
||||
|
||||
Reference in New Issue
Block a user