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

scrollspy for sub items only

This commit is contained in:
Matthias Kretschmann 2019-01-28 12:40:12 +01:00
parent 2659213616
commit 16b0a2270f
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 8 additions and 15 deletions

View File

@ -142,12 +142,16 @@ const PropertyWrapper = ({ property, sourceUrl, parentAnchor }) => {
return ( return (
<div <div
id={`${parentAnchor}-${slugify(name)}`}
className={styles.property} className={styles.property}
data-private={!isPublic} data-private={!isPublic}
data-deprecated={!!deprecation} data-deprecated={!!deprecation}
> >
<h3 className={styles.propertyName}>{name}</h3> <h3
id={`${parentAnchor}-${slugify(name)}`}
className={styles.propertyName}
>
{name}
</h3>
<div <div
className={styles.propertyType} className={styles.propertyType}

View File

@ -37,7 +37,7 @@ export default class Toc extends PureComponent {
<Scrollspy <Scrollspy
items={subIds[0]} items={subIds[0]}
currentClassName={stylesSidebar.scrollspyActive} currentClassName={stylesSidebar.scrollspyActive}
offset={-300} offset={300}
> >
{this.subItems(children, name)} {this.subItems(children, name)}
</Scrollspy> </Scrollspy>
@ -46,17 +46,6 @@ export default class Toc extends PureComponent {
}) })
render() { render() {
let Ids = [] return <ul>{this.items}</ul>
Ids.push(this.props.data.map(({ name }) => name))
return (
<Scrollspy
items={Ids[0]}
currentClassName={stylesSidebar.scrollspyActive}
offset={-300}
>
{this.items}
</Scrollspy>
)
} }
} }