Skip to content

Commit

Permalink
Added classes to ul and li of accordion context navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
ichim-david committed Aug 7, 2024
1 parent 9c73cd5 commit 08cd8a6
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/components/Blocks/ContextNavigation/variations/Accordion.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { withContentNavigation } from '@plone/volto/components/theme/Navigation/

import upIcon from '@plone/volto/icons/up-key.svg';
import downIcon from '@plone/volto/icons/down-key.svg';
import { has } from 'cypress/types/lodash';

const messages = defineMessages({
navigation: {
Expand Down Expand Up @@ -60,7 +61,14 @@ const AccordionNavigation = ({ navigation = {} }) => {
};

return (
<li className={cx({ title: true, is_in_path })} key={href}>
<li
className={cx({
is_in_path,
title: !hasChildItems,
accordion_list_item: hasChildItems,
})}
key={href}
>
{hasChildItems ? (
<Accordion className="default">
<Accordion.Title
Expand All @@ -75,7 +83,7 @@ const AccordionNavigation = ({ navigation = {} }) => {
<span className="title-text">{title}</span>
</Accordion.Title>
<Accordion.Content active={isActive}>
<ul>
<ul className="accordion-list">
{childItems.map((child) =>
renderItems({ item: child, level: level + 1 }),
)}
Expand Down Expand Up @@ -109,7 +117,9 @@ const AccordionNavigation = ({ navigation = {} }) => {
style={{ marginLeft: 'auto' }}
/>
</summary>
<ul>{items.map((item, index) => renderItems({ item }))}</ul>
<ul className="accordion-list">
{items.map((item, index) => renderItems({ item }))}
</ul>
</details>
</nav>
) : null;
Expand Down

0 comments on commit 08cd8a6

Please sign in to comment.