Skip to content

Commit 9c51d8c

Browse files
authored
Merge pull request #12 from Zetoff/develop
ready to publish 0.0.4
2 parents e42c30d + 7dcd187 commit 9c51d8c

File tree

13 files changed

+136
-23
lines changed

13 files changed

+136
-23
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "material-ui-layout",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "Layout components for material-ui",
55
"main": "./lib/index.js",
66
"scripts": {

src/components/NavBar/NavBar.jsx renamed to src/components/AppBar/AppBar.jsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,25 @@
33
import React from 'react';
44
import PropTypes from 'prop-types';
55
import { withStyles } from 'material-ui/styles';
6-
import AppBar from 'material-ui/AppBar';
6+
import DefaultAppBar from 'material-ui/AppBar';
77

88
import styles from './styles';
99

10-
class NavBar extends React.PureComponent {
10+
class AppBar extends React.PureComponent {
1111
static propTypes = {
12-
classes: PropTypes.shape({}),
1312
children: PropTypes.element,
1413
navbarPostion: PropTypes.string,
1514
color: PropTypes.string,
1615
};
1716

1817
render() {
19-
const { children, navbarPostion, classes, color, ...other } = this.props;
18+
const { children, navbarPostion, color, ...other } = this.props;
2019
return (
21-
<AppBar position={navbarPostion} color={color}>
20+
<DefaultAppBar position={navbarPostion} color={color}>
2221
{React.cloneElement(children, { ...other })}
23-
</AppBar>
22+
</DefaultAppBar>
2423
);
2524
}
2625
}
2726

28-
export default withStyles(styles)(NavBar);
27+
export default withStyles(styles)(AppBar);

src/components/AppBar/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import AppBar from './AppBar';
2+
3+
export default AppBar;
File renamed without changes.

src/components/Layout/Layout.jsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,24 @@ import controllable from 'react-controllables';
77

88
import styles from './styles';
99

10-
import NavBar from '../NavBar';
10+
import AppBar from '../AppBar';
1111
import Footer from '../Footer';
1212

1313
// TODO create Layout Library
1414

1515
class Layout extends React.PureComponent {
1616
static propTypes = {
1717
classes: PropTypes.shape({}),
18+
overrideClasses: PropTypes.shape({}),
1819
children: PropTypes.element.isRequired,
1920
navbarPostion: PropTypes.string,
2021
stickyFooter: PropTypes.bool,
2122
footerContent: PropTypes.element,
22-
navBarContent: PropTypes.element,
23+
appBarContent: PropTypes.element,
2324
drawerOpen: PropTypes.bool.isRequired,
2425
onDrawerOpenChange: PropTypes.func,
2526
drawerContent: PropTypes.element,
26-
navBarProps: PropTypes.shape({}),
27+
appBarProps: PropTypes.shape({}),
2728
drawerProps: PropTypes.shape({}),
2829
footerProps: PropTypes.shape({}),
2930
};
@@ -49,19 +50,22 @@ class Layout extends React.PureComponent {
4950

5051
render() {
5152
const {
52-
classes,
53+
classes: defaultClasses,
54+
overrideClasses,
5355
children,
5456
navbarPostion,
5557
stickyFooter,
5658
footerContent,
57-
navBarContent,
59+
appBarContent,
5860
drawerContent,
5961
drawerOpen,
60-
navBarProps,
62+
appBarProps,
6163
drawerProps,
6264
footerProps,
6365
} = this.props;
6466

67+
const classes = { ...defaultClasses, ...overrideClasses };
68+
6569
const mainClassnames = classNames(
6670
classes.main,
6771
{ [`${classes.mainFixedNavbar}`]: navbarPostion === 'fixed' },
@@ -70,9 +74,9 @@ class Layout extends React.PureComponent {
7074

7175
return (
7276
<div className={classes.layout}>
73-
<NavBar {...navBarProps} onIconClick={this.toggleDrawer}>
74-
{navBarContent}
75-
</NavBar>
77+
<AppBar {...appBarProps} onIconClick={this.toggleDrawer}>
78+
{appBarContent}
79+
</AppBar>
7680
{drawerContent ? (
7781
<Drawer {...drawerProps} open={drawerOpen} onRequestClose={this.handleDrawerClose}>
7882
{drawerContent}

src/components/NavBar/index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import Layout from './components/Layout';
22

3-
export { default as AppBar } from './components/NavBar';
3+
export { default as AppBar } from './components/AppBar';
44
export { default as Footer } from './components/Footer';
55

6-
// I am changing the name from NavBar to AppBar
7-
export { default as BasicAppBar } from './templates/NavBar/BasicNavBar';
6+
export { default as BasicAppBar } from './templates/AppBar/BasicNavBar';
7+
export { default as TwoRowsAppBar } from './templates/AppBar/TwoRowsAppBar';
88
export { default as BasicFooter } from './templates/Footer/BasicFooter';
99
export { default as BasicDrawer } from './templates/Drawer/BasicDrawer';
1010

0 commit comments

Comments
 (0)