From d0b167f24dd99be145358eb48bc30f822b0629e2 Mon Sep 17 00:00:00 2001 From: Akshay Date: Mon, 21 Jun 2021 23:50:37 +0200 Subject: [PATCH] Improvement: Fix lint issues --- gatsby-node.js | 13 +++++++------ src/components/Sidebar.jsx | 5 ++++- src/templates/Markdown/MarkdownList.jsx | 23 ++++++++++------------- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index 46ae2418..1a765c90 100755 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -132,12 +132,13 @@ exports.createPages = ({ graphql, actions }) => { await createSwaggerPages(createPage) // API: ocean.js - const lastRelease = result.data.oceanJs.repository.releases.edges.filter( - ({ node }) => - !node.isPrerelease && - !node.isDraft && - node.releaseAssets.edges.length > 0 - )[0].node.releaseAssets.edges[0].node + const lastRelease = + result.data.oceanJs.repository.releases.edges.filter( + ({ node }) => + !node.isPrerelease && + !node.isDraft && + node.releaseAssets.edges.length > 0 + )[0].node.releaseAssets.edges[0].node await createTypeDocPage( createPage, diff --git a/src/components/Sidebar.jsx b/src/components/Sidebar.jsx index 7c6cd4a8..62d26cb9 100644 --- a/src/components/Sidebar.jsx +++ b/src/components/Sidebar.jsx @@ -122,7 +122,10 @@ export default class Sidebar extends Component { {sidebarfile.map((group, i) => (
{collapsed ? ( - group.items.some((item) => location.pathname.startsWith(item.link)) ? ( + group.items.some( + (item) => + location.pathname.substring(0, item.link.length) === item.link + ) ? ( { const className = - selectedModule.id === id ? moduleStyles.active : moduleStyles.link + selectedModule.id === id ? sidebarStyles.active : sidebarStyles.link return (
  • @@ -94,7 +93,6 @@ export default function MarkdownList({ data, location, pageContext }) { toc={nestedSidebarList} > - ) @@ -102,21 +100,20 @@ export default function MarkdownList({ data, location, pageContext }) { MarkdownList.propTypes = { pageContext: PropTypes.object.isRequired, - location: PropTypes.object.isRequired + location: PropTypes.object.isRequired, + data: PropTypes.object } - export const MarkdownListQuery = graphql` - query { - allSectionsYaml { - edges { + query { + allSectionsYaml { + edges { node { - title + title description - link + link } } } } - ` - +`