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:
parent
2659213616
commit
16b0a2270f
@ -142,12 +142,16 @@ const PropertyWrapper = ({ property, sourceUrl, parentAnchor }) => {
|
||||
|
||||
return (
|
||||
<div
|
||||
id={`${parentAnchor}-${slugify(name)}`}
|
||||
className={styles.property}
|
||||
data-private={!isPublic}
|
||||
data-deprecated={!!deprecation}
|
||||
>
|
||||
<h3 className={styles.propertyName}>{name}</h3>
|
||||
<h3
|
||||
id={`${parentAnchor}-${slugify(name)}`}
|
||||
className={styles.propertyName}
|
||||
>
|
||||
{name}
|
||||
</h3>
|
||||
|
||||
<div
|
||||
className={styles.propertyType}
|
||||
|
@ -37,7 +37,7 @@ export default class Toc extends PureComponent {
|
||||
<Scrollspy
|
||||
items={subIds[0]}
|
||||
currentClassName={stylesSidebar.scrollspyActive}
|
||||
offset={-300}
|
||||
offset={300}
|
||||
>
|
||||
{this.subItems(children, name)}
|
||||
</Scrollspy>
|
||||
@ -46,17 +46,6 @@ export default class Toc extends PureComponent {
|
||||
})
|
||||
|
||||
render() {
|
||||
let Ids = []
|
||||
Ids.push(this.props.data.map(({ name }) => name))
|
||||
|
||||
return (
|
||||
<Scrollspy
|
||||
items={Ids[0]}
|
||||
currentClassName={stylesSidebar.scrollspyActive}
|
||||
offset={-300}
|
||||
>
|
||||
{this.items}
|
||||
</Scrollspy>
|
||||
)
|
||||
return <ul>{this.items}</ul>
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user