Skip to content

Commit

Permalink
fix: fix contained blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
HagerDakroury authored and colorfield committed May 15, 2024
1 parent a79e42b commit b17d168
Showing 1 changed file with 47 additions and 45 deletions.
92 changes: 47 additions & 45 deletions packages/ui/src/components/Organisms/PageContent/BlockAccordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,51 +50,53 @@ const theme: CustomFlowbiteTheme = {

export function BlockAccordion(props: BlockAccordionFragment) {
return (
<Flowbite theme={{ theme }}>
<Accordion collapseAll>
{props.items.map((item, index) => (
<Accordion.Panel key={index}>
<Accordion.Title>
<span className="flex items-center">
{item.icon && <AccordionIcon icon={item.icon} />} {item.title}
</span>
</Accordion.Title>
<Accordion.Content className="space-y-2">
<div className="sm:w-full md:w-4/5">
{item.textContent?.markup && (
<Html
plugins={[unorderedItems]}
components={{
li: ({
unordered,
children,
className,
...props
}: PropsWithChildren<{
unordered?: boolean;
className?: string;
}>) => {
return (
<li
{...props}
className={clsx(className, {
'ml-5 mt-1 mb-1 list-disc': unordered,
})}
>
{children}
</li>
);
},
}}
markup={item.textContent.markup}
/>
)}
</div>
</Accordion.Content>
</Accordion.Panel>
))}
</Accordion>
</Flowbite>
<div className="container-content">
<Flowbite theme={{ theme }}>
<Accordion collapseAll>
{props.items.map((item, index) => (
<Accordion.Panel key={index}>
<Accordion.Title>
<span className="flex items-center">
{item.icon && <AccordionIcon icon={item.icon} />} {item.title}
</span>
</Accordion.Title>
<Accordion.Content className="space-y-2">
<div className="sm:w-full md:w-4/5">
{item.textContent?.markup && (
<Html
plugins={[unorderedItems]}
components={{
li: ({
unordered,
children,
className,
...props
}: PropsWithChildren<{
unordered?: boolean;
className?: string;
}>) => {
return (
<li
{...props}
className={clsx(className, {
'ml-5 mt-1 mb-1 list-disc': unordered,
})}
>
{children}
</li>
);
},
}}
markup={item.textContent.markup}
/>
)}
</div>
</Accordion.Content>
</Accordion.Panel>
))}
</Accordion>
</Flowbite>
</div>
);
}

Expand Down

0 comments on commit b17d168

Please sign in to comment.