Skip to content

Commit

Permalink
Replace color copy icon with visible text.
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia committed Dec 18, 2023
1 parent df9f857 commit ec46152
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 30 deletions.
22 changes: 4 additions & 18 deletions packages/components/src/color-picker/color-copy-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
*/
import { useCopyToClipboard } from '@wordpress/compose';
import { useState, useEffect, useRef } from '@wordpress/element';
import { copy } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import { CopyButton } from './styles';
import Tooltip from '../tooltip';

import type { ColorCopyButtonProps } from './types';
import { Button } from '../button';

export const ColorCopyButton = ( props: ColorCopyButtonProps ) => {
const { color, colorType } = props;
Expand Down Expand Up @@ -54,19 +51,8 @@ export const ColorCopyButton = ( props: ColorCopyButtonProps ) => {
}, [] );

return (
<Tooltip
delay={ 0 }
hideOnClick={ false }
text={
copiedColor === color.toHex() ? __( 'Copied!' ) : __( 'Copy' )
}
>
<CopyButton
size="small"
ref={ copyRef }
icon={ copy }
showTooltip={ false }
/>
</Tooltip>
<Button variant="secondary" size="small" ref={ copyRef }>
{ copiedColor === color.toHex() ? __( 'Copied!' ) : __( 'Copy' ) }
</Button>
);
};
12 changes: 0 additions & 12 deletions packages/components/src/color-picker/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import InnerSelectControl from '../select-control';
import InnerRangeControl from '../range-control';
import { space } from '../utils/space';
import { boxSizingReset } from '../utils';
import Button from '../button';
import { Flex } from '../flex';
import { HStack } from '../h-stack';
import {
Expand Down Expand Up @@ -115,14 +114,3 @@ export const ColorfulWrapper = styled.div`
${ interactiveHueStyles }
`;

export const CopyButton = styled( Button )`
&&&&& {
min-width: ${ space( 6 ) };
padding: 0;
> svg {
margin-right: 0;
}
}
`;

0 comments on commit ec46152

Please sign in to comment.