Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚚 Inline menu in TOC #3646

Merged
merged 3 commits into from
Mar 13, 2025
Merged

🚚 Inline menu in TOC #3646

merged 3 commits into from
Mar 13, 2025

Conversation

KenAJoh
Copy link
Collaborator

@KenAJoh KenAJoh commented Mar 10, 2025

Description

Moved Menu-code inline for TOC. This releases the Menu-component to be re-implemented for the new sidebar.

Component Checklist 📝

  • JSDoc
  • Examples
  • Documentation / Decision Records
  • Storybook
  • Style mappings (@navikt/core/css/config/_mappings.js)
  • Component tokens (@navikt/core/css/tokens.json)
  • CSS class deprecations (@navikt/aksel-stylelint/src/deprecations.ts)
  • Exports (@navikt/core/react/src/index.ts and @navikt/core/react/package.json)
  • New component? CSS import (@navikt/core/css/index.css)
  • Breaking change? Update migration guide. Consider codemod.
  • Changeset (Format: <Component>: <gitmoji?> <Text>. E.g. "Button: ✨ Add feature xyz.")

Sorry, something went wrong.

Copy link

changeset-bot bot commented Mar 10, 2025

⚠️ No Changeset found

Latest commit: 103a6c3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@KenAJoh KenAJoh requested a review from Copilot March 10, 2025 21:57

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR refactors the Table of Contents by inlining the menu code, decoupling the legacy Menu components from the TOC, and updating the export/import conventions.

  • Replaces legacy Menu components with basic HTML elements and DS-React components.
  • Updates import paths and switches from default exports to named exports for several TOC-related files.
  • Refactors the TOC hook usage to improve code consistency.

Reviewed Changes

File Description
components/website-modules/toc/parts/UlList.tsx Inline menu structure refactor with updated style import and component usage.
components/website-modules/toc/parts/ScrollFade.tsx Updated style import and export change from default to named export.
components/website-modules/toc/TableOfContents.tsx Replaced legacy Menu components with Label and updated export.
components/website-modules/toc/parts/useScrollRange.ts Changed from default to named export and updated function declaration.
components/website-modules/toc/useToc.ts Converted arrow function to a function declaration and updated the export style.
pages/god-praksis/artikler/[slug].tsx Updated import style for TableOfContents.
pages/prinsipper/[...prinsipp].tsx Updated import style for TableOfContents and noted a potential typo in module name.

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

aksel.nav.no/website/components/website-modules/toc/parts/UlList.tsx:73

  • [nitpick] Function name 'removeEmojies' may contain a spelling mistake; consider renaming it to 'removeEmojis'.
{removeEmojies(node.title).trim()}

aksel.nav.no/website/pages/prinsipper/[...prinsipp].tsx:20

  • The module name 'NotFotfund' appears to be misspelled; consider renaming it to 'NotFound'.
import NotFotfund from "../404";
@KenAJoh KenAJoh merged commit 1d3abd7 into main Mar 13, 2025
6 checks passed
@KenAJoh KenAJoh deleted the expandable-menu-aksel branch March 13, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant