File tree Expand file tree Collapse file tree 3 files changed +15
-15
lines changed
src/stories/Library/Icons/icon-favourite Expand file tree Collapse file tree 3 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 1+ import { ReactComponent as SvgIcon } from "./icon-favourite.svg" ;
2+
13export type IconFavouriteProps = {
24 fill ?: boolean ;
35} ;
46
57export const IconFavourite = ( { fill } : IconFavouriteProps ) => {
6- // This svg is a copy from public/icons/basic/icon-heart.svg.
7- // If you find out it no longer matches the original file, please update it
8- // It is made as inline svg to be able to change fill value from props
98 return (
10- < svg
11- className = "icon-favourite"
12- viewBox = "0 0 24 24"
13- fill = { fill ? "var(--identity-color)" : "none" }
14- stroke = { fill ? "var(--identity-color)" : "black" }
15- xmlns = "http://www.w3.org/2000/svg"
16- >
17- < path
18- d = "M11.5 20L10.2675 18.921C5.89 15.1035 3 12.5858 3 9.49591C3 6.9782 5.057 5 7.675 5C9.154 5 10.5735 5.66213 11.5 6.70845C12.4265 5.66213 13.846 5 15.325 5C17.943 5 20 6.9782 20 9.49591C20 12.5858 17.11 15.1035 12.7325 18.9292L11.5 20Z"
19- strokeWidth = "2"
20- />
21- </ svg >
9+ < SvgIcon
10+ className = {
11+ fill ? "icon-favourite icon-favourite--filled" : "icon-favourite"
12+ }
13+ />
2214 ) ;
2315} ;
Original file line number Diff line number Diff line change 22 cursor : pointer ;
33 height : 24px ;
44 width : 24px ;
5+
6+ & --filled {
7+ color : var (--identity-color );
8+ fill : var (--identity-color );
9+ }
510}
You can’t perform that action at this time.
0 commit comments