From 2502dfedd28aca36065eddb46d5a46a31578a8d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bel=C3=A9n=20Curcio?= Date: Mon, 24 Sep 2018 10:54:45 -0300 Subject: [PATCH] Show profile tab if user is signed in --- src/core/client/stream/components/App.tsx | 3 ++- src/core/client/stream/containers/AppContainer.tsx | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/core/client/stream/components/App.tsx b/src/core/client/stream/components/App.tsx index faaad4fa4..762a11c6c 100644 --- a/src/core/client/stream/components/App.tsx +++ b/src/core/client/stream/components/App.tsx @@ -18,6 +18,7 @@ import * as styles from "./App.css"; export interface AppProps { activeTab: "COMMENTS" | "PROFILE" | "%future added value"; setActiveTab: SetActiveTabMutation; + signedIn: boolean; } const App: StatelessComponent = props => { @@ -28,7 +29,7 @@ const App: StatelessComponent = props => { onTabClick={tab => props.setActiveTab({ tab })} > Comments - My Profile + {props.signedIn && My Profile} diff --git a/src/core/client/stream/containers/AppContainer.tsx b/src/core/client/stream/containers/AppContainer.tsx index f9c7d8e53..c132aa61e 100644 --- a/src/core/client/stream/containers/AppContainer.tsx +++ b/src/core/client/stream/containers/AppContainer.tsx @@ -16,16 +16,23 @@ interface InnerProps { } const AppContainer: StatelessComponent = ({ - local: { activeTab }, + local: { activeTab, authToken }, setActiveTab, }) => { - return ; + return ( + + ); }; const enhanced = withLocalStateContainer( graphql` fragment AppContainerLocal on Local { activeTab + authToken } ` )(withSetActiveTabMutation(AppContainer));