Remove CRA stuff, revert to custom webpack config

This commit is contained in:
MICHAEL JACKSON
2017-12-14 08:21:45 -08:00
parent 9c042e6368
commit f2daafadfb
28 changed files with 2097 additions and 2490 deletions

4
client/.babelrc Normal file
View File

@ -0,0 +1,4 @@
{
"presets": ["env", "react", "stage-2"],
"plugins": []
}

14
client/.eslintrc Normal file
View File

@ -0,0 +1,14 @@
{
"parser": "babel-eslint",
"env": {
"browser": true
},
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:react/recommended"
],
"rules": {
"react/no-children-prop": 0
}
}

View File

@ -1,44 +0,0 @@
import React from "react"
import PropTypes from "prop-types"
import { parseNumber, formatNumber } from "./NumberUtils"
class NumberTextInput extends React.Component {
static propTypes = {
value: PropTypes.number,
parseNumber: PropTypes.func,
formatNumber: PropTypes.func,
onChange: PropTypes.func
}
static defaultProps = {
value: 0,
parseNumber,
formatNumber
}
state = {
value: null
}
componentWillMount() {
this.setState({ value: this.props.value })
}
handleChange = event => {
const value = this.props.parseNumber(event.target.value)
this.setState({ value }, () => {
if (this.props.onChange) this.props.onChange(value)
})
}
render() {
const { value } = this.state
const { parseNumber, formatNumber, ...props } = this.props // eslint-disable-line no-unused-vars
const displayValue = formatNumber(value)
return <input {...props} type="text" value={displayValue} onChange={this.handleChange} />
}
}
export default NumberTextInput

10
client/index.html Normal file
View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<div id="app"></div>
</body>
</html>

View File

@ -3,4 +3,4 @@ import ReactDOM from "react-dom"
import App from "./App"
import "./index.css"
ReactDOM.render(<App />, document.getElementById("root"))
ReactDOM.render(<App />, document.getElementById("app"))