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 (
|
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}
|
||||||
|
@ -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>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user