Skip to content

Commit 8d9854d

Browse files
committed
[TOOL-3095] Portal: Enable Table of contents in Nebula pages, Adjust TOC component (#5965)
<!-- start pr-codex --> ## PR-Codex overview This PR focuses on refining the `Layout` component's structure and updating the styling for the `TOCLink` component to enhance the user interface. ### Detailed summary - In `Layout`, the `DocLayout` component now wraps `props.children` directly without unnecessary line breaks. - In `TOCLink`, the `data-active` class styling was changed from `text-accent-500` to `text-f-100` for active links. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 9cbcbe7 commit 8d9854d

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

apps/portal/src/app/nebula/layout.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ import { sidebar } from "./sidebar";
44

55
export default async function Layout(props: { children: React.ReactNode }) {
66
return (
7-
<DocLayout
8-
sideBar={sidebar}
9-
editPageButton={true}
10-
showTableOfContents={false}
11-
>
7+
<DocLayout sideBar={sidebar} editPageButton={true}>
128
{props.children}
139
</DocLayout>
1410
);

apps/portal/src/components/others/TableOfContents.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ export function TableOfContentsSideBar(props: {
6060
return;
6161
}
6262

63+
setHideNav(false);
64+
6365
// when heading's intersection changes, update corresponding link's data-active attribute to true/false
6466
const observer = new IntersectionObserver(
6567
(entries) => {
@@ -175,7 +177,7 @@ function TOCLink(props: {
175177
return (
176178
<Link
177179
className={cn(
178-
"block overflow-hidden text-ellipsis font-medium text-f-300 transition-colors hover:text-f-100 data-[active='true']:text-accent-500",
180+
"block overflow-hidden text-ellipsis font-medium text-f-300 transition-colors hover:text-f-100 data-[active='true']:text-f-100",
179181
props.linkClassName,
180182
)}
181183
href={props.href}

0 commit comments

Comments
 (0)