Created
May 22, 2018 23:43
-
-
Save sslotsky/eae524e8ab6e0fb044e5330212a874d6 to your computer and use it in GitHub Desktop.
This file contains 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
import React from "react"; | |
import { IdentityConsumer } from "./identity"; | |
import Login from "./login"; | |
export default function Home() { | |
return ( | |
<IdentityConsumer> | |
{ctx => { | |
if (ctx.user) { | |
return <h1 data-cy="user">Hello {ctx.user.email}</h1>; | |
} | |
return !ctx.authenticated && <Login login={ctx.login} />; | |
}} | |
</IdentityConsumer> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment