Updates
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { DetailedHTMLProps, HTMLAttributes } from "react";
|
||||
import { DocsLinkType } from ".";
|
||||
import React, { type DetailedHTMLProps, type HTMLAttributes } from "react";
|
||||
import type { DocsLinkType } from ".";
|
||||
import Stack from "../../layout/Stack";
|
||||
import TWUIDocsLink from "./TWUIDocsLink";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
@@ -28,7 +28,7 @@ export default function TWUIDocsRightAside({
|
||||
if (!ready) return;
|
||||
|
||||
const headerHrefs = document.querySelectorAll(
|
||||
".twui-docs-header-anchor"
|
||||
".twui-docs-header-anchor",
|
||||
);
|
||||
|
||||
const linksArr: DocsLinkType[] = [];
|
||||
@@ -87,7 +87,7 @@ export default function TWUIDocsRightAside({
|
||||
if (!links.length) return;
|
||||
|
||||
const headerHrefs = document.querySelectorAll(
|
||||
"a.twui-docs-header-anchor"
|
||||
"a.twui-docs-header-anchor",
|
||||
);
|
||||
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
@@ -96,7 +96,7 @@ export default function TWUIDocsRightAside({
|
||||
const id = entry.target.id;
|
||||
|
||||
const link = document.querySelector(
|
||||
`.twui-docs-right-aside a[href="#${id}"]`
|
||||
`.twui-docs-right-aside a[href="#${id}"]`,
|
||||
);
|
||||
if (link) {
|
||||
link.classList.add("active");
|
||||
@@ -104,7 +104,7 @@ export default function TWUIDocsRightAside({
|
||||
} else {
|
||||
const id = entry.target.id;
|
||||
const link = document.querySelector(
|
||||
`.twui-docs-right-aside a[href="#${id}"]`
|
||||
`.twui-docs-right-aside a[href="#${id}"]`,
|
||||
);
|
||||
if (link) {
|
||||
link.classList.remove("active");
|
||||
@@ -130,7 +130,7 @@ export default function TWUIDocsRightAside({
|
||||
className={twMerge(
|
||||
"pb-10 hidden xl:flex min-w-[150px] max-w-[200px]",
|
||||
"sticky top-6 twui-docs-right-aside",
|
||||
props.className
|
||||
props.className,
|
||||
)}
|
||||
>
|
||||
<Stack className="w-full overflow-hidden">
|
||||
|
||||
Reference in New Issue
Block a user