Skip to content

Commit

Permalink
Add support foorcustom active property
Browse files Browse the repository at this point in the history
  • Loading branch information
Studio384 committed Aug 22, 2022
1 parent 97e2905 commit 481425e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/DropdownItem/DropdownItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ export interface DropdownItemProps<T> {
* The color of the button, only works when the variant is `color` or `hover`
*/
color?: MellowColor;
/**
* Button active state.
*/
active?: boolean;
/**
* Button disabled state.
*/
Expand Down Expand Up @@ -43,6 +47,7 @@ export function Dropdown<T>({
className,
as,
color,
active,
disabled = false,
children,
onClick,
Expand All @@ -52,13 +57,13 @@ export function Dropdown<T>({

return (
<Menu.Item>
{({ active }) => (
{({ active: isActive }) => (
<Component
type="button"
className={clsx(
'dropdown-item',
{
'active': active,
'active': isActive || active,
},
color,
className
Expand Down

0 comments on commit 481425e

Please sign in to comment.