Fix TOC button to be truly fixed-position using React Portal
The TOC toggle button was appearing near the end of posts instead of floating at a fixed position. This happened because the button was rendered inside the PostLayout component hierarchy. Changes: - Use React Portal to render TOC button at document.body level - Add mounted state for proper SSR/client hydration - Button now floats like back-to-top button, visible from start This ensures the button is always visible and accessible, similar to the back-to-top button behavior. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2
next-env.d.ts
vendored
2
next-env.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
import "./.next/types/routes.d.ts";
|
||||
import "./.next/dev/types/routes.d.ts";
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||
|
||||
Reference in New Issue
Block a user