From 63a85bbf3d7478c5be2b6c02eb4446a9cf9a84fb Mon Sep 17 00:00:00 2001 From: Vika-Koval Date: Thu, 6 Jun 2024 16:45:36 +0300 Subject: [PATCH] add button --- src/components/DashboardPage.tsx | 2 +- src/components/EditProfilePage.tsx | 11 ++++++++--- src/components/MatchesPage.tsx | 2 ++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/components/DashboardPage.tsx b/src/components/DashboardPage.tsx index 4dd06df..e130b42 100644 --- a/src/components/DashboardPage.tsx +++ b/src/components/DashboardPage.tsx @@ -160,8 +160,8 @@ function DashboardPage() {
-

+ ); } diff --git a/src/components/EditProfilePage.tsx b/src/components/EditProfilePage.tsx index f3d5b4b..a5f9646 100644 --- a/src/components/EditProfilePage.tsx +++ b/src/components/EditProfilePage.tsx @@ -2,10 +2,10 @@ import { Box, Spinner, Input, Select, Stack, Button, useToast, Text, FormControl import { getAuth } from 'firebase/auth'; import { doc, updateDoc } from 'firebase/firestore'; import { FormEvent, ChangeEvent, useEffect, useState } from 'react'; -import { useAuthState } from 'react-firebase-hooks/auth'; +import { useAuthState, useSignOut } from 'react-firebase-hooks/auth'; import { useDocument } from 'react-firebase-hooks/firestore'; -import { Navigate } from 'react-router-dom'; - +import { Navigate,useNavigate } from 'react-router-dom'; +// import { Navigate, useNavigate } from 'react-router-dom'; import { db } from '../../firebase.config'; import countries from '../components/countries.json'; @@ -14,6 +14,8 @@ const auth = getAuth(); function EditProfilePage() { const [user, userLoading] = useAuthState(auth); const toast = useToast(); + const [signOut] = useSignOut(auth); + const navigate = useNavigate(); // Get the current user from Firebase const [currentUser, currentUserLoading] = useDocument(doc(db, 'users', user?.uid || 'asd')); @@ -185,6 +187,9 @@ function EditProfilePage() { + + + ); } diff --git a/src/components/MatchesPage.tsx b/src/components/MatchesPage.tsx index 84bec13..0e7bba7 100644 --- a/src/components/MatchesPage.tsx +++ b/src/components/MatchesPage.tsx @@ -4,6 +4,7 @@ import { collection, doc, query, where, documentId } from 'firebase/firestore'; import { useAuthState, useSignOut } from 'react-firebase-hooks/auth'; import { useCollection, useDocument } from 'react-firebase-hooks/firestore'; import { Navigate, useNavigate } from 'react-router-dom'; +// import { useAuthState, useSignOut } from 'react-firebase-hooks/auth'; import { db } from '../../firebase.config'; import logo from '../logo.png'; @@ -67,6 +68,7 @@ function MatchesPage() {
+ ); }