1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

Improvement: Fix lint issues

This commit is contained in:
Akshay 2021-06-21 23:50:37 +02:00
parent 88adc95232
commit d0b167f24d
3 changed files with 21 additions and 20 deletions

View File

@ -132,12 +132,13 @@ exports.createPages = ({ graphql, actions }) => {
await createSwaggerPages(createPage) await createSwaggerPages(createPage)
// API: ocean.js // API: ocean.js
const lastRelease = result.data.oceanJs.repository.releases.edges.filter( const lastRelease =
({ node }) => result.data.oceanJs.repository.releases.edges.filter(
!node.isPrerelease && ({ node }) =>
!node.isDraft && !node.isPrerelease &&
node.releaseAssets.edges.length > 0 !node.isDraft &&
)[0].node.releaseAssets.edges[0].node node.releaseAssets.edges.length > 0
)[0].node.releaseAssets.edges[0].node
await createTypeDocPage( await createTypeDocPage(
createPage, createPage,

View File

@ -122,7 +122,10 @@ export default class Sidebar extends Component {
{sidebarfile.map((group, i) => ( {sidebarfile.map((group, i) => (
<div key={i}> <div key={i}>
{collapsed ? ( {collapsed ? (
group.items.some((item) => location.pathname.startsWith(item.link)) ? ( group.items.some(
(item) =>
location.pathname.substring(0, item.link.length) === item.link
) ? (
<SidebarGroup <SidebarGroup
i={i} i={i}
group={group} group={group}

View File

@ -2,9 +2,8 @@ import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import MarkdownTemplate from '../MarkdownTemplate' import MarkdownTemplate from '../MarkdownTemplate'
import sidebarStyles from '../../components/Sidebar.module.scss' import sidebarStyles from '../../components/Sidebar.module.scss'
import moduleStyles from '../../components/Sidebar.module.scss'
import { generatedNestedObject } from './utils' import { generatedNestedObject } from './utils'
import { navigate } from 'gatsby' import { navigate, graphql } from 'gatsby'
import ContentWrapperTemplate from '../ContentWrapperTemplate' import ContentWrapperTemplate from '../ContentWrapperTemplate'
export default function MarkdownList({ data, location, pageContext }) { export default function MarkdownList({ data, location, pageContext }) {
@ -41,7 +40,7 @@ export default function MarkdownList({ data, location, pageContext }) {
const generateModuleListElement = (id, label) => { const generateModuleListElement = (id, label) => {
const className = const className =
selectedModule.id === id ? moduleStyles.active : moduleStyles.link selectedModule.id === id ? sidebarStyles.active : sidebarStyles.link
return ( return (
<li key={id} id={id} style={{ cursor: 'pointer' }}> <li key={id} id={id} style={{ cursor: 'pointer' }}>
@ -94,7 +93,6 @@ export default function MarkdownList({ data, location, pageContext }) {
toc={nestedSidebarList} toc={nestedSidebarList}
> >
<MarkdownTemplate data={selectedModule} /> <MarkdownTemplate data={selectedModule} />
</ContentWrapperTemplate> </ContentWrapperTemplate>
</> </>
) )
@ -102,21 +100,20 @@ export default function MarkdownList({ data, location, pageContext }) {
MarkdownList.propTypes = { MarkdownList.propTypes = {
pageContext: PropTypes.object.isRequired, pageContext: PropTypes.object.isRequired,
location: PropTypes.object.isRequired location: PropTypes.object.isRequired,
data: PropTypes.object
} }
export const MarkdownListQuery = graphql` export const MarkdownListQuery = graphql`
query { query {
allSectionsYaml { allSectionsYaml {
edges { edges {
node { node {
title title
description description
link link
} }
} }
} }
} }
` `