fix: remove extra className prop

it is already included from the button types which we pass through the spread props
pull/3083/head
William Grant 1 year ago
parent 111541f228
commit db7fba0dc1

@ -11,13 +11,12 @@ type CopyProps = {
copyContent: string; copyContent: string;
onCopyComplete?: (copiedValue: string | undefined) => void; onCopyComplete?: (copiedValue: string | undefined) => void;
hotkey?: boolean; hotkey?: boolean;
className?: string;
}; };
type CopyToClipboardButtonProps = Omit<SessionButtonProps, 'children' | 'onClick'> & CopyProps; type CopyToClipboardButtonProps = Omit<SessionButtonProps, 'children' | 'onClick'> & CopyProps;
export const CopyToClipboardButton = (props: CopyToClipboardButtonProps) => { export const CopyToClipboardButton = (props: CopyToClipboardButtonProps) => {
const { className, copyContent, onCopyComplete, hotkey = false, text } = props; const { copyContent, onCopyComplete, hotkey = false, text } = props;
const [copied, setCopied] = useState(false); const [copied, setCopied] = useState(false);
const [{ value }, copyToClipboard] = useCopyToClipboard(); const [{ value }, copyToClipboard] = useCopyToClipboard();
@ -47,7 +46,6 @@ export const CopyToClipboardButton = (props: CopyToClipboardButtonProps) => {
<SessionButton <SessionButton
aria-label={'copy to clipboard button'} aria-label={'copy to clipboard button'}
{...props} {...props}
className={className}
text={ text={
!isEmpty(text) !isEmpty(text)
? text ? text
@ -64,7 +62,7 @@ type CopyToClipboardIconProps = Omit<SessionIconButtonProps, 'children' | 'onCli
CopyProps; CopyProps;
export const CopyToClipboardIcon = (props: CopyToClipboardIconProps) => { export const CopyToClipboardIcon = (props: CopyToClipboardIconProps) => {
const { className, copyContent, onCopyComplete, hotkey = false } = props; const { copyContent, onCopyComplete, hotkey = false } = props;
const [{ value }, copyToClipboard] = useCopyToClipboard(); const [{ value }, copyToClipboard] = useCopyToClipboard();
const onClick = () => { const onClick = () => {
@ -91,7 +89,6 @@ export const CopyToClipboardIcon = (props: CopyToClipboardIconProps) => {
<SessionIconButton <SessionIconButton
aria-label={'copy to clipboard icon button'} aria-label={'copy to clipboard icon button'}
{...props} {...props}
className={className}
iconType={'copy'} iconType={'copy'}
onClick={onClick} onClick={onClick}
/> />

Loading…
Cancel
Save