Skip to content

Commit 937211d

Browse files
committed
refactored NavBar to AppBar
1 parent e992567 commit 937211d

File tree

6 files changed

+15
-16
lines changed

6 files changed

+15
-16
lines changed

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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ 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
@@ -74,9 +74,9 @@ class Layout extends React.PureComponent {
7474

7575
return (
7676
<div className={classes.layout}>
77-
<NavBar {...appBarProps} onIconClick={this.toggleDrawer}>
77+
<AppBar {...appBarProps} onIconClick={this.toggleDrawer}>
7878
{appBarContent}
79-
</NavBar>
79+
</AppBar>
8080
{drawerContent ? (
8181
<Drawer {...drawerProps} open={drawerOpen} onRequestClose={this.handleDrawerClose}>
8282
{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)