Skip to content

Commit 6e44247

Browse files
Ruben van LeeuwenDutchBen
authored andcommitted
1506: Adds clickabe icon padding
1 parent 87de232 commit 6e44247

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

packages/orchestrator-ui-components/src/components/WfoKeyValueTable/WfoValueCell.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,20 @@ export const WfoValueCell: FC<WfoValueCellProps> = ({
2424
const {
2525
clipboardIconSize,
2626
clipboardIconStyle,
27-
clickable,
27+
clickableStyle,
2828
getBackgroundColorStyleForRow,
2929
valueColumnStyle,
3030
valueCellStyle,
3131
} = useWithOrchestratorTheme(getStyles);
3232

3333
const shouldRenderCopyColumn = enableCopyIcon && textToCopy;
3434

35-
const valueToRender = React.isValidElement(value)
36-
? value
37-
: JSON.stringify(value);
35+
const valueToRender =
36+
typeof value === 'string' ||
37+
typeof value === 'number' ||
38+
React.isValidElement(value)
39+
? value
40+
: JSON.stringify(value);
3841

3942
const copyText =
4043
typeof textToCopy === 'object'
@@ -48,7 +51,7 @@ export const WfoValueCell: FC<WfoValueCellProps> = ({
4851
{shouldRenderCopyColumn && (
4952
<EuiCopy textToCopy={copyText || ''}>
5053
{(copy) => (
51-
<div onClick={copy} css={clickable}>
54+
<div onClick={copy} css={clickableStyle}>
5255
<WfoClipboardCopy
5356
width={clipboardIconSize}
5457
height={clipboardIconSize}

packages/orchestrator-ui-components/src/components/WfoKeyValueTable/styles.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ export const getStyles = ({ theme }: WfoTheme) => {
7373
paddingBottom: 0,
7474
});
7575

76-
const clickable = css({
76+
const clickableStyle = css({
7777
marginLeft: clipboardIconMargin,
7878
cursor: 'pointer',
79+
paddingRight: theme.size.s,
7980
});
8081

8182
return {
@@ -87,7 +88,7 @@ export const getStyles = ({ theme }: WfoTheme) => {
8788
keyCellStyle,
8889
valueCellStyle,
8990
clipboardIconStyle,
90-
clickable,
91+
clickableStyle,
9192
lightBackground,
9293
darkBackground,
9394
getBackgroundColorStyleForRow,

0 commit comments

Comments
 (0)