Skip to content

Commit

Permalink
feat: <Dropdown> leftRenderer prop (#1853)
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyRoyt authored Dec 26, 2023
1 parent c223cea commit c82a39d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ export const ChildrenContent = ({ data, children, readOnly }) => {
onMouseDown={onMouseDown}
data-testid={getTestId(ComponentDefaultTestId.DROPDOWN_OPTION_CONTENT)}
>
{data?.leftAvatar && (
<Avatar withoutBorder square={data.square} src={data.leftAvatar} type={Avatar.types.IMG} customSize={20} />
{data?.leftRenderer || (
<>
{data?.leftAvatar && (
<Avatar withoutBorder square={data.square} src={data.leftAvatar} type={Avatar.types.IMG} customSize={20} />
)}
{data?.leftIcon && <Icon iconSize={18} icon={data.leftIcon} clickable={false} />}
</>
)}
{data?.leftIcon && <Icon iconSize={18} icon={data.leftIcon} clickable={false} />}
{children}
{data?.rightIcon && <Icon iconSize={18} icon={data.rightIcon} clickable={false} />}
{data?.rightAvatar && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export default function Container({ children, selectProps, ...otherProps }) {
}}
readOnly={readOnly || (withMandatoryDefaultOptions && option.isMandatory)}
allowTextSelection={readOnly}
leftRenderer={option.leftRenderer}
leftAvatar={option.leftAvatar}
leftIcon={option.leftIcon}
color={overrideChipColor}
Expand Down

0 comments on commit c82a39d

Please sign in to comment.