Skip to content

Commit

Permalink
Move the Copy button after the value that is being copied.
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia committed Jul 19, 2024
1 parent 0328d29 commit 7ecb450
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/components/src/color-picker/color-copy-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const ColorCopyButton = ( props: ColorCopyButtonProps ) => {
}, [] );

return (
<Button variant="secondary" size="small" ref={ copyRef }>
<Button variant="secondary" ref={ copyRef } __next40pxDefaultSize>
{ copiedColor === color.toHex() ? __( 'Copied!' ) : __( 'Copy' ) }
</Button>
);
Expand Down
14 changes: 9 additions & 5 deletions packages/components/src/color-picker/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,22 @@ const UnconnectedColorPicker = (
hideLabelFromVision
variant="minimal"
/>
<ColorCopyButton
color={ safeColordColor }
colorType={ copyFormat || colorType }
/>
</AuxiliaryColorArtefactHStackHeader>
<ColorInputWrapper direction="column" gap={ 2 }>
<ColorInputWrapper
direction={ colorType === 'hex' ? 'row' : 'column' }
align="flex-start"
gap={ 2 }
>
<ColorInput
colorType={ colorType }
color={ safeColordColor }
onChange={ handleChange }
enableAlpha={ enableAlpha }
/>
<ColorCopyButton
color={ safeColordColor }
colorType={ copyFormat || colorType }
/>
</ColorInputWrapper>
</AuxiliaryColorArtefactWrapper>
</ColorfulWrapper>
Expand Down

0 comments on commit 7ecb450

Please sign in to comment.