Skip to content

Commit

Permalink
Add ability to disable DropdownItem
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBartusek committed Jun 3, 2024
1 parent d5aa028 commit 5773763
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/client/src/components/Dropdown/DropdownItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function DropdownItem({
className,
active = false,
externalLink = false,
disabled,
...props
}: DropdownItemProps) {
const iconElement = icon ? React.createElement(icon) : null;
Expand All @@ -31,9 +32,10 @@ function DropdownItem({
'flex w-full items-center gap-3 px-4 py-2.5 text-gray-700 hover:bg-gray-150',
'justify-center',
{ 'bg-gray-150 text-primary': active },
{ '!text-gray-300 hover:bg-inherit': disabled },
className,
)}
disabled={active}
disabled={active || disabled}
{...props}
>
{iconElement}
Expand Down

0 comments on commit 5773763

Please sign in to comment.