GraphQL API and utilities for the rpdata project
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
736 B

import React, { Component } from "react"
import { Query } from "react-apollo"
import { LoadingScreen } from "../../common/LoadingScreen"
import Main from "../../common/Main"
import storyTagsQuery from "./gql/StoryTags";
export class StoryTags extends Component {
render() {
const { tags } = this.props
return (
<Main className="StoryTags">
{ tags.map(s => <h1>{s.name}</h1>) }
</Main>
)
}
}
export default () => (
<Query query={storyTagsQuery}>
{({ loading, error, data }) => {
if (loading) {
return <LoadingScreen className="theme-story" />
}
if (error) {
return `Error! ${error.message}`
}
return <StoryTags {...data} />
}}
</Query>
)