-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNoteIcon.js
More file actions
43 lines (36 loc) · 911 Bytes
/
NoteIcon.js
File metadata and controls
43 lines (36 loc) · 911 Bytes
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 SvgIcon from "@material-ui/core/SvgIcon";
import { css, styled } from "twin.macro";
const SVG = styled(SvgIcon)`
vertical-align: middle;
${props =>
props.color === "grey" &&
css`
color: ${props => props.theme.palette.tertiary.main};
`}
${props =>
props.color === "black" &&
css`
color: black;
`}
${props =>
props.color === "red" &&
css`
color: red;
`}
${props =>
props.primary &&
css`
margin-left: auto;
`}
`;
const NoteIcon = ({ src, color = "inherit", size, htmlColor, isPrimary }) => {
const inputProps = {
component: src,
htmlColor: htmlColor || undefined,
color: htmlColor ? undefined : color
};
// spread declaration to add props
return <SVG primary={isPrimary} component={src} fontSize={size} {...inputProps} />;
};
export default NoteIcon;