Merge branch 'master' into change-websocket-uri

This commit is contained in:
Kim Gardner
2017-09-07 16:54:59 +01:00
committed by GitHub
3 changed files with 85 additions and 97 deletions
@@ -8,7 +8,7 @@ const StorySearch = (props) => {
const {
root: {
assets = []
assets,
},
data: {loading}
} = props;
@@ -62,7 +62,7 @@ const StorySearch = (props) => {
{
loading
? <Spinner />
: assets.map((story, i) => {
: assets.nodes.map((story, i) => {
const storyOpen = story.closedAt === null || new Date(story.closedAt) > new Date();
return <Story
@@ -77,7 +77,7 @@ const StorySearch = (props) => {
})
}
{assets.length === 0 && <div className={styles.noResults}>No results</div>}
{assets.nodes.length === 0 && <div className={styles.noResults}>No results</div>}
</div>
</div>
</div>
@@ -89,12 +89,14 @@ class StorySearchContainer extends React.Component {
export const withAssetSearchQuery = withQuery(gql`
query SearchStories($value: String = "") {
assets(query: {value: $value, limit: 10}) {
id
title
url
created_at
closedAt
author
nodes {
id
title
url
created_at
closedAt
author
}
}
}
`, {