Skip to content

Commit 483ce8a

Browse files
author
micrum
committed
upgrade material-ui to version 0.15.0, upgrade react to 15.0.2 version
1 parent e33b7c8 commit 483ce8a

File tree

5 files changed

+50
-44
lines changed

5 files changed

+50
-44
lines changed

Diff for: LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 LambdaCDM
3+
Copyright (c) 2016 Lambda-CDM
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Diff for: package.json

+14-18
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.3.0",
44
"description": "Material design admin dashboard powered with React",
55
"main": "",
6+
"license": "MIT",
67
"scripts": {
78
"clean": "rimraf dist/*",
89
"copy": "copyfiles -f ./src/index.html ./src/favicon.ico ./dist",
@@ -24,7 +25,7 @@
2425
},
2526
"repository": {
2627
"type": "git",
27-
"url": "https://github.com/lambdacdm/react-material-dashboard"
28+
"url": "https://github.com/lambda-cdm/react-material-dashboard"
2829
},
2930
"keywords": [
3031
"react",
@@ -34,56 +35,51 @@
3435
"dashboard"
3536
],
3637
"author": "micrum",
37-
"devDependencies": {
38+
"dependencies": {
3839
"babel-core": "^6.0.0",
39-
"babel-eslint": "^5.0.0",
40+
"babel-eslint": "^6.0.4",
4041
"babel-loader": "^6.0.0",
4142
"babel-polyfill": "^6.3.14",
4243
"babel-preset-es2015": "^6.0.15",
4344
"babel-preset-react": "^6.0.15",
4445
"bower-webpack-plugin": "^0.1.9",
4546
"chai": "^3.2.0",
4647
"copyfiles": "^0.2.1",
48+
"core-js": "^2.4.0",
4749
"css-loader": "^0.23.0",
4850
"eslint": "^2.0.0",
4951
"eslint-loader": "^1.0.0",
50-
"eslint-plugin-react": "^4.0.0",
52+
"eslint-plugin-react": "^5.1.1",
5153
"file-loader": "^0.8.4",
5254
"gh-pages-deploy": "^0.4.0",
5355
"glob": "^7.0.0",
56+
"history": "^2.1.1",
5457
"isparta-instrumenter-loader": "^1.0.0",
5558
"karma": "^0.13.9",
5659
"karma-chai": "^0.1.0",
57-
"karma-coverage": "^0.5.3",
58-
"karma-mocha": "^0.2.0",
59-
"karma-mocha-reporter": "^1.1.1",
6060
"karma-phantomjs-launcher": "^1.0.0",
6161
"karma-sourcemap-loader": "^0.3.5",
6262
"karma-webpack": "^1.7.0",
63+
"material-ui": "^0.15.0",
6364
"minimist": "^1.2.0",
6465
"mocha": "^2.2.5",
6566
"node-sass": "^3.4.2",
67+
"normalize.css": "^4.1.1",
6668
"null-loader": "^0.1.1",
6769
"open": "0.0.5",
6870
"phantomjs-prebuilt": "^2.0.0",
6971
"postcss": "^5.0.11",
70-
"postcss-loader": "^0.8.0",
71-
"react-addons-test-utils": "^0.14.0",
72+
"postcss-loader": "^0.9.1",
73+
"react": "^15.0.2",
74+
"react-dom": "^15.0.2",
7275
"react-hot-loader": "^1.2.9",
76+
"react-router": "^2.4.0",
77+
"react-tap-event-plugin": "^1.0.0",
7378
"rimraf": "^2.4.3",
7479
"sass-loader": "^3.1.2",
7580
"style-loader": "^0.13.0",
7681
"url-loader": "^0.5.6",
7782
"webpack": "^1.12.0",
7883
"webpack-dev-server": "^1.12.0"
79-
},
80-
"dependencies": {
81-
"core-js": "^2.0.0",
82-
"material-ui": "^0.15.0-alpha.2",
83-
"normalize.css": "^3.0.3",
84-
"react": "^0.14.0",
85-
"react-dom": "^0.14.0",
86-
"react-router": "^2.0.1",
87-
"react-tap-event-plugin": "^0.2.2"
8884
}
8985
}

Diff for: src/components/FullWidthSection.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
2-
import ClearFix from 'material-ui/lib/clearfix';
3-
import spacing from 'material-ui/lib/styles/spacing';
4-
import styleResizable from 'material-ui/lib/mixins/style-resizable';
2+
import ClearFix from 'material-ui/internal/ClearFix';
3+
import spacing from 'material-ui/styles/spacing';
54
const desktopGutter = spacing.desktopGutter;
65

76
const FullWidthSection = React.createClass({
@@ -14,10 +13,6 @@ const FullWidthSection = React.createClass({
1413
useContent: React.PropTypes.bool
1514
},
1615

17-
mixins: [
18-
styleResizable
19-
],
20-
2116
getDefaultProps() {
2217
return {
2318
useContent: false,

Diff for: src/components/Layout.js

+23-6
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ require('normalize.css');
22
require('styles/App.scss');
33

44
import React from 'react';
5-
import AppBar from 'material-ui/lib/app-bar';
6-
import LeftNav from 'material-ui/lib/left-nav';
7-
import MenuItem from 'material-ui/lib/menus/menu-item';
5+
import AppBar from 'material-ui/AppBar';
6+
import Drawer from 'material-ui/Drawer';
7+
import MenuItem from 'material-ui/MenuItem';
88
import { Link } from 'react-router';
9-
import IconButton from 'material-ui/lib/icon-button';
9+
import IconButton from 'material-ui/IconButton';
10+
import getMuiTheme from 'material-ui/styles/getMuiTheme';
1011

1112
const githubButton = (
1213
<IconButton
@@ -24,6 +25,18 @@ class Layout extends React.Component {
2425
this.toggleNavigation = this.toggleNavigation.bind(this);
2526
}
2627

28+
getChildContext() {
29+
return {
30+
muiTheme: this.state.muiTheme
31+
};
32+
}
33+
34+
componentWillMount() {
35+
this.setState({
36+
muiTheme: getMuiTheme()
37+
});
38+
}
39+
2740
toggleNavigation() {
2841
this.setState({open: !this.state.open});
2942
}
@@ -40,7 +53,7 @@ class Layout extends React.Component {
4053
onLeftIconButtonTouchTap={this.toggleNavigation}
4154
iconElementRight={githubButton}
4255
/>
43-
<LeftNav
56+
<Drawer
4457
open={this.state.open}
4558
docked={false}
4659
onRequestChange={(open) => this.setState({open})}
@@ -56,7 +69,7 @@ class Layout extends React.Component {
5669
<Link to="/table" onTouchTap={this.toggleNavigation} className="nav-link">
5770
<MenuItem>Table</MenuItem>
5871
</Link>
59-
</LeftNav>
72+
</Drawer>
6073
<div className="page-content">
6174
{this.props.children}
6275
</div>
@@ -65,4 +78,8 @@ class Layout extends React.Component {
6578
}
6679
}
6780

81+
Layout.childContextTypes = {
82+
muiTheme: React.PropTypes.object.isRequired
83+
};
84+
6885
export default Layout;

Diff for: src/components/Widget.js

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
import React from 'react';
2-
import styleResizable from 'material-ui/lib/mixins/style-resizable';
3-
import spacing from 'material-ui/lib/styles/spacing';
4-
import transitions from 'material-ui/lib/styles/transitions';
5-
import typography from 'material-ui/lib/styles/typography';
6-
import {grey400} from 'material-ui/lib/styles/colors';
7-
import Paper from 'material-ui/lib/paper';
2+
import spacing from 'material-ui/styles/spacing';
3+
import transitions from 'material-ui/styles/transitions';
4+
import typography from 'material-ui/styles/typography';
5+
import { grey400 } from 'material-ui/styles/colors';
6+
import Paper from 'material-ui/Paper';
7+
import withWidth, { MEDIUM, LARGE } from 'material-ui/utils/withWidth'
88

99
const Widget = React.createClass({
1010

1111
propTypes: {
1212
firstChild: React.PropTypes.bool,
1313
heading: React.PropTypes.string,
1414
lastChild: React.PropTypes.bool,
15-
content: React.PropTypes.node
15+
content: React.PropTypes.node,
16+
width: React.PropTypes.number.isRequired
1617
},
1718

18-
mixins: [styleResizable],
19-
2019
getDefaultProps() {
2120
return {
2221
firstChild: false,
@@ -73,8 +72,7 @@ const Widget = React.createClass({
7372
}
7473
};
7574

76-
if (this.isDeviceSize(styleResizable.statics.Sizes.MEDIUM) ||
77-
this.isDeviceSize(styleResizable.statics.Sizes.LARGE)) {
75+
if (this.props.width === MEDIUM || this.props.width === LARGE) {
7876
styles.root = Object.assign(
7977
styles.root,
8078
styles.rootWhenMedium,
@@ -119,4 +117,4 @@ const Widget = React.createClass({
119117

120118
});
121119

122-
export default Widget;
120+
export default withWidth()(Widget);

0 commit comments

Comments
 (0)