Skip to content

Commit 058894d

Browse files
authored
Merge pull request #7444 from ethereum/remove-sidebar
Refactor sidebar prop to hideEditButton
2 parents 4c395f1 + 18c2454 commit 058894d

File tree

1,601 files changed

+47
-1635
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,601 files changed

+47
-1635
lines changed

src/components/TableOfContents.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ export interface IProps {
371371
className?: string
372372
slug?: string
373373
editPath?: string
374+
hideEditButton?: boolean
374375
isMobile?: boolean
375376
}
376377

@@ -380,6 +381,7 @@ const TableOfContents: React.FC<IProps> = ({
380381
className,
381382
slug,
382383
editPath,
384+
hideEditButton = false,
383385
isMobile = false,
384386
}) => {
385387
const { isZenMode, handleZenModeChange } = useContext(ZenModeContext)
@@ -405,13 +407,13 @@ const TableOfContents: React.FC<IProps> = ({
405407

406408
const activeHash = useActiveHash(titleIds)
407409

408-
if (!items) {
409-
return null
410-
}
411410
// Exclude <h1> from TOC
412-
if (items.length === 1) {
411+
if (items?.length === 1) {
413412
items = items[0].items!
414413
}
414+
if (!items) {
415+
return null
416+
}
415417
if (isMobile) {
416418
return (
417419
<TableOfContentsMobile
@@ -423,12 +425,11 @@ const TableOfContents: React.FC<IProps> = ({
423425
}
424426

425427
const shouldShowZenModeToggle = slug?.includes("/docs/")
426-
const shouldShowEditButtom = !!editPath
427428

428429
return (
429430
<Aside className={className}>
430431
<OuterList>
431-
{shouldShowEditButtom && (
432+
{!hideEditButton && (
432433
<ButtonContainer>
433434
<ButtonLink to={editPath} variant="outline" hideArrow mt={0}>
434435
<ButtonContent>

src/content/about/index.md

Lines changed: 0 additions & 1 deletion

src/content/bridges/index.md

Lines changed: 0 additions & 1 deletion

src/content/community/events/index.md

Lines changed: 1 addition & 1 deletion

src/content/community/get-involved/index.md

Lines changed: 0 additions & 1 deletion

src/content/community/grants/academic-grants-round/index.md

Lines changed: 0 additions & 1 deletion

src/content/community/grants/index.md

Lines changed: 0 additions & 1 deletion

src/content/community/grants/medalla-data-challenge/index.md

Lines changed: 0 additions & 1 deletion

src/content/community/grants/staking-community-grants/index.md

Lines changed: 0 additions & 1 deletion

src/content/community/language-resources/index.md

Lines changed: 0 additions & 1 deletion

0 commit comments

Comments
 (0)