From c36c4ef0524400735f4cdb05de5d54f5b7944306 Mon Sep 17 00:00:00 2001 From: Nareshkumar Rao <_accounts@nareshkumarrao.com> Date: Thu, 29 Jul 2021 18:14:04 +0200 Subject: [PATCH] added logout button --- src/screens/HomeScreen.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/screens/HomeScreen.js b/src/screens/HomeScreen.js index cafed57..161f1fa 100644 --- a/src/screens/HomeScreen.js +++ b/src/screens/HomeScreen.js @@ -35,6 +35,12 @@ function QRCode() { function Home() { const history = useHistory(); + const dispatch = useDispatch(); + + const handleLogout = () => { + dispatch(authLogout()); + history.push("/login"); + } const isAuthenticated = useSelector(state => state.auth.isAuthenticated); if (!isAuthenticated) return ; @@ -59,7 +65,9 @@ function Home() { contact, or allow them to create an account! - + + + );