From 12a03a9a72f7895d571dbaeeb245d92aa277a610 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 6 Oct 2023 17:48:03 +0200 Subject: refactor(components): merge HeadingButton and Widget components The HeadingButton component was only used inside Widget component and it is not very useful on its own so I merge the two components in a new Collapsible component. --- src/components/organisms/widgets/links-list-widget.tsx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/components/organisms/widgets/links-list-widget.tsx') diff --git a/src/components/organisms/widgets/links-list-widget.tsx b/src/components/organisms/widgets/links-list-widget.tsx index 8f71efd..17a5884 100644 --- a/src/components/organisms/widgets/links-list-widget.tsx +++ b/src/components/organisms/widgets/links-list-widget.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import { slugify } from '../../../utils/helpers'; import { Link, List, ListItem } from '../../atoms'; -import { Widget, type WidgetProps } from '../../molecules'; +import { Collapsible, type CollapsibleProps } from '../../molecules'; import styles from './links-list-widget.module.scss'; export type LinksListItems = { @@ -19,7 +19,10 @@ export type LinksListItems = { url: string; }; -export type LinksListWidgetProps = Pick & { +export type LinksListWidgetProps = Omit< + CollapsibleProps, + 'children' | 'disablePadding' | 'hasBorders' +> & { className?: string; /** * Should the links be ordered? @@ -71,13 +74,7 @@ export const LinksListWidget: FC = ({ )); return ( - + = ({ > {getListItems(items)} - + ); }; -- cgit v1.2.3