From 0d878909fe17311910f2ba13e203bdfa1bc72a1e Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Fri, 12 Jun 2020 19:58:36 +0300
Subject: feat: fetch default user

---
 src/index.tsx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'src/index.tsx')

diff --git a/src/index.tsx b/src/index.tsx
index 9fb34cb..adf44a5 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -13,6 +13,8 @@ import Header from './Header/Header';
 import Feed from './Feed/Feed';
 import ProfileInfo from './ProfileInfo/ProfileInfo';
 
+import { get } from './requests';
+
 const theme = createMuiTheme({
   palette: {
     primary: {
@@ -31,15 +33,20 @@ const useStyles = makeStyles({
 
 const App: React.FC = () => {
   const [page, setPage] = useState('feed');
+  const [id, setId] = useState<string>('');
   const classes = useStyles();
 
+  get('/users').then(response => {
+    setId(response.data[0]._id);
+  });
+
   return (
     <ThemeProvider theme={theme}>
       <CssBaseline />
       <Header setPage={setPage} />
       <div className={classes.root}>
         {
-          page === 'profile' && <ProfileInfo id="5ee39a3b29600306e4e2b0b7" />
+          page === 'profile' && <ProfileInfo id={id} />
         }
         <Feed page={page} />
       </div>
-- 
cgit v1.2.3

