mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-06-30 21:52:06 +02:00
nicer source link
This commit is contained in:
parent
c6b9cbb59e
commit
0caf03e24e
|
@ -162,7 +162,9 @@ const PropertyWrapper = ({ property, sourceUrl, parentAnchor }) => {
|
|||
if (deprecation) {
|
||||
deprecatedUse = deprecation.arguments.alternative.replace(/'/g, '')
|
||||
}
|
||||
|
||||
const sourceLink = `${sourceUrl}${fileName}#L${line}`
|
||||
|
||||
return (
|
||||
<div
|
||||
id={`${parentAnchor}/${slugify(name)}`}
|
||||
|
@ -186,17 +188,6 @@ const PropertyWrapper = ({ property, sourceUrl, parentAnchor }) => {
|
|||
</div>
|
||||
)}
|
||||
|
||||
{fileName && (
|
||||
<a
|
||||
className={styles.sourceLink}
|
||||
href={sourceLink}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
source
|
||||
</a>
|
||||
)}
|
||||
|
||||
{comment && (
|
||||
<div className={styles.propertyDescription}>
|
||||
{comment.text || comment.shortText}
|
||||
|
@ -223,6 +214,17 @@ const PropertyWrapper = ({ property, sourceUrl, parentAnchor }) => {
|
|||
return <PropertyDetails property={property} />
|
||||
}
|
||||
})()}
|
||||
|
||||
{fileName && (
|
||||
<a
|
||||
className={styles.sourceLink}
|
||||
href={sourceLink}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
{`${fileName}#L${line}`}
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -91,13 +91,22 @@
|
|||
}
|
||||
|
||||
.sourceLink {
|
||||
display: block;
|
||||
font-size: $font-size-mini;
|
||||
color: $brand-grey-light;
|
||||
margin-top: $spacer / 2;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
transform: none;
|
||||
}
|
||||
|
||||
@media (min-width: $break-point--large) {
|
||||
margin-top: 0;
|
||||
position: absolute;
|
||||
bottom: $spacer / 2;
|
||||
right: $spacer / 2;
|
||||
font-size: $font-size-mini;
|
||||
font-family: $font-family-button;
|
||||
text-transform: uppercase;
|
||||
color: $brand-grey-light;
|
||||
}
|
||||
}
|
||||
|
||||
.deprecation {
|
||||
|
|
Loading…
Reference in New Issue
Block a user