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.
 
 

31 lines
751 B

import React, { Component } from 'react';
import { Query } from 'react-apollo';
import Background from '../../common/Background';
import StoryMenu from './StoryMenu';
import INDEX_QUERY from "./gql/StoryIndex";
export class StoryIndex extends Component {
render() {
const categories = this.props.categoryType.enumValues.map(ev => ev.name).sort()
return (
<div className="StoryIndex theme-story">
<Background />
<StoryMenu categories={categories} />
</div>
)
}
}
export default () => (
<Query query={INDEX_QUERY}>
{({ loading, error, data }) => {
if (loading) return 'Loading...';
if (error) return `Error! ${error.message}`;
return <StoryIndex {...data} />
}}
</Query>
);