Update list, search and index to show demos and browser support
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user