aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/layout/cards-list.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-10-18 19:25:02 +0200
committerArmand Philippot <git@armandphilippot.com>2023-11-11 18:14:41 +0100
commit94448fa278ab352a741ff13f22d6104869571144 (patch)
tree2185e77f2866d11a0144d4ac5a01c71a76807341 /src/components/organisms/layout/cards-list.tsx
parentc153f93dc8691a71dc76aad3dd618298da9d238a (diff)
feat(components): add a generic Grid component
* merge Columns, Gallery and CardsList into Grid component * add more options to control the grid
Diffstat (limited to 'src/components/organisms/layout/cards-list.tsx')
-rw-r--r--src/components/organisms/layout/cards-list.tsx60
1 files changed, 0 insertions, 60 deletions
diff --git a/src/components/organisms/layout/cards-list.tsx b/src/components/organisms/layout/cards-list.tsx
deleted file mode 100644
index 4f920e8..0000000
--- a/src/components/organisms/layout/cards-list.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-import type { FC, ReactElement } from 'react';
-import { List, ListItem } from '../../atoms';
-import type { CardProps } from '../../molecules';
-import styles from './cards-list.module.scss';
-
-export type CardsListItem = {
- /**
- * The card.
- */
- card: ReactElement<CardProps<string> | CardProps<undefined>>;
- /**
- * The card id.
- */
- id: string;
-};
-
-export type CardsListProps = {
- /**
- * Set additional classnames to the list wrapper.
- */
- className?: string;
- /**
- * Should the cards list be ordered?
- *
- * @default false
- */
- isOrdered?: boolean;
- /**
- * The cards data.
- */
- items: CardsListItem[];
-};
-
-/**
- * CardsList component
- *
- * Return a list of Card components.
- */
-export const CardsList: FC<CardsListProps> = ({
- className = '',
- isOrdered = false,
- items,
-}) => {
- const kindModifier = `wrapper--${isOrdered ? 'ordered' : 'unordered'}`;
-
- return (
- <List
- className={`${styles.wrapper} ${styles[kindModifier]} ${className}`}
- hideMarker
- isInline
- isOrdered={isOrdered}
- >
- {items.map(({ id, card }) => (
- <ListItem className={styles.item} key={id}>
- {card}
- </ListItem>
- ))}
- </List>
- );
-};