Skip to content

Commit

Permalink
improve: support style props
Browse files Browse the repository at this point in the history
  • Loading branch information
xpadev-net committed Jun 28, 2023
1 parent 6d14654 commit ddd9fb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/@types/IconProps.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { CSSProperties } from "react";

export type IconProps = {
className?: string;
color?: string;
style?: CSSProperties;
};
4 changes: 2 additions & 2 deletions src/BaseSvg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type props = IconProps & {
children: ReactNode;
};

export const BaseSvg = ({ children, className, color }: props) => {
export const BaseSvg = ({ children, className, color, style }: props) => {
return (
<svg
width="24"
Expand All @@ -15,7 +15,7 @@ export const BaseSvg = ({ children, className, color }: props) => {
fill="none"
xmlns="http://www.w3.org/2000/svg"
className={`${Styles.icon} ${className}`}
style={{ fill: color }}
style={{ ...(style ?? {}), fill: color }}
>
{children}
</svg>
Expand Down

0 comments on commit ddd9fb9

Please sign in to comment.