forked from tajo/react-portal
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eslint airbnb ruleset used and applied
- Loading branch information
Showing
12 changed files
with
186 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,25 @@ | ||
var path = require('path'); | ||
var express = require('express'); | ||
var webpack = require('webpack'); | ||
var config = require('./webpack.config.dev'); | ||
import path from 'path'; | ||
import express from 'express'; | ||
import webpack from 'webpack'; | ||
import config from './webpack.config.dev.babel'; | ||
import webpackDev from 'webpack-dev-middleware'; | ||
import webpackHot from 'webpack-hot-middleware'; | ||
|
||
var app = express(); | ||
var compiler = webpack(config); | ||
const app = express(); | ||
const compiler = webpack(config); | ||
|
||
app.use(require('webpack-dev-middleware')(compiler, { | ||
app.use(webpackDev(compiler, { | ||
noInfo: true, | ||
publicPath: config.output.publicPath | ||
publicPath: config.output.publicPath, | ||
})); | ||
|
||
app.use(require('webpack-hot-middleware')(compiler)); | ||
app.use(webpackHot(compiler)); | ||
|
||
app.get('*', function(req, res) { | ||
app.get('*', (req, res) => { | ||
res.sendFile(path.join(__dirname, 'examples/index_dev.html')); | ||
}); | ||
|
||
/*eslint-disable*/ | ||
app.listen(3000, 'localhost', function(err) { | ||
if (err) { | ||
console.log(err); | ||
return; | ||
} | ||
|
||
console.log('Listening at http://localhost:3000'); | ||
app.listen(3000, 'localhost', () => { | ||
console.log('Listening at http://localhost:3000'); // eslint-disable-line | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require('babel-register'); | ||
require('./devServer'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,9 @@ | ||
import React from 'react'; | ||
|
||
export default class LoadingBar extends React.Component { | ||
|
||
render() { | ||
return ( | ||
<div style={{border: '1px solid green', margin: 10, padding: 10}}> | ||
<p>This could be a loading bar...</p> | ||
<p>This portal is <strong>opened by the prop</strong> <i>isOpened</i>.</p> | ||
<p>... when <i>openByClickOn</i> is not enough.</p> | ||
<p>Notice, that by default you cannot close this by ESC or an outside click.</p> | ||
</div> | ||
); | ||
} | ||
|
||
} | ||
|
||
LoadingBar.propTypes = { | ||
children: React.PropTypes.element, | ||
closePortal: React.PropTypes.func | ||
}; | ||
export default () => | ||
<div style={{ border: '1px solid green', margin: 10, padding: 10 }}> | ||
<p>This could be a loading bar...</p> | ||
<p>This portal is <strong>opened by the prop</strong> <i>isOpened</i>.</p> | ||
<p>... when <i>openByClickOn</i> is not enough.</p> | ||
<p>Notice, that by default you cannot close this by ESC or an outside click.</p> | ||
</div>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
import React from 'react'; | ||
|
||
export default class PseudoModal extends React.Component { | ||
|
||
export default class PseudoModal extends React.Component { // eslint-disable-line | ||
render() { | ||
return ( | ||
<div style={{border: '1px solid blue', margin: 10, padding: 10}}> | ||
<div style={{ border: '1px solid blue', margin: 10, padding: 10 }}> | ||
{this.props.children} | ||
<p><button onClick={this.props.closePortal}>Close this</button></p> | ||
</div> | ||
); | ||
} | ||
|
||
} | ||
|
||
PseudoModal.propTypes = { | ||
children: React.PropTypes.oneOfType([ | ||
React.PropTypes.arrayOf(React.PropTypes.element), | ||
React.PropTypes.element | ||
React.PropTypes.element, | ||
]), | ||
closePortal: React.PropTypes.func | ||
closePortal: React.PropTypes.func, | ||
}; |
Oops, something went wrong.