forked from elastic/search-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Layout.js
51 lines (47 loc) · 1.33 KB
/
Layout.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
import PropTypes from "prop-types";
import React from "react";
import LayoutSidebar from "./LayoutSidebar";
import { appendClassName } from "../view-helpers";
function Layout({
className,
children,
header,
bodyContent,
bodyFooter,
bodyHeader,
sideContent
}) {
return (
<div className={appendClassName("sui-layout", className)}>
<div className="sui-layout-header">
<div className="sui-layout-header__inner">{header}</div>
</div>
<div className="sui-layout-body">
<div className="sui-layout-body__inner">
<LayoutSidebar className="sui-layout-sidebar">
{sideContent}
</LayoutSidebar>
<div className="sui-layout-main">
<div className="sui-layout-main-header">
<div className="sui-layout-main-header__inner">{bodyHeader}</div>
</div>
<div className="sui-layout-main-body">
{children || bodyContent}
</div>
<div className="sui-layout-main-footer">{bodyFooter}</div>
</div>
</div>
</div>
</div>
);
}
Layout.propTypes = {
className: PropTypes.string,
children: PropTypes.node,
header: PropTypes.node,
bodyContent: PropTypes.node,
bodyFooter: PropTypes.node,
bodyHeader: PropTypes.node,
sideContent: PropTypes.node
};
export default Layout;