forked from stac-labs/Spoke
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmpty.jsx
61 lines (55 loc) · 1.29 KB
/
Empty.jsx
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
54
55
56
57
58
59
60
61
import PropTypes from "prop-types";
import React from "react";
import { StyleSheet, css } from "aphrodite";
import theme from "../styles/theme";
import { dataTest } from "../lib/attributes";
const inlineStyles = {
icon: {
width: 180,
height: 180,
opacity: 0.2
}
};
// removing pencil image for mobile widths smaller than 450px
const styles = StyleSheet.create({
container: {
marginTop: "10px",
width: 180,
marginLeft: "auto",
marginRight: "auto"
},
hideMobile: {
marginTop: "10px",
width: 180,
marginLeft: "auto",
marginRight: "auto",
"@media(max-width: 450px)": {
display: "none"
}
},
title: {
...theme.text.header,
textAlign: "center"
},
content: {
marginTop: "15px",
textAlign: "center"
}
});
const Empty = ({ title, icon, content, hideMobile }) => (
<div
className={hideMobile ? css(styles.hideMobile) : css(styles.container)}
{...dataTest("empty")}
>
{React.cloneElement(icon, { style: inlineStyles.icon })}
<div className={css(styles.title)}>{title}</div>
{content ? <div className={css(styles.content)}>{content}</div> : ""}
</div>
);
Empty.propTypes = {
title: PropTypes.string,
icon: PropTypes.object,
content: PropTypes.object,
hideMobile: PropTypes.bool
};
export default Empty;