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
NODE_PATH=src/
NODE_PATH=./src/

View File

@ -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",

View File

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

View File

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

View File

@ -16,7 +16,7 @@ export const FormBlock = ({
: <Input id={props.name} name={props.name} type={type} {...props} />;
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>
<Label for={props.name}>{label}</Label>
{formElement}

View File

@ -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 (
<Row className="full-height">
<Col sm={12} md={8} lg={4} className="abs-center">
<Form onChange={ linkEvent(this, this.handleFormChange) }>
<Form onKeyDown={ linkEvent(this, this.handleFormChange) }>
<Card>
<CardHeader>
<CardTitle>Add a Film</CardTitle>
@ -45,11 +53,13 @@ export class FilmAddView extends Component {
label="Brand"
name="brand"
required
value={this.state.form.values['brand']}
/>
<FormBlock
label="Film Name"
name="film-name"
required
value={this.state.form.values['film-name']}
/>
<FormBlock
label="Film Speed (ISO)"
@ -57,15 +67,18 @@ export class FilmAddView extends Component {
name="film-speed-asa"
required
type="number"
value={this.state.form.values['film-speed-asa']}
/>
<FormBlock
label="Film Speed (DIN)"
name="film-speed-din"
type="number"
value={this.state.form.values['film-speed-din']}
/>
<FormBlock
label="Film Format"
name="film-format"
value={this.state.form.values['film-format']}
>
<select className="custom-select" id="film-format" name="film-format">
<option value="110">110</option>
@ -87,6 +100,6 @@ export class FilmAddView extends Component {
</Form>
</Col>
</Row>
)
);
}
}

View File

@ -4145,11 +4145,15 @@ inferno-shared@5.0.3, inferno-shared@^5.0.1:
version "5.0.3"
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"
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"
resolved "https://registry.npmjs.org/inferno/-/inferno-5.0.3.tgz#7349411364b238b3a3186b697b241c12f7d37f34"
dependencies:
@ -4157,6 +4161,14 @@ inferno@5.0.3, inferno@^5.0.1:
inferno-vnode-flags "5.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:
version "1.0.6"
resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"