mirror of
https://github.com/fspc/workstand.git
synced 2025-02-23 09:13:23 -05:00
Clean up.
This commit is contained in:
parent
e5dd313fbe
commit
1f6202be56
@ -1,8 +1,8 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import Checkbox from 'material-ui/Checkbox';
|
||||
import Cookies from 'js-cookie';
|
||||
import FlatButton from 'material-ui/FlatButton';
|
||||
import RaisedButton from 'material-ui/RaisedButton';
|
||||
import React from 'react';
|
||||
import TextField from 'material-ui/TextField';
|
||||
import fetch from 'isomorphic-fetch';
|
||||
import moment from 'moment-timezone';
|
||||
@ -22,6 +22,10 @@ const styles = {
|
||||
};
|
||||
|
||||
class BikeForm extends React.Component {
|
||||
static propTypes = {
|
||||
bike: PropTypes.object,
|
||||
editing: PropTypes.bool,
|
||||
}
|
||||
constructor({ bike, editing = false }) {
|
||||
super();
|
||||
if (editing) {
|
||||
@ -117,7 +121,7 @@ class BikeForm extends React.Component {
|
||||
name="make"
|
||||
floatingLabelText="Make"
|
||||
hintText="Norco"
|
||||
value={this.state.bike.make}
|
||||
value={this.state.bike.make || undefined}
|
||||
onChange={this.handleChange}
|
||||
fullWidth
|
||||
required
|
||||
@ -128,7 +132,7 @@ class BikeForm extends React.Component {
|
||||
name="price"
|
||||
floatingLabelText="Price"
|
||||
hintText="35.60"
|
||||
value={this.state.bike.price}
|
||||
value={this.state.bike.price || undefined}
|
||||
onChange={this.handleChange}
|
||||
fullWidth
|
||||
/>
|
||||
@ -138,7 +142,7 @@ class BikeForm extends React.Component {
|
||||
name="colour"
|
||||
floatingLabelText="Colour"
|
||||
hintText="orange"
|
||||
value={this.state.bike.colour}
|
||||
value={this.state.bike.colour || undefined}
|
||||
onChange={this.handleChange}
|
||||
fullWidth
|
||||
required
|
||||
@ -157,7 +161,7 @@ class BikeForm extends React.Component {
|
||||
name="serial_number"
|
||||
floatingLabelText="Serial number"
|
||||
hintText="ab90cd23"
|
||||
value={this.state.bike.serial_number}
|
||||
value={this.state.bike.serial_number || undefined}
|
||||
onChange={this.handleChange}
|
||||
fullWidth
|
||||
required
|
||||
@ -188,10 +192,10 @@ class BikeForm extends React.Component {
|
||||
<div className="mdl-cell mdl-cell--6-col">
|
||||
<TextField
|
||||
floatingLabelText="Claimed by"
|
||||
value={claimed_by}
|
||||
value={claimed_by || undefined}
|
||||
fullWidth
|
||||
disabled
|
||||
readonly
|
||||
readOnly
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -9,6 +9,7 @@ import BikeForm from '../BikeForm';
|
||||
export default class BikeModal extends React.Component {
|
||||
static propTypes = {
|
||||
open: PropTypes.bool,
|
||||
bike: PropTypes.object,
|
||||
editing: PropTypes.bool,
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,6 @@ export default class BikeTable extends React.Component {
|
||||
.then(parseJSON)
|
||||
.then((data) => {
|
||||
this.setState({ bikes: data });
|
||||
console.log('request succeeded with JSON response', data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('request failed', error);
|
||||
|
@ -48,7 +48,7 @@ const Size = ({ size, onChange }) => {
|
||||
|
||||
Size.propTypes = {
|
||||
size: PropTypes.string,
|
||||
onChange: PropTypes.function,
|
||||
onChange: PropTypes.func,
|
||||
};
|
||||
|
||||
export default Size;
|
||||
|
@ -38,7 +38,7 @@ const Source = ({ source, onChange }) => {
|
||||
|
||||
Source.propTypes = {
|
||||
source: PropTypes.string,
|
||||
onChange: PropTypes.function
|
||||
onChange: PropTypes.func,
|
||||
};
|
||||
|
||||
export default Source;
|
||||
|
Loading…
x
Reference in New Issue
Block a user