Last active
January 11, 2017 10:13
-
-
Save mattecapu/4fc26bc347534d3c3697899a23e8e87c 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 Library from '../components/library'; | |
export default class App extends React.Component { | |
static async getInitialProps() { | |
return await Lokka.query(`{ | |
libraries { | |
id, | |
...${Library.getFragment()} | |
} | |
}`); | |
} | |
render() { | |
const libraries = | |
this.props.libraries.map(({ id, ...library }) => | |
<Library library={library} key={id} /> | |
); | |
return ( | |
<main> | |
<h1>{`libradar`}</h1> | |
<section> | |
<ul className="libraries-list"> | |
{libraries} | |
</ul> | |
</section> | |
</main> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment