diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-04-15 16:32:55 +0200 | 
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-04-15 17:40:33 +0200 | 
| commit | d9bf6f0d69ecb4475c06c772ef6314e5a7ee0fe8 (patch) | |
| tree | a5b962a7f41db1d1d951fab5d1f1557edef756f1 /src/components/atoms/lists | |
| parent | 6ec16bc15cc78e62cb94e131699625fa5363437c (diff) | |
chore: add a LinksListWidget component
Diffstat (limited to 'src/components/atoms/lists')
| -rw-r--r-- | src/components/atoms/lists/list.tsx | 11 | 
1 files changed, 8 insertions, 3 deletions
| diff --git a/src/components/atoms/lists/list.tsx b/src/components/atoms/lists/list.tsx index 74ab8b0..d100a31 100644 --- a/src/components/atoms/lists/list.tsx +++ b/src/components/atoms/lists/list.tsx @@ -18,7 +18,7 @@ export type ListItem = {  export type ListProps = {    /** -   * Set additional classnames to the list wrapper +   * Set additional classnames to the list wrapper.     */    className?: string;    /** @@ -26,6 +26,10 @@ export type ListProps = {     */    items: ListItem[];    /** +   * Set additional classnames to the list items. +   */ +  itemsClassName?: string; +  /**     * The list kind (ordered or unordered).     */    kind?: 'ordered' | 'unordered'; @@ -41,8 +45,9 @@ export type ListProps = {   * Render either an ordered or an unordered list.   */  const List: VFC<ListProps> = ({ -  className, +  className = '',    items, +  itemsClassName = '',    kind = 'unordered',    withMargin = true,  }) => { @@ -57,7 +62,7 @@ const List: VFC<ListProps> = ({     */    const getItems = (array: ListItem[]): JSX.Element[] => {      return array.map(({ child, id, value }) => ( -      <li key={id} className={styles.list__item}> +      <li key={id} className={`${styles.list__item} ${itemsClassName}`}>          {value}          {child && (            <ListTag | 
