diff --git a/site/components/Heading.js b/site/components/Heading.js index cd741db..85e2b45 100644 --- a/site/components/Heading.js +++ b/site/components/Heading.js @@ -1,28 +1,16 @@ -import React, { useEffect, useState, useRef } from 'react'; +import React, { useEffect, useState } from 'react'; export const Heading = ({ level, observer }) => (props) => { - const ref = useRef(null); - - const handleClick = async () => { - const url = ref.current.querySelector("a").href; - try { - await navigator.clipboard.writeText(url); - } catch { - return - } - } - useEffect(() => { if (observer) { observer.observe(document.getElementById(props.id)); } }); + return React.createElement(`h${level}`, { ...props, - className: "scroll-mt-16 cursor-copy", - ref, - onClick: handleClick + className: "scroll-mt-16 cursor-pointer" }) } diff --git a/site/contentlayer.config.ts b/site/contentlayer.config.ts index 2968885..f577f8d 100644 --- a/site/contentlayer.config.ts +++ b/site/contentlayer.config.ts @@ -63,7 +63,7 @@ export default makeSource({ ], rehypePlugins: [ rehypeSlug, - rehypeAutolinkHeadings, + [ rehypeAutolinkHeadings, { behavior: 'wrap' } ], [ rehypeToc, { position: 'afterend' } ] ] } diff --git a/site/styles/global.css b/site/styles/global.css index ff720b0..4aa677d 100644 --- a/site/styles/global.css +++ b/site/styles/global.css @@ -11,11 +11,18 @@ } /* OTHERS */ - html { scroll-behavior: smooth; } +a { + @apply no-underline !important; +} + +a:hover { + @apply text-yellow-li !important; +} + /* bg-neutral-800 @apply bg-slate-800 */