-
Notifications
You must be signed in to change notification settings - Fork 295
/
SidebarLayout.tsx
44 lines (40 loc) · 986 Bytes
/
SidebarLayout.tsx
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
// @flow
import React, { Component } from 'react';
import type { Node } from 'react';
import { observer } from 'mobx-react';
import styles from './SidebarLayout.scss';
type Props = {
children: any | Node,
sidebar: Node,
topbar: Node,
notification?: ?Node,
contentDialogs?: ?Array<Node>,
};
@observer
export default class SidebarLayout extends Component<Props> {
static defaultProps = {
children: null,
};
render() {
const {
children,
sidebar,
topbar,
notification,
contentDialogs,
} = this.props;
return (
<div className={styles.component}>
<div className={styles.sidebar}>{sidebar}</div>
<div className={styles.main}>
<div className={styles.topbar}>{topbar}</div>
{notification}
<div className={styles.contentWrapper}>
<div className={styles.content}>{children}</div>
{contentDialogs}
</div>
</div>
</div>
);
}
}