Skip to content

Commit

Permalink
revert: do not include changes for Copy and CopyButton
Browse files Browse the repository at this point in the history
  • Loading branch information
Tresau committed Apr 4, 2024
1 parent 50410ab commit 51caa1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 2 additions & 10 deletions packages/react/src/components/Copy/Copy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,8 @@ export default function Copy({

const initialLabel = other['aria-label'] ?? '';

// TODO: remove these two lines when IconButton is properly typed, revert TypedIconButton component to IconButton
type IconButtonType = React.ButtonHTMLAttributes<HTMLButtonElement> & {
closeOnActivation?: boolean;
align: string;
label: string | undefined;
};
const TypedIconButton = IconButton as React.FC<IconButtonType>;

return (
<TypedIconButton
<IconButton
closeOnActivation={false}
align={align}
className={classNames}
Expand All @@ -132,7 +124,7 @@ export default function Copy({
(!children && (animation ? feedback : other['aria-label'])) || undefined
}>
{children}
</TypedIconButton>
</IconButton>
);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/CopyButton/CopyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import PropTypes from 'prop-types';
import React, { MouseEventHandler } from 'react';
import classnames from 'classnames';
import { Copy as CopyIcon } from '@carbon/icons-react';
import { ButtonProps } from '../Button';
import Copy from '../Copy';
import { LayoutConstraint } from '../Layout';
import { usePrefix } from '../../internal/usePrefix';
import { noopFn } from '../../internal/noopFn';

export interface CopyButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
export interface CopyButtonProps extends ButtonProps<'button'> {
/**
* Specify how the trigger should align with the tooltip
*/
Expand Down

0 comments on commit 51caa1f

Please sign in to comment.