mirror of
https://github.com/r-freeman/portfolio.git
synced 2025-04-18 20:44:46 +00:00
Update heading component
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 3m15s
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 3m15s
This commit is contained in:
parent
a1943ebbf3
commit
55d34565f2
@ -11,10 +11,9 @@ export function Heading({as: Component = 'h1', children = null}: HeadingProps) {
|
|||||||
let headingText = children ? children.toString() : ''
|
let headingText = children ? children.toString() : ''
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Component id={createSlug(headingText)} className="group">
|
<Component id={createSlug(headingText)} className="flex group">
|
||||||
{children}
|
{children}
|
||||||
<Link className="ml-1.5 group-hover:visible invisible"
|
<Link className="sr-only group-hover:not-sr-only !ml-1.5" href={`#${createSlug(headingText)}`}>#</Link>
|
||||||
href={`#${createSlug(headingText)}`}>#</Link>
|
|
||||||
</Component>
|
</Component>
|
||||||
)
|
)
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user