Skip to content

Commit

Permalink
dropdown: allow header customization
Browse files Browse the repository at this point in the history
  • Loading branch information
victorgcramos authored Jun 28, 2022
1 parent 344e383 commit dbfbb3a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/Dropdown/Dropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ const DefaultTrigger = ({
onClick,
title,
open,
dropdownHeaderClassName,
dropdownArrowClassName,
ArrowComponent = Arrow,
}) => (
<div className={styles.headerWrapper} data-testid="trigger" onClick={onClick}>
<span className={styles.dropdownHeader}>{title}</span>
<span
className={classNames(styles.dropdownHeader, dropdownHeaderClassName)}>
{title}
</span>
<ArrowComponent
onClick={onClick}
open={open}
Expand All @@ -40,6 +44,7 @@ const Dropdown = ({
closeOnItemClick,
customDropdownTrigger,
dropdownArrowClassName,
dropdownHeaderClassName,
style,
...props
}) => {
Expand Down Expand Up @@ -114,6 +119,7 @@ const Dropdown = ({
onClick={handleTriggerClick}
open={dropdownOpenned}
dropdownArrowClassName={dropdownArrowClassName}
dropdownHeaderClassName={dropdownHeaderClassName}
ArrowComponent={Arrow}
/>
{dropdownOpenned &&
Expand All @@ -135,6 +141,7 @@ DefaultTrigger.propTypes = {
title: PropTypes.node,
open: PropTypes.bool,
dropdownArrowClassName: PropTypes.string,
dropdownHeaderClassName: PropTypes.string,
ArrowComponent: PropTypes.func,
};

Expand All @@ -148,6 +155,7 @@ Dropdown.propTypes = {
className: PropTypes.string,
itemsListClassName: PropTypes.string,
dropdownArrowClassName: PropTypes.string,
dropdownHeaderClassName: PropTypes.string,
customDropdownTrigger: PropTypes.func,
title: PropTypes.node,
show: PropTypes.bool,
Expand Down

0 comments on commit dbfbb3a

Please sign in to comment.