1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-02 00:05:35 +01:00

fix TOC item clicks, dim deprecated items, minimal deprecated entities

This commit is contained in:
Matthias Kretschmann 2019-01-28 13:42:50 +01:00
parent 16b0a2270f
commit ad1fded323
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 31 additions and 16 deletions

View File

@ -148,3 +148,9 @@
border-left-color: $green;
}
}
[data-deprecated='true'] {
code {
opacity: .5;
}
}

View File

@ -145,13 +145,9 @@ const PropertyWrapper = ({ property, sourceUrl, parentAnchor }) => {
className={styles.property}
data-private={!isPublic}
data-deprecated={!!deprecation}
id={`${parentAnchor}-${slugify(name)}`}
>
<h3
id={`${parentAnchor}-${slugify(name)}`}
className={styles.propertyName}
>
{name}
</h3>
<h3 className={styles.propertyName}>{name}</h3>
<div
className={styles.propertyType}
@ -167,7 +163,7 @@ const PropertyWrapper = ({ property, sourceUrl, parentAnchor }) => {
</div>
)}
{comment && (
{comment && !deprecation && (
<div className={styles.propertyDescription}>
{comment.text || comment.shortText}
</div>

View File

@ -32,6 +32,10 @@
opacity: .5;
}
code {
opacity: 1;
}
.sourceLink {
display: none;
}
@ -107,10 +111,10 @@
.deprecation {
font-size: $font-size-small;
margin-bottom: $spacer / 4;
margin-top: $spacer / 4;
strong {
color: $red;
color: $brand-grey-light;
}
}

View File

@ -11,13 +11,22 @@ export default class Toc extends PureComponent {
}
subItems = (children, parentName) =>
children.filter(filterByKindOfProperty).map(({ name }) => (
<li key={name}>
<a href={`#${parentName}-${slugify(name)}`}>
<code>{name}</code>
</a>
</li>
))
children.filter(filterByKindOfProperty).map(({ name, decorators }) => {
const deprecation = (decorators || []).filter(
({ name }) => name === 'deprecated'
)[0] // Assuming deprecated annotation
return (
<li key={name}>
<a
data-deprecated={!!deprecation}
href={`#${parentName}-${slugify(name)}`}
>
<code>{name}</code>
</a>
</li>
)
})
items = this.props.data.map(({ name, children }) => {
let subIds = []