Merge master

This commit is contained in:
Timothy Warren 2018-04-10 16:29:25 -04:00
commit b24d80234f
8 changed files with 43 additions and 18 deletions

2
.env
View File

@ -1,2 +1,2 @@
BROWSER=none BROWSER=none
NODE_PATH=src/ NODE_PATH=./src/

View File

@ -29,10 +29,10 @@
"eject": "inferno-scripts eject", "eject": "inferno-scripts eject",
"electron-start": "node src/electron/wait-inferno", "electron-start": "node src/electron/wait-inferno",
"electron": "electron .", "electron": "electron .",
"fix": "eslint --fix src/**/*.js", "fix": "set NODE_DIR=src/ eslint --fix src/**/*.js",
"lint": "eslint src/**/*.js", "lint": "set NODE_DIR=src/ eslint src/**/*.js",
"pack": "build --dir", "pack": "build --dir",
"postinstall": "electron-builder install-app-deps", "postinstall": "set NODE_DIR=src/ electron-builder install-app-deps",
"precommit": "yarn lint", "precommit": "yarn lint",
"react-start": "inferno-scripts start", "react-start": "inferno-scripts start",
"start": "nf start -p 3000", "start": "nf start -p 3000",

View File

@ -4,7 +4,7 @@ import * as V from './views';
export const Routes = (props) => ( export const Routes = (props) => (
<Switch> <Switch>
<Route exact path='/' component={V.HomeView} /> <Route exact path="/" component={V.HomeView} />
<Route path="/camera" component={V.CameraListView} /> <Route path="/camera" component={V.CameraListView} />
<Route path="/film" component={V.FilmAddView} /> <Route path="/film" component={V.FilmAddView} />
<Route component={V.OopsView} /> <Route component={V.OopsView} />

View File

@ -28,8 +28,8 @@ import Tooltip from 'inferno-bootstrap/dist/Tooltip';
export const BSWrapper = (Component, tagName) => { export const BSWrapper = (Component, tagName) => {
return ({children, ...props}) => ( return ({children, ...props}) => (
<Component tag={tagName} {...props}>{children}</Component> <Component tag={tagName} {...props}>{children}</Component>
) );
} };
export const Alert = BSWrapper(BSAlert, 'bs-alert'); export const Alert = BSWrapper(BSAlert, 'bs-alert');
export const Jumbotron = BSWrapper(BSJumbotron, 'bs-jumbotron'); export const Jumbotron = BSWrapper(BSJumbotron, 'bs-jumbotron');

View File

@ -2,7 +2,7 @@ import BSCol from 'inferno-bootstrap/dist/Col';
import BSContainer from 'inferno-bootstrap/dist/Container'; import BSContainer from 'inferno-bootstrap/dist/Container';
import BSRow from 'inferno-bootstrap/dist/Row'; import BSRow from 'inferno-bootstrap/dist/Row';
import { BSWrapper } from './Bootstrap' import { BSWrapper } from './Bootstrap';
export const Col = BSWrapper(BSCol, 'bs-col'); export const Col = BSWrapper(BSCol, 'bs-col');
export const Container = BSWrapper(BSContainer, 'bs-container'); export const Container = BSWrapper(BSContainer, 'bs-container');

View File

@ -16,7 +16,7 @@ export const FormBlock = ({
: <Input id={props.name} name={props.name} type={type} {...props} />; : <Input id={props.name} name={props.name} type={type} {...props} />;
return ( return (
<Col xs={12} sm={6} md={3} className="d-flex align-items-baseline justify-content-around"> <Col xs={12} md={6} xl={4} className="d-flex align-items-baseline justify-content-around">
<FormGroup> <FormGroup>
<Label for={props.name}>{label}</Label> <Label for={props.name}>{label}</Label>
{formElement} {formElement}

View File

@ -10,7 +10,7 @@ import {
Col, Col,
Form, Form,
Row, Row,
} from 'components/Bootstrap' } from 'components/Bootstrap';
import { FormBlock } from 'components/Form'; import { FormBlock } from 'components/Form';
@ -22,19 +22,27 @@ export class FilmAddView extends Component {
form: { form: {
valid: {}, valid: {},
values: {}, values: {},
} },
}; };
} }
handleFormChange (e) { handleFormChange (instance, e) {
console.log(e); instance.setState({
form: {
...instance.state.form,
values: {
...instance.state.form.values,
[e.target.id]: e.target.value,
},
},
});
} }
render () { render () {
return ( return (
<Row className="full-height"> <Row className="full-height">
<Col sm={12} md={8} lg={4} className="abs-center"> <Col sm={12} md={8} lg={4} className="abs-center">
<Form onChange={ linkEvent(this, this.handleFormChange) }> <Form onKeyDown={ linkEvent(this, this.handleFormChange) }>
<Card> <Card>
<CardHeader> <CardHeader>
<CardTitle>Add a Film</CardTitle> <CardTitle>Add a Film</CardTitle>
@ -45,11 +53,13 @@ export class FilmAddView extends Component {
label="Brand" label="Brand"
name="brand" name="brand"
required required
value={this.state.form.values['brand']}
/> />
<FormBlock <FormBlock
label="Film Name" label="Film Name"
name="film-name" name="film-name"
required required
value={this.state.form.values['film-name']}
/> />
<FormBlock <FormBlock
label="Film Speed (ISO)" label="Film Speed (ISO)"
@ -57,15 +67,18 @@ export class FilmAddView extends Component {
name="film-speed-asa" name="film-speed-asa"
required required
type="number" type="number"
value={this.state.form.values['film-speed-asa']}
/> />
<FormBlock <FormBlock
label="Film Speed (DIN)" label="Film Speed (DIN)"
name="film-speed-din" name="film-speed-din"
type="number" type="number"
value={this.state.form.values['film-speed-din']}
/> />
<FormBlock <FormBlock
label="Film Format" label="Film Format"
name="film-format" name="film-format"
value={this.state.form.values['film-format']}
> >
<select className="custom-select" id="film-format" name="film-format"> <select className="custom-select" id="film-format" name="film-format">
<option value="110">110</option> <option value="110">110</option>
@ -87,6 +100,6 @@ export class FilmAddView extends Component {
</Form> </Form>
</Col> </Col>
</Row> </Row>
) );
} }
} }

View File

@ -4145,11 +4145,15 @@ inferno-shared@5.0.3, inferno-shared@^5.0.1:
version "5.0.3" version "5.0.3"
resolved "https://registry.npmjs.org/inferno-shared/-/inferno-shared-5.0.3.tgz#dc9d437e1fb783c7669135d81027d5cc972a5d9b" resolved "https://registry.npmjs.org/inferno-shared/-/inferno-shared-5.0.3.tgz#dc9d437e1fb783c7669135d81027d5cc972a5d9b"
inferno-vnode-flags@5.0.3, inferno-vnode-flags@^5.0.1: inferno-vnode-flags@5.0.3:
version "5.0.3" version "5.0.3"
resolved "https://registry.npmjs.org/inferno-vnode-flags/-/inferno-vnode-flags-5.0.3.tgz#87145797e54b32bb4e18461de1cb0eb34117a765" resolved "https://registry.npmjs.org/inferno-vnode-flags/-/inferno-vnode-flags-5.0.3.tgz#87145797e54b32bb4e18461de1cb0eb34117a765"
inferno@5.0.3, inferno@^5.0.1: inferno-vnode-flags@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/inferno-vnode-flags/-/inferno-vnode-flags-5.0.1.tgz#fbb377070ee9d2bd93978a6faa58cae15dd746b0"
inferno@5.0.3:
version "5.0.3" version "5.0.3"
resolved "https://registry.npmjs.org/inferno/-/inferno-5.0.3.tgz#7349411364b238b3a3186b697b241c12f7d37f34" resolved "https://registry.npmjs.org/inferno/-/inferno-5.0.3.tgz#7349411364b238b3a3186b697b241c12f7d37f34"
dependencies: dependencies:
@ -4157,6 +4161,14 @@ inferno@5.0.3, inferno@^5.0.1:
inferno-vnode-flags "5.0.3" inferno-vnode-flags "5.0.3"
opencollective "^1.0.3" opencollective "^1.0.3"
inferno@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/inferno/-/inferno-5.0.1.tgz#dee61c256629cce3b263bb2ec7175813a702be08"
dependencies:
inferno-shared "5.0.1"
inferno-vnode-flags "5.0.1"
opencollective "^1.0.3"
inflight@^1.0.4: inflight@^1.0.4:
version "1.0.6" version "1.0.6"
resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"