Created
December 2, 2016 22:51
-
-
Save bitttttten/bcee0723c58a5d8984bf6b55502f521a to your computer and use it in GitHub Desktop.
mobx app observer with authentication
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const App = observer(({ store }) => { | |
const { authenticated } = store | |
if (!authenticated ) { | |
return <Login | |
doLogin={store.login} | |
postLogin={store.showHomepage} | |
/> | |
} | |
return <div className="app"> | |
<div className="left"> | |
<h2>{`hello ${store.currentUser}`}</h2> | |
<ContactList contacts={store.contacts} /> | |
</div> | |
<div className="right"> | |
{ renderCurrentView({ store }) } | |
</div> | |
</div> | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment