-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathGrid.js
More file actions
62 lines (61 loc) · 1.51 KB
/
Copy pathGrid.js
File metadata and controls
62 lines (61 loc) · 1.51 KB
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
62
import React, { forwardRef } from "react";
export const Grid = forwardRef(
(
{ container, item, xs, alignContent, justifyContent, children, style, id },
ref
) => {
if (container && !item) {
return (
<table
style={{
width: "100%",
...style,
tableLayout: "fixed",
borderSpacing: "0",
}}
cellSpacing="0"
>
<tbody align={justifyContent} style={{ width: "100%" }}>
{children}
</tbody>
</table>
);
} else {
return (
<tr>
<td style={{ padding: 0 }}>
<div style={{ ...style }}>
<div
id={id}
style={{
...(id !== "Main"
? {
width: `${(100 / 12) * xs}%`,
///border: "2px solid black",
// overflowWrap: "break-word"
}
: {
width: "100%",
maxWidth: 738,
minWidth: 320 - style.paddingLeft - style.paddingRight,
}),
}}
className={id === "Main" ? "mainClass" : null}
>
{children}
</div>
</div>
</td>
</tr>
);
}
}
);
Grid.defaultProps = {
alignContent: "center",
justifyContent: "left",
item: false,
container: false,
xs: 12,
style: {},
};