Skip to content

Commit

Permalink
Use variable
Browse files Browse the repository at this point in the history
  • Loading branch information
mirka committed Nov 19, 2024
1 parent 62f39cd commit 4d043a2
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions packages/components/src/color-picker/color-copy-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,14 @@ export const ColorCopyButton = ( props: ColorCopyButtonProps ) => {
};
}, [] );

const label =
copiedColor === color.toHex() ? __( 'Copied!' ) : __( 'Copy' );

return (
<Tooltip
delay={ 0 }
hideOnClick={ false }
text={
copiedColor === color.toHex() ? __( 'Copied!' ) : __( 'Copy' )
}
>
<Tooltip delay={ 0 } hideOnClick={ false } text={ label }>
<CopyButton
size="small"
aria-label={
copiedColor === color.toHex()
? __( 'Copied!' )
: __( 'Copy' )
}
aria-label={ label }
ref={ copyRef }
icon={ copy }
showTooltip={ false }
Expand Down

0 comments on commit 4d043a2

Please sign in to comment.