You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
771 B
34 lines
771 B
import React, { Component } from "react"
|
|
import { Query } from "react-apollo"
|
|
|
|
import { LoadingScreen } from "../../common/LoadingScreen"
|
|
import Main from "../../common/Main"
|
|
|
|
import storyListQuery from "./gql/StoryList";
|
|
|
|
export class StoryList extends Component {
|
|
render() {
|
|
const { stories } = this.props
|
|
|
|
return (
|
|
<Main className="StoryList">
|
|
{ stories.map(s => <h1>{s.name}</h1>) }
|
|
</Main>
|
|
)
|
|
}
|
|
}
|
|
|
|
export default ({filter}) => (
|
|
<Query query={storyListQuery} variables={{filter}}>
|
|
{({ loading, error, data }) => {
|
|
if (loading) {
|
|
return <LoadingScreen className="theme-story" />
|
|
}
|
|
if (error) {
|
|
return `Error! ${error.message}`
|
|
}
|
|
|
|
return <StoryList {...data} />
|
|
}}
|
|
</Query>
|
|
)
|