|
@ -1,8 +1,8 @@ |
|
|
|
|
|
import React, { PropTypes } from 'react'; |
|
|
import Checkbox from 'material-ui/Checkbox'; |
|
|
import Checkbox from 'material-ui/Checkbox'; |
|
|
import Cookies from 'js-cookie'; |
|
|
import Cookies from 'js-cookie'; |
|
|
import FlatButton from 'material-ui/FlatButton'; |
|
|
import FlatButton from 'material-ui/FlatButton'; |
|
|
import RaisedButton from 'material-ui/RaisedButton'; |
|
|
import RaisedButton from 'material-ui/RaisedButton'; |
|
|
import React from 'react'; |
|
|
|
|
|
import TextField from 'material-ui/TextField'; |
|
|
import TextField from 'material-ui/TextField'; |
|
|
import fetch from 'isomorphic-fetch'; |
|
|
import fetch from 'isomorphic-fetch'; |
|
|
import moment from 'moment-timezone'; |
|
|
import moment from 'moment-timezone'; |
|
@ -22,6 +22,10 @@ const styles = { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
class BikeForm extends React.Component { |
|
|
class BikeForm extends React.Component { |
|
|
|
|
|
static propTypes = { |
|
|
|
|
|
bike: PropTypes.object, |
|
|
|
|
|
editing: PropTypes.bool, |
|
|
|
|
|
} |
|
|
constructor({ bike, editing = false }) { |
|
|
constructor({ bike, editing = false }) { |
|
|
super(); |
|
|
super(); |
|
|
if (editing) { |
|
|
if (editing) { |
|
@ -117,7 +121,7 @@ class BikeForm extends React.Component { |
|
|
name="make" |
|
|
name="make" |
|
|
floatingLabelText="Make" |
|
|
floatingLabelText="Make" |
|
|
hintText="Norco" |
|
|
hintText="Norco" |
|
|
value={this.state.bike.make} |
|
|
value={this.state.bike.make || undefined} |
|
|
onChange={this.handleChange} |
|
|
onChange={this.handleChange} |
|
|
fullWidth |
|
|
fullWidth |
|
|
required |
|
|
required |
|
@ -128,7 +132,7 @@ class BikeForm extends React.Component { |
|
|
name="price" |
|
|
name="price" |
|
|
floatingLabelText="Price" |
|
|
floatingLabelText="Price" |
|
|
hintText="35.60" |
|
|
hintText="35.60" |
|
|
value={this.state.bike.price} |
|
|
value={this.state.bike.price || undefined} |
|
|
onChange={this.handleChange} |
|
|
onChange={this.handleChange} |
|
|
fullWidth |
|
|
fullWidth |
|
|
/> |
|
|
/> |
|
@ -138,7 +142,7 @@ class BikeForm extends React.Component { |
|
|
name="colour" |
|
|
name="colour" |
|
|
floatingLabelText="Colour" |
|
|
floatingLabelText="Colour" |
|
|
hintText="orange" |
|
|
hintText="orange" |
|
|
value={this.state.bike.colour} |
|
|
value={this.state.bike.colour || undefined} |
|
|
onChange={this.handleChange} |
|
|
onChange={this.handleChange} |
|
|
fullWidth |
|
|
fullWidth |
|
|
required |
|
|
required |
|
@ -157,7 +161,7 @@ class BikeForm extends React.Component { |
|
|
name="serial_number" |
|
|
name="serial_number" |
|
|
floatingLabelText="Serial number" |
|
|
floatingLabelText="Serial number" |
|
|
hintText="ab90cd23" |
|
|
hintText="ab90cd23" |
|
|
value={this.state.bike.serial_number} |
|
|
value={this.state.bike.serial_number || undefined} |
|
|
onChange={this.handleChange} |
|
|
onChange={this.handleChange} |
|
|
fullWidth |
|
|
fullWidth |
|
|
required |
|
|
required |
|
@ -188,10 +192,10 @@ class BikeForm extends React.Component { |
|
|
<div className="mdl-cell mdl-cell--6-col"> |
|
|
<div className="mdl-cell mdl-cell--6-col"> |
|
|
<TextField |
|
|
<TextField |
|
|
floatingLabelText="Claimed by" |
|
|
floatingLabelText="Claimed by" |
|
|
value={claimed_by} |
|
|
value={claimed_by || undefined} |
|
|
fullWidth |
|
|
fullWidth |
|
|
disabled |
|
|
disabled |
|
|
readonly |
|
|
readOnly |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|