Skip to content

Commit

Permalink
feat: adds flat-list-item container props to its props
Browse files Browse the repository at this point in the history
  • Loading branch information
edusig committed Jun 21, 2023
1 parent 2055066 commit 4a2aa11
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/flat-list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface FlatListItemProps {
component?:
| FunctionComponent<{ children?: ReactNode; className?: string; onClick?: (e: any) => void }>
| string;
containerProps?: Partial<JSX.IntrinsicElements['div']>;
}

export const FlatListItem: FC<FlatListItemProps> = ({
Expand All @@ -60,13 +61,14 @@ export const FlatListItem: FC<FlatListItemProps> = ({
height = '56px',
LinkComponent,
component,
containerProps,
}) => {
const hasAction = onClick != null || url != null;
const hasActionIcon = actionIcon && hasAction;
const hasRight = imageRight != null || subtitleRight != null || right != null || hasActionIcon;
const Component = component ?? 'li';
const el = (
<div className={contentClassName} style={{ height }}>
<div {...containerProps} className={contentClassName} style={{ height }}>
<div
className={`flat-list-item-content-left ${leftOptions?.className ?? ''}`}
style={leftOptions?.style}
Expand Down

0 comments on commit 4a2aa11

Please sign in to comment.