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

Åpning av accordion og readmore-komponenter ved redaktørvarsel #2184

Merged
merged 7 commits into from
Mar 3, 2025

Conversation

taniaholst
Copy link
Contributor

@taniaholst taniaholst commented Feb 25, 2025

This pull request includes several changes to improve the functionality and maintainability of the Accordion and Expandable components, as well as some minor style adjustments. The key changes involve refactoring the handling of panel state and adding new hooks to manage panel opening based on URL parameters.

Improvements to Accordion component:

  • Refactored Accordion component to use React.createRef for item references and simplified state management for opening panels. [1] [2] [3]
  • Added useCheckAndOpenAccordionPanel hook to handle panel state based on URL parameters and hash changes.

Improvements to Expandable component:

  • Added useCheckAndOpenPanel hook to manage panel opening based on URL parameters and hash changes. [1] [2]
  • Simplified Expandable component by removing redundant useEffect hooks and replacing them with the new hook. [1] [2]

Style adjustments:

  • Added a pseudo-element to DuplicateIdsWarning for better visual spacing.
  • Adjusted ReadMorePart button's z-index for better stacking context.

New hooks:

  • Created useCheckAndOpenAccordionPanel and useCheckAndOpenPanel hooks to manage panel state based on URL parameters and hash changes. [1] [2]

@taniaholst taniaholst marked this pull request as ready for review February 27, 2025 20:24
@taniaholst taniaholst requested a review from a team as a code owner February 27, 2025 20:24
@taniaholst taniaholst changed the title paneler åpner seg i readme og expandable. ny hook for sjekk og åpning… Åpning av accordion og readmore-komponenter ved redaktørvarsel Feb 28, 2025
Copy link

sonarqubecloud bot commented Mar 3, 2025

@taniaholst taniaholst merged commit 1c21ae4 into main Mar 3, 2025
7 checks passed
@taniaholst taniaholst deleted the redaktorvarsel-expandable branch March 3, 2025 14:52
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.

2 participants