-
Notifications
You must be signed in to change notification settings - Fork 512
/
Copy pathiconHeader.js
53 lines (48 loc) · 1.43 KB
/
iconHeader.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
48
49
50
51
52
53
import classNames from "classnames";
import styles from "./iconHeader.module.css";
const IconHeader = ({ icon, rotate, title, background, color, compact }) => {
return (
<section className={classNames(styles.Container)}>
{compact ? (
""
) : (
<i
className={classNames(styles.Icon, BG_CLASS[background])}
style={{
transform: `rotate(${rotate}deg)`,
}}
>
{icon}
</i>
)}
<h4 className={classNames(styles.Title, FG_CLASS[background])}>
{title}
</h4>
</section>
);
};
const BG_CLASS = {
"red-70": styles.RedBackground,
"orange-70": styles.OrangeBackground,
"yellow-70": styles.YellowBackground,
"green-70": styles.GreenBackground,
"acqua-70": styles.AcquaBackground,
"lightBlue-70": styles.LightBlueBackground,
"darkBlue-70": styles.DarkBlueBackground,
"indigo-70": styles.IndigoBackground,
"gray-70": styles.GrayBackground,
unset: styles.TransparentBackground,
};
const FG_CLASS = {
"red-70": styles.RedForeground,
"orange-70": styles.OrangeForeground,
"yellow-70": styles.YellowForeground,
"green-70": styles.GreenForeground,
"acqua-70": styles.AcquaForeground,
"lightBlue-70": styles.LightBlueForeground,
"darkBlue-70": styles.DarkBlueForeground,
"indigo-70": styles.IndigoForeground,
"gray-70": styles.GrayForeground,
unset: styles.TransparentForeground,
};
export default IconHeader;