Skip to content

Commit 2730fe4

Browse files
committed
style: modify copy button style. #33
1 parent e042c4b commit 2730fe4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

core/src/comps/Copied.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,18 @@ export const Copied = <T extends object, K extends TagType>(props: CopiedProps<T
5353
.catch((error) => {});
5454
};
5555
const svgProps: React.SVGProps<SVGSVGElement> = {
56-
display: 'inline-flex',
56+
style: { display: 'inline-flex' },
5757
fill: copied ? 'var(--w-rjv-copied-success-color, #28a745)' : 'var(--w-rjv-copied-color, currentColor)',
5858
onClick: click,
5959
};
6060
const { as, render, ...reset } = Comp;
6161

62-
const elmProps: React.SVGProps<SVGSVGElement> = { ...reset, ...other, ...svgProps } as React.SVGProps<SVGSVGElement>;
62+
const elmProps: React.SVGProps<SVGSVGElement> = {
63+
...reset,
64+
...other,
65+
style: { ...reset.other, ...reset.style, ...svgProps.style },
66+
...svgProps,
67+
} as React.SVGProps<SVGSVGElement>;
6368
const isRender = render && typeof render === 'function';
6469
const child =
6570
isRender && render({ ...elmProps, 'data-copied': copied } as React.HTMLAttributes<K>, { value, keyName });

0 commit comments

Comments
 (0)