diff --git a/.env b/.env index 2dc03e4..7d1519f 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ BROWSER=none -NODE_PATH=src/ +NODE_PATH=./src/ diff --git a/package.json b/package.json index 4fd1ba1..99c330c 100644 --- a/package.json +++ b/package.json @@ -29,10 +29,10 @@ "eject": "inferno-scripts eject", "electron-start": "node src/electron/wait-inferno", "electron": "electron .", - "fix": "eslint --fix src/**/*.js", - "lint": "eslint src/**/*.js", + "fix": "set NODE_DIR=src/ eslint --fix src/**/*.js", + "lint": "set NODE_DIR=src/ eslint src/**/*.js", "pack": "build --dir", - "postinstall": "electron-builder install-app-deps", + "postinstall": "set NODE_DIR=src/ electron-builder install-app-deps", "precommit": "yarn lint", "react-start": "inferno-scripts start", "start": "nf start -p 3000", diff --git a/src/Routes.js b/src/Routes.js index 619a47d..026f40f 100644 --- a/src/Routes.js +++ b/src/Routes.js @@ -4,7 +4,7 @@ import * as V from './views'; export const Routes = (props) => ( - + diff --git a/src/components/Bootstrap/Bootstrap.js b/src/components/Bootstrap/Bootstrap.js index 3f47325..da8543a 100644 --- a/src/components/Bootstrap/Bootstrap.js +++ b/src/components/Bootstrap/Bootstrap.js @@ -28,8 +28,8 @@ import Tooltip from 'inferno-bootstrap/dist/Tooltip'; export const BSWrapper = (Component, tagName) => { return ({children, ...props}) => ( {children} - ) -} + ); +}; export const Alert = BSWrapper(BSAlert, 'bs-alert'); export const Jumbotron = BSWrapper(BSJumbotron, 'bs-jumbotron'); diff --git a/src/components/Bootstrap/Grid.js b/src/components/Bootstrap/Grid.js index b3c18d3..f889b6e 100644 --- a/src/components/Bootstrap/Grid.js +++ b/src/components/Bootstrap/Grid.js @@ -2,7 +2,7 @@ import BSCol from 'inferno-bootstrap/dist/Col'; import BSContainer from 'inferno-bootstrap/dist/Container'; import BSRow from 'inferno-bootstrap/dist/Row'; -import { BSWrapper } from './Bootstrap' +import { BSWrapper } from './Bootstrap'; export const Col = BSWrapper(BSCol, 'bs-col'); export const Container = BSWrapper(BSContainer, 'bs-container'); diff --git a/src/components/Form/FormBlock.js b/src/components/Form/FormBlock.js index 28762c6..583ef48 100644 --- a/src/components/Form/FormBlock.js +++ b/src/components/Form/FormBlock.js @@ -16,7 +16,7 @@ export const FormBlock = ({ : ; return ( - + {formElement} diff --git a/src/views/Film/FilmAddView.js b/src/views/Film/FilmAddView.js index 3a4ce62..69d9027 100644 --- a/src/views/Film/FilmAddView.js +++ b/src/views/Film/FilmAddView.js @@ -10,31 +10,39 @@ import { Col, Form, Row, -} from 'components/Bootstrap' +} from 'components/Bootstrap'; import { FormBlock } from 'components/Form'; export class FilmAddView extends Component { constructor (props) { - super (props); + super(props); this.state = { form: { valid: {}, values: {}, - } + }, }; } - handleFormChange (e) { - console.log(e); + handleFormChange (instance, e) { + instance.setState({ + form: { + ...instance.state.form, + values: { + ...instance.state.form.values, + [e.target.id]: e.target.value, + }, + }, + }); } render () { return ( -
+ Add a Film @@ -45,11 +53,13 @@ export class FilmAddView extends Component { label="Brand" name="brand" required + value={this.state.form.values['brand']} />