feat(toolbar): new Toolbar to enable reactive state synchronization (#3983)

This commit is contained in:
Alireza authored and GitHub committed 2024-03-27 16:01:32 -04:00
1 parent 79d5c36bda
commit 566b25a544
155 files changed
+6311 -6577

No files matched your search

+6 -1
View File
@@ -67,9 +67,12 @@ const Button = ({
name,
className,
onClick,
dataCY,
startIconTooltip = null,
endIconTooltip = null,
}) => {
dataCY = dataCY || `${name}-btn`;
const startIcon = startIconProp && (
<>
{React.cloneElement(startIconProp, {
@@ -109,7 +112,7 @@ const Button = ({
disabled={disabled}
ref={buttonElement}
onClick={handleOnClick}
data-cy={`${name}-btn`}
data-cy={dataCY}
>
{startIconTooltip ? <Tooltip content={startIconTooltip}>{startIcon}</Tooltip> : startIcon}
{children}
@@ -148,6 +151,8 @@ Button.propTypes = {
startIconTooltip: PropTypes.node,
/** Tooltip for the end icon */
endIconTooltip: PropTypes.node,
/** Data attribute for testing */
dataCY: PropTypes.string,
};
export default Button;