From aa63dea15c71ab014b4b57010574c7abf1f9628b Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Tue, 30 Jun 2020 00:08:42 +0300
Subject: feat: useAuth in header

---
 src/index.tsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/index.tsx')

diff --git a/src/index.tsx b/src/index.tsx
index f9114c3..a82a28b 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -40,7 +40,7 @@ const useStyles = makeStyles({
 const App: React.FC = () => {
   const [page, setPage] = useState<Page>({ prefix: 'feed', id: '' });
   const classes = useStyles();
-  const user = { _id: '', avatarUrl: '' };
+  const { user } = useAuth();
 
   const navigate = (prefix: string, id?: string): void => {
     if (prefix === 'profile' && !id && !user) {
@@ -59,7 +59,7 @@ const App: React.FC = () => {
   return (
     <ThemeProvider theme={theme}>
       <CssBaseline />
-      <Header navigate={navigate} userImage={user?.avatarUrl} />
+      <Header navigate={navigate} />
       <div className={classes.root}>
         { page.prefix === 'profile' && (
           <ProfilePage
@@ -76,5 +76,5 @@ const App: React.FC = () => {
   );
 };
 
-ReactDOM.render(<App />, document.getElementById('root'));
+ReactDOM.render(<AuthProvider> <App /> </AuthProvider>, document.getElementById('root'));
 
-- 
cgit v1.2.3

