Update list, search and index to show demos and browser support

This commit is contained in:
Angelos Chalaris
2019-08-24 10:43:07 +03:00
parent 1142849d11
commit 0bb3c03186
5 changed files with 63 additions and 59 deletions

View File

@ -22,11 +22,8 @@ const IndexPage = props => {
tags: snippet.attributes.tags,
text: snippet.attributes.text,
id: snippet.id,
code: getCodeBlocks(
props.data.allMarkdownRemark.edges.find(
v => v.node.frontmatter.title === snippet.title,
).node.rawMarkdownBody,
).code,
code: snippet.attributes.codeBlocks,
supportPercentage: snippet.attributes.browserSupport.supportPercentage,
}));
const [searchQuery, setSearchQuery] = React.useState(props.searchQuery);
@ -125,13 +122,22 @@ export const indexPageQuery = graphql`
}
}
}
snippetDataJson(meta: { type: { eq: "snippetListingArray" } }) {
snippetDataJson(meta: { type: { eq: "snippetArray" } }) {
data {
id
title
attributes {
tags
text
codeBlocks {
html
css
js
scopedCss
}
browserSupport {
supportPercentage
}
}
}
}