-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIcon.js
47 lines (41 loc) · 968 Bytes
/
Icon.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { h, render, Component } from "preact";
const Icon = props => {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
className={`icon${props.type ? ' icon-' + props.type : '' }`}
>
<use xlinkHref={`#${props.name}`} />
</svg>
)
}
Icon.defaultProps = {
type : 'small'
};
export const SVG = props => {
const {
strokeWidth,
viewBox,
icon,
} = props;
return (
<svg
className="image-gallery-svg"
xmlns="http://www.w3.org/2000/svg"
viewBox={viewBox}
fill="none"
stroke="currentColor"
strokeWidth={strokeWidth}
strokeLinecap="round"
strokeLinejoin="round"
>
{icon}
</svg>
);
};
SVG.defaultProps = {
strokeWidth: 1,
viewBox: '0 0 24 24',
};
export default Icon;