mirror of https://github.com/buster-so/buster.git
added display names
This commit is contained in:
parent
a61a63aa01
commit
cb76a6e74a
|
@ -65,8 +65,10 @@ export const ButtonDropdown = React.forwardRef<HTMLDivElement, ButtonDropdownPro
|
|||
);
|
||||
}
|
||||
);
|
||||
ButtonDropdown.displayName = 'ButtonDropdown';
|
||||
|
||||
export const ButtonSplit = React.forwardRef<
|
||||
export const ButtonSplit = React.memo(
|
||||
React.forwardRef<
|
||||
HTMLDivElement,
|
||||
Omit<ButtonDropdownProps, 'dropdownProps'> & {
|
||||
open: boolean;
|
||||
|
@ -101,7 +103,7 @@ export const ButtonSplit = React.forwardRef<
|
|||
buttonVariants({ buttonType, size, rounding: 'none' }),
|
||||
dropdownButtonVariants({ rounding }),
|
||||
'gap-0 !bg-transparent p-0',
|
||||
disabled && 'cursor-not-allowed opacity-60',
|
||||
disabled && 'cursor-not-allowed opacity-70',
|
||||
className
|
||||
)}>
|
||||
<div
|
||||
|
@ -114,7 +116,11 @@ export const ButtonSplit = React.forwardRef<
|
|||
) : (
|
||||
icon && (
|
||||
<span
|
||||
className={cn(buttonIconVariants({ buttonType, size }), 'text-sm', iconClassName)}>
|
||||
className={cn(
|
||||
buttonIconVariants({ buttonType, size }),
|
||||
'text-sm',
|
||||
iconClassName
|
||||
)}>
|
||||
{icon}
|
||||
</span>
|
||||
)
|
||||
|
@ -139,6 +145,22 @@ export const ButtonSplit = React.forwardRef<
|
|||
</div>
|
||||
);
|
||||
}
|
||||
),
|
||||
(prevProps, nextProps) => {
|
||||
return (
|
||||
prevProps.className === nextProps.className &&
|
||||
prevProps.buttonType === nextProps.buttonType &&
|
||||
prevProps.size === nextProps.size &&
|
||||
prevProps.icon === nextProps.icon &&
|
||||
prevProps.buttonText === nextProps.buttonText &&
|
||||
prevProps.disabled === nextProps.disabled &&
|
||||
prevProps.rounding === nextProps.rounding &&
|
||||
prevProps.loading === nextProps.loading &&
|
||||
prevProps.iconClassName === nextProps.iconClassName &&
|
||||
prevProps.open === nextProps.open &&
|
||||
prevProps.onOpenChange === nextProps.onOpenChange
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
ButtonSplit.displayName = 'ButtonSplit';
|
||||
|
|
|
@ -102,6 +102,8 @@ export const Dropdown: React.FC<DropdownProps> = React.memo(
|
|||
}
|
||||
);
|
||||
|
||||
Dropdown.displayName = 'Dropdown';
|
||||
|
||||
const DropdownItemSelector: React.FC<{
|
||||
item: DropdownItem | DropdownDivider;
|
||||
index: number;
|
||||
|
@ -216,3 +218,4 @@ const DropdownSubMenuWrapper = React.memo(
|
|||
);
|
||||
}
|
||||
);
|
||||
DropdownSubMenuWrapper.displayName = 'DropdownSubMenuWrapper';
|
||||
|
|
Loading…
Reference in New Issue