From 4a8924b3d214b8f5b78f8e31f2a16a0d2d461b1a Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Sun, 14 Jun 2020 03:05:04 +0300
Subject: feat: do not render feed under login form

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

(limited to 'src/index.tsx')

diff --git a/src/index.tsx b/src/index.tsx
index 98be8a7..1362544 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -43,10 +43,19 @@ const App: React.FC = () => {
       <Header setPage={setPage} />
       <div className={classes.root}>
         {
-          // eslint-disable-next-line
-          page === 'profile' && (!user ? <SignInForm setUser={setUser} /> : <ProfileInfo id={user?._id || ''} setUser={setUser} />)
+          page === 'profile'
+            ? (
+              user
+                ? (
+                  <>
+                    <ProfileInfo id={user?._id || ''} setUser={setUser} />
+                    <Feed page={page} />
+                  </>
+                )
+                : <SignInForm setUser={setUser} />
+            )
+            : <Feed page={page} />
         }
-        <Feed page={page} />
       </div>
     </ThemeProvider>
   );
-- 
cgit v1.2.3

