We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 349de14 + e7e3bd9 commit a5a27efCopy full SHA for a5a27ef
src/components/Button.tsx
@@ -41,19 +41,10 @@ export const Button = ({
41
variant = "primary",
42
size = "lg",
43
disabled = false,
44
- startIcon = <SvgShoppingBag />,
45
- endIcon = <SvgArrowRight />,
46
children,
47
...props
48
}: ButtonProps) => {
49
50
- const renderIcon = (icon: React.ReactNode) => {
51
- if (React.isValidElement<{ className?: string }>(icon)) {
52
- return React.cloneElement(icon, { className: `icon--${size}` });
53
- }
54
- return null;
55
- };
56
-
57
return (
58
<button
59
type="button"
@@ -62,9 +53,7 @@ export const Button = ({
62
aria-disabled={disabled}
63
{...props}
64
>
65
- {renderIcon(startIcon)}
66
{children}
67
- {renderIcon(endIcon)}
68
</button>
69
);
70
};
0 commit comments