diff options
author | eug-vs <eug-vs@keemail.me> | 2020-06-30 00:08:42 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-06-30 00:08:42 +0300 |
commit | aa63dea15c71ab014b4b57010574c7abf1f9628b (patch) | |
tree | 173a78c17db7b9f5e70713cadce9f03e3f44be20 /src/index.tsx | |
parent | 1f646377c35b65b97d6eeebb1e88f6d8307e1ef0 (diff) | |
download | which-ui-aa63dea15c71ab014b4b57010574c7abf1f9628b.tar.gz |
feat: useAuth in header
Diffstat (limited to 'src/index.tsx')
-rw-r--r-- | src/index.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
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')); |