Skip to content

Commit 141dbfc

Browse files
committed
patch: variant styling details and maxDepth
1 parent 8ff4498 commit 141dbfc

File tree

8 files changed

+12
-15
lines changed

8 files changed

+12
-15
lines changed

src/components/TableOfContents/TableOfContentsLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const variants = cva(
1111
{
1212
variants: {
1313
variant: {
14-
docs: "",
14+
docs: "py-0.5",
1515
beginner: "[&_[data-label='marker']]:!hidden inline leading-base",
1616
left: "",
1717
},

src/components/TableOfContents/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ import { useTranslation } from "@/hooks/useTranslation"
2020
import { usePathname } from "@/i18n/routing"
2121

2222
const variants = cva(
23-
"sticky top-28 flex h-fit max-lg:hidden flex-col items-start overflow-y-auto",
23+
"sticky flex h-fit max-lg:hidden flex-col items-start overflow-y-auto",
2424
{
2525
variants: {
2626
variant: {
27-
docs: "top-20 min-w-48 max-w-[25%] p-4 pe-0 gap-4",
27+
docs: "top-19 min-w-48 max-w-[25%] p-4 pe-0 gap-4",
2828
beginner: cn(
29-
"min-w-80 max-w-72 lg:p-8 px-3 py-2",
29+
"top-28 min-w-80 max-w-72 lg:p-8 px-3 py-2",
3030
"shrink-0 gap-y-2.5 rounded-2xl bg-accent-a/10 text-body-medium"
3131
),
32-
left: "me-16 ms-8 basis-[400px] [&_ul]:leading-relaxed",
32+
left: "top-28 me-16 ms-8 basis-[400px] [&_ul]:leading-relaxed",
3333
},
3434
},
3535
defaultVariants: {
@@ -54,7 +54,7 @@ const labelVariants = cva("font-bold", {
5454
const listVariants = cva("mx-0 gap-2 py-0", {
5555
variants: {
5656
variant: {
57-
docs: "list-none border-s border-s-body-medium ps-4 my-2",
57+
docs: "list-none border-s border-s-body-medium ps-4 my-2 text-sm",
5858
beginner: "list-decimal border-s-0 text-base list-inside ps-0 my-2",
5959
left: "list-none my-0",
6060
},
@@ -129,7 +129,7 @@ const TableOfContents = ({
129129
</ButtonLink>
130130
)}
131131
{variant === "left" && showDropdown && dropdownLinks && (
132-
<div className="relative mb-8 flex items-end justify-end">
132+
<div className="relative mb-8 flex w-full items-end justify-end">
133133
<ButtonDropdown
134134
list={dropdownLinks}
135135
className="w-full min-w-[240px]"

src/layouts/ContentLayout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import TableOfContents, {
1111
} from "@/components/TableOfContents"
1212

1313
type ContentLayoutProps = HTMLAttributes<HTMLDivElement> &
14-
Pick<TableOfContentsProps, "dropdownLinks" | "showDropdown" | "maxDepth"> & {
14+
Pick<TableOfContentsProps, "dropdownLinks" | "showDropdown"> & {
1515
children: React.ReactNode
1616
tocItems: TableOfContentsProps["items"]
1717
heroSection: React.ReactNode
@@ -23,7 +23,6 @@ export const ContentLayout = ({
2323
children,
2424
dropdownLinks,
2525
tocItems,
26-
maxDepth,
2726
showDropdown = true,
2827
heroSection,
2928
contributors,
@@ -38,8 +37,9 @@ export const ContentLayout = ({
3837
<TableOfContents
3938
items={tocItems}
4039
dropdownLinks={dropdownLinks}
41-
maxDepth={maxDepth}
40+
maxDepth={0}
4241
showDropdown={showDropdown}
42+
variant="left"
4343
/>
4444
<ContentContainer>
4545
{children}

src/layouts/Docs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ export const DocsLayout = ({
144144
<TableOfContents
145145
editPath={absoluteEditPath}
146146
items={tocItems}
147-
isMobile
148147
maxDepth={frontmatter.sidebarDepth!}
149148
hideEditButton={!!frontmatter.hideEditButton}
149+
isMobile
150150
/>
151151
<div className="prose prose-lg max-w-none break-words">
152152
{children}

src/layouts/Static.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ export const StaticLayout = ({
132132
<TableOfContents
133133
className="relative"
134134
items={tocItems}
135-
isMobile
136135
maxDepth={frontmatter.sidebarDepth || 2}
137136
hideEditButton={!!frontmatter.hideEditButton}
137+
isMobile
138138
/>
139139
{children}
140140

src/layouts/md/Roadmap.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ export const RoadmapLayout = ({
106106
dir={contentNotTranslated ? "ltr" : "unset"}
107107
tocItems={tocItems}
108108
dropdownLinks={dropdownLinks}
109-
maxDepth={frontmatter.sidebarDepth}
110109
contributors={contributors}
111110
lastEditLocaleTimestamp={lastEditLocaleTimestamp}
112111
heroSection={

src/layouts/md/Staking.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ export const StakingLayout = ({
172172
dir={contentNotTranslated ? "ltr" : "unset"}
173173
tocItems={tocItems}
174174
dropdownLinks={dropdownLinks}
175-
maxDepth={frontmatter.sidebarDepth}
176175
contributors={contributors}
177176
lastEditLocaleTimestamp={lastEditLocaleTimestamp}
178177
heroSection={<ContentHero {...heroProps} />}

src/layouts/md/UseCases.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ export const UseCasesLayout = ({
199199
<ContentLayout
200200
tocItems={tocItems}
201201
dropdownLinks={dropdownLinks}
202-
maxDepth={frontmatter.sidebarDepth}
203202
contributors={contributors}
204203
lastEditLocaleTimestamp={lastEditLocaleTimestamp}
205204
heroSection={<ContentHero {...heroProps} />}

0 commit comments

Comments
 (0)