Created
March 26, 2018 12:45
-
-
Save gc-codesnippets/afccd59b864908279a75d4d9214a7f2d 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
export default class DraftsPage extends Component { | |
render() { | |
return ( | |
<Query query={DRAFTS_QUERY}> | |
{({ data }) => { | |
return ( | |
<Fragment> | |
<div className="flex justify-between items-center"> | |
<h1>Drafts</h1> | |
</div> | |
{data.drafts && | |
data.drafts.map(draft => ( | |
<Post | |
key={draft.id} | |
post={draft} | |
refresh={() => console.log(`Refetch`)} | |
isDraft={!draft.isPublished} | |
/> | |
))} | |
{this.props.children} | |
</Fragment> | |
) | |
}} | |
</Query> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment