Skip to content

Commit 9b41180

Browse files
ArueliusDimitri POSTOLOVdimaMachina
authoredMar 6, 2024
fix(toc): backToTop can't work alone (#2766)
* fix(toc): `backToTop` can't work alone * Create popular-dancers-flow.md * Update .changeset/popular-dancers-flow.md --------- Co-authored-by: Dimitri POSTOLOV <en3m@ya.ru> Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com>
1 parent eeb4c4c commit 9b41180

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
 

‎.changeset/popular-dancers-flow.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'nextra-theme-docs': patch
3+
---
4+
5+
`backToTop` is hidden when enabled but when `toc.extraContent`, `feedback.content` and `editLink.component` are falsy

‎packages/nextra-theme-docs/src/components/toc.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export function TOC({ toc, filePath }: TOCProps): ReactElement {
2828
const hasMetaInfo = Boolean(
2929
themeConfig.feedback.content ||
3030
themeConfig.editLink.component ||
31-
themeConfig.toc.extraContent
31+
themeConfig.toc.extraContent ||
32+
themeConfig.toc.backToTop
3233
)
3334

3435
const activeSlug = Object.entries(activeAnchor).find(

0 commit comments

Comments
 (0)
Please sign in to comment.