-
Notifications
You must be signed in to change notification settings - Fork 63
/
WeatherIcon.js
43 lines (38 loc) · 902 Bytes
/
WeatherIcon.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
import React from 'react';
import { createUseStyles } from 'react-jss';
import PropTypes from 'prop-types';
const useStyles = createUseStyles({
svg: {
fill: ({ color }) => color,
},
});
// eslint-disable-next-line no-unused-vars
const WeatherIcon = ({ title, path, size, viewBox, color }) => {
const classes = useStyles({ color });
return (
<svg
version="1.1"
xmlns="http://www.w3.org/2000/svg"
width={size}
height={size}
viewBox={viewBox}
className={classes.svg}
>
<title>{title}</title>
<path d={path} />
</svg>
);
};
WeatherIcon.propTypes = {
path: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
viewBox: PropTypes.string,
color: PropTypes.string,
size: PropTypes.number,
};
WeatherIcon.defaultProps = {
color: '#4BC4F7',
size: 40,
viewBox: '0 -5 35 40',
};
export default WeatherIcon;