Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Examples] Upgrade for the new format #3078

Merged
merged 1 commit into from
Jan 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/browserify-gulp-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"babel-preset-react": "^6.3.13",
"babelify": "^7.2.0",
"browser-sync": "^2.11.0",
"browserify": "^12.0.1",
"browserify": "^13.0.0",
"gulp": "^3.8.10",
"gulp-notify": "^2.1.0",
"gulp-util": "^3.0.1",
Expand Down
79 changes: 79 additions & 0 deletions examples/browserify-gulp-example/src/app/Main.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/**
* In this file, we create a React component
* which incorporates components providedby material-ui.
*/

import React from 'react';
import RaisedButton from 'material-ui/lib/raised-button';
import Dialog from 'material-ui/lib/dialog';
import Colors from 'material-ui/lib/styles/colors';
import FlatButton from 'material-ui/lib/flat-button';
import getMuiTheme from 'material-ui/lib/styles/getMuiTheme';
import themeDecorator from 'material-ui/lib/styles/theme-decorator';

const styles = {
container: {
textAlign: 'center',
paddingTop: 200,
},
};

const muiTheme = getMuiTheme({
accent1Color: Colors.deepOrange500,
});

class Main extends React.Component {
constructor(props, context) {
super(props, context);
this.handleRequestClose = this.handleRequestClose.bind(this);
this.handleTouchTap = this.handleTouchTap.bind(this);

this.state = {
open: false,
};
}

handleRequestClose() {
this.setState({
open: false,
});
}

handleTouchTap() {
this.setState({
open: true,
});
}

render() {
const standardActions = (
<FlatButton
label="Okey"
secondary={true}
onTouchTap={this.handleRequestClose}
/>
);

return (
<div style={styles.container}>
<Dialog
open={this.state.open}
title="Super Secret Password"
actions={standardActions}
onRequestClose={this.handleRequestClose}
>
1-2-3-4-5
</Dialog>
<h1>material-ui</h1>
<h2>example project</h2>
<RaisedButton
label="Super Secret Password"
primary={true}
onTouchTap={this.handleTouchTap}
/>
</div>
);
}
}

export default themeDecorator(muiTheme)(Main);
2 changes: 1 addition & 1 deletion examples/browserify-gulp-example/src/app/app.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import injectTapEventPlugin from 'react-tap-event-plugin';
import Main from './components/main'; // Our custom react component
import Main from './Main'; // Our custom react component

//Needed for onTouchTap
//Can go away when react 1.0 release
Expand Down
82 changes: 0 additions & 82 deletions examples/browserify-gulp-example/src/app/components/main.jsx

This file was deleted.

4 changes: 2 additions & 2 deletions examples/webpack-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"eslint": "^1.10.3",
"eslint-loader": "^1.1.1",
"eslint-plugin-react": "^3.13.1",
"html-webpack-plugin": "^1.7.0",
"html-webpack-plugin": "^2.7.2",
"react-hot-loader": "^1.3.0",
"transfer-webpack-plugin": "^0.1.4",
"webpack": "^1.12.9",
Expand All @@ -30,7 +30,7 @@
"dependencies": {
"material-ui": "^0.14.3",
"react": "^0.14.3",
"react-dom":"^0.14.3",
"react-dom": "^0.14.3",
"react-tap-event-plugin": "^0.2.1"
}
}
79 changes: 79 additions & 0 deletions examples/webpack-example/src/app/Main.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/**
* In this file, we create a React component
* which incorporates components providedby material-ui.
*/

import React from 'react';
import RaisedButton from 'material-ui/lib/raised-button';
import Dialog from 'material-ui/lib/dialog';
import Colors from 'material-ui/lib/styles/colors';
import FlatButton from 'material-ui/lib/flat-button';
import getMuiTheme from 'material-ui/lib/styles/getMuiTheme';
import themeDecorator from 'material-ui/lib/styles/theme-decorator';

const styles = {
container: {
textAlign: 'center',
paddingTop: 200,
},
};

const muiTheme = getMuiTheme({
accent1Color: Colors.deepOrange500,
});

class Main extends React.Component {
constructor(props, context) {
super(props, context);
this.handleRequestClose = this.handleRequestClose.bind(this);
this.handleTouchTap = this.handleTouchTap.bind(this);

this.state = {
open: false,
};
}

handleRequestClose() {
this.setState({
open: false,
});
}

handleTouchTap() {
this.setState({
open: true,
});
}

render() {
const standardActions = (
<FlatButton
label="Okey"
secondary={true}
onTouchTap={this.handleRequestClose}
/>
);

return (
<div style={styles.container}>
<Dialog
open={this.state.open}
title="Super Secret Password"
actions={standardActions}
onRequestClose={this.handleRequestClose}
>
1-2-3-4-5
</Dialog>
<h1>material-ui</h1>
<h2>example project</h2>
<RaisedButton
label="Super Secret Password"
primary={true}
onTouchTap={this.handleTouchTap}
/>
</div>
);
}
}

export default themeDecorator(muiTheme)(Main);
2 changes: 1 addition & 1 deletion examples/webpack-example/src/app/app.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import injectTapEventPlugin from 'react-tap-event-plugin';
import Main from './components/main'; // Our custom react component
import Main from './Main'; // Our custom react component

//Needed for onTouchTap
//Can go away when react 1.0 release
Expand Down
83 changes: 0 additions & 83 deletions examples/webpack-example/src/app/components/main.jsx

This file was deleted.