From c311c538a3442aed8d77449736f28be66feea57c Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Sun, 14 Jun 2020 22:42:52 +0300
Subject: feat: configure navigation

---
 src/pages/AuthPage/SignInForm.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/pages/AuthPage/SignInForm.tsx')

diff --git a/src/pages/AuthPage/SignInForm.tsx b/src/pages/AuthPage/SignInForm.tsx
index 6e27535..b7696e7 100644
--- a/src/pages/AuthPage/SignInForm.tsx
+++ b/src/pages/AuthPage/SignInForm.tsx
@@ -7,6 +7,7 @@ import { get } from '../../requests';
 
 interface PropTypes {
   setUser: (newUser: User) => void;
+  navigate: (prefix: string, id: string) => void;
 }
 
 const useStyles = makeStyles(theme => ({
@@ -22,7 +23,7 @@ const useStyles = makeStyles(theme => ({
   }
 }));
 
-const SignInForm: React.FC<PropTypes> = ({ setUser }) => {
+const SignInForm: React.FC<PropTypes> = ({ setUser, navigate }) => {
   const classes = useStyles();
   const inputRef = useRef<HTMLInputElement>();
 
@@ -33,6 +34,7 @@ const SignInForm: React.FC<PropTypes> = ({ setUser }) => {
         const user = response.data[0];
         setUser(user);
         localStorage.setItem('userId', user._id);
+        navigate('profile', user._id);
       });
     }
   };
-- 
cgit v1.2.3

