Skip to content

Commit

Permalink
feat: add more props
Browse files Browse the repository at this point in the history
  • Loading branch information
awran5 committed Oct 3, 2022
1 parent 66a1c79 commit e475a1a
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions src/Components/StarIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
import React from 'react'

interface StarIconProps {
export interface StarIconProps {
/** Icon width / height in `px` */
size?: number
strokeColor?: string
storkeWidth?: number
className?: string
style?: React.CSSProperties
SVGstrokeColor?: string
SVGstorkeWidth?: string | number
SVGclassName?: string
SVGstyle?: React.CSSProperties
}

export function StarIcon({
size = 25,
strokeColor = 'none',
storkeWidth = 0,
className = 'star-svg',
style = { display: 'inline' }
SVGstrokeColor = 'currentColor',
SVGstorkeWidth = 0,
SVGclassName = 'star-svg',
SVGstyle
}: StarIconProps) {
return (
<svg fill='currentColor' width={size} height={size} viewBox='0 0 24 24' className={className} style={{ ...style }}>
<path
fill='currentColor'
stroke={strokeColor}
strokeMiterlimit='10'
strokeWidth={storkeWidth}
d='M12,17.27L18.18,21l-1.64-7.03L22,9.24l-7.19-0.61L12,2L9.19,8.63L2,9.24l5.46,4.73L5.82,21L12,17.27z'
/>
<svg
className={SVGclassName}
style={SVGstyle}
stroke={SVGstrokeColor}
fill='currentColor'
strokeWidth={SVGstorkeWidth}
viewBox='0 0 24 24'
width={size}
height={size}
xmlns='http://www.w3.org/2000/svg'
>
<path d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'></path>
</svg>
)
}

0 comments on commit e475a1a

Please sign in to comment.