|
| 1 | +/* |
| 2 | + * Copyright (C) 2018-present Arctic Ice Studio <[email protected]> |
| 3 | + * Copyright (C) 2018-present Sven Greb <[email protected]> |
| 4 | + * |
| 5 | + * Project: Nord Docs |
| 6 | + * Repository: https://github.com/arcticicestudio/nord-docs |
| 7 | + * License: MIT |
| 8 | + */ |
| 9 | + |
| 10 | +import React from "react"; |
| 11 | +import styled from "styled-components"; |
| 12 | + |
| 13 | +import { ReactComponent as HeartSVGFill } from "assets/images/icons/eva-icons/heart-fill.svg"; |
| 14 | +import { ReactComponent as HeartSVGOutline } from "assets/images/icons/eva-icons/heart-outline.svg"; |
| 15 | + |
| 16 | +import { iconDefaultProps, iconPropTypes, themeModeFillColorStyles } from "../shared"; |
| 17 | + |
| 18 | +const HeartIconFill = styled(HeartSVGFill)` |
| 19 | + ${themeModeFillColorStyles}; |
| 20 | +`; |
| 21 | + |
| 22 | +const HeartIconOutline = styled(HeartSVGOutline)` |
| 23 | + ${themeModeFillColorStyles}; |
| 24 | +`; |
| 25 | + |
| 26 | +/** |
| 27 | + * The "heart" icon from "Eva Icons" as styled SVG vector graphic component. |
| 28 | + * The "outline" variant can be used by passing the `outlined` boolean prop. |
| 29 | + * By default, it uses the fill color and transition based on the current active global theme mode. |
| 30 | + * |
| 31 | + * @author Arctic Ice Studio <[email protected]> |
| 32 | + * @author Sven Greb <[email protected]> |
| 33 | + * @see https://akveo.github.io/eva-icons |
| 34 | + * @since 0.5.0 |
| 35 | + */ |
| 36 | +const Heart = ({ className, outlined, svgRef }) => |
| 37 | + outlined ? ( |
| 38 | + <HeartIconOutline className={className} svgRef={svgRef} /> |
| 39 | + ) : ( |
| 40 | + <HeartIconFill className={className} svgRef={svgRef} /> |
| 41 | + ); |
| 42 | + |
| 43 | +Heart.propTypes = iconPropTypes; |
| 44 | + |
| 45 | +Heart.defaultProps = iconDefaultProps; |
| 46 | + |
| 47 | +export default Heart; |
0 commit comments