Last active
June 11, 2019 14:27
-
-
Save hitchcockwill/781f350baade0692b6d9d51a472d23bb to your computer and use it in GitHub Desktop.
Component Dashboard
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
import React from 'react'; | |
import { Query, QueryResult } from 'react-apollo'; | |
import styles from './dashboard-scene.module.scss'; | |
import { ME_QUERY } from 'app/models/me/me-schema'; | |
import { Me } from 'app/models/me/me-types'; | |
interface Props { | |
data: { | |
me: Me; | |
}; | |
error: any; | |
loading: boolean; | |
} | |
export const DashboardScene = () => { | |
return ( | |
<div className={styles.dashboardLayout}> | |
<Query query={ME_QUERY}> | |
{({ loading, error, data }: QueryResult<Props>) => { | |
if (loading) { | |
return <p>Loading...</p>; | |
} | |
if (error) { | |
return <p>Error: {JSON.stringify(error)}</p>; | |
} | |
return <p>{JSON.stringify(data)}</p>; | |
}} | |
</Query> | |
</div> | |
); | |
}; | |
export default DashboardScene; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment