aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/widgets/links-list-widget.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-10-06 17:48:03 +0200
committerArmand Philippot <git@armandphilippot.com>2023-11-11 18:14:41 +0100
commit12a03a9a72f7895d571dbaeeb245d92aa277a610 (patch)
tree41b6b07928e4f5e101b7ea5d8389bb4325bbac76 /src/components/organisms/widgets/links-list-widget.tsx
parentfb860884857da73ee5b5e897745301cdf1d770a2 (diff)
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.
Diffstat (limited to 'src/components/organisms/widgets/links-list-widget.tsx')
-rw-r--r--src/components/organisms/widgets/links-list-widget.tsx17
1 files changed, 7 insertions, 10 deletions
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<WidgetProps, 'level' | 'title'> & {
+export type LinksListWidgetProps = Omit<
+ CollapsibleProps,
+ 'children' | 'disablePadding' | 'hasBorders'
+> & {
className?: string;
/**
* Should the links be ordered?
@@ -71,13 +74,7 @@ export const LinksListWidget: FC<LinksListWidgetProps> = ({
));
return (
- <Widget
- {...props}
- className={styles.widget}
- expanded={true}
- withBorders={true}
- withScroll={true}
- >
+ <Collapsible {...props} className={styles.widget} disablePadding hasBorders>
<List
className={`${styles.list} ${styles[listKindClass]} ${className}`}
hideMarker
@@ -85,6 +82,6 @@ export const LinksListWidget: FC<LinksListWidgetProps> = ({
>
{getListItems(items)}
</List>
- </Widget>
+ </Collapsible>
);
};