Skip to content

Instantly share code, notes, and snippets.

@sslotsky sslotsky/home.jsx
Created May 22, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.