Skip to content

Commit cf4b28d

Browse files
committed
created a new standard drawer that accepts 2 lists
1 parent cd512a4 commit cf4b28d

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ export { default as BasicAppBar } from './templates/AppBar/BasicAppBar';
88
export { default as TwoRowsAppBar } from './templates/AppBar/TwoRowsAppBar';
99
export { default as BasicFooter } from './templates/Footer/BasicFooter';
1010
export { default as BasicDrawer } from './templates/Drawer/BasicDrawer';
11+
export { default as StandardDrawer } from './templates/Drawer/StandardDrawer';
1112

1213
export default Layout;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
import { withStyles } from 'material-ui/styles';
4+
import Divider from 'material-ui/Divider';
5+
6+
import DrawerItemsList from '../DrawerItemsList';
7+
8+
import styles from './styles';
9+
10+
class StandardDrawer extends React.PureComponent {
11+
static propTypes = {
12+
secondList: PropTypes.arrayOf(PropTypes.shape({})),
13+
firstList: PropTypes.arrayOf(PropTypes.shape({})),
14+
classes: PropTypes.shape({}),
15+
};
16+
17+
static defaultProps = {
18+
firstList: null,
19+
secondList: null,
20+
};
21+
render() {
22+
const { firstList, secondList, classes } = this.props;
23+
return (
24+
<div className={classes.wrapper}>
25+
{firstList ? <DrawerItemsList items={firstList} /> : null}
26+
{firstList && secondList ? <Divider /> : null}
27+
{secondList ? <DrawerItemsList items={secondList} /> : null}
28+
</div>
29+
);
30+
}
31+
}
32+
33+
export default withStyles(styles)(StandardDrawer);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import StandardDrawer from './StandardDrawer';
2+
3+
export default StandardDrawer;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
wrapper: {
3+
width: '100%',
4+
},
5+
};

0 commit comments

Comments
 (0)