From 1f07e7dbe5758b90b19d65c27b0726d8ae5d177e Mon Sep 17 00:00:00 2001 From: Drew Larson Date: Sun, 29 Jan 2017 11:47:58 -0600 Subject: [PATCH] Reformatted form. --- .../js/bikes/components/BikeModal/index.jsx | 87 +++++++++++++++---- .../assets/js/bikes/components/Size/index.jsx | 7 +- .../js/bikes/components/Source/index.jsx | 2 +- 3 files changed, 75 insertions(+), 21 deletions(-) diff --git a/bikeshop_project/assets/js/bikes/components/BikeModal/index.jsx b/bikeshop_project/assets/js/bikes/components/BikeModal/index.jsx index 32e2b21..1d3b1b8 100644 --- a/bikeshop_project/assets/js/bikes/components/BikeModal/index.jsx +++ b/bikeshop_project/assets/js/bikes/components/BikeModal/index.jsx @@ -1,13 +1,12 @@ import Checkbox from 'material-ui/Checkbox'; -import DatePicker from 'material-ui/DatePicker'; import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; import moment from 'moment-timezone'; -import RaisedButton from 'material-ui/RaisedButton'; import React from 'react'; import TextField from 'material-ui/TextField'; -import Size from '../Size'; + import Source from '../Source'; +import Size from '../Size'; /** * A modal dialog can only be closed by selecting one of the actions. @@ -36,6 +35,9 @@ export default class BikeModal extends React.Component { checkbox: { marginBottom: 16, }, + bottom: { + alignItems: 'flex-end' + }, }; const actions = [ @@ -68,26 +70,73 @@ export default class BikeModal extends React.Component { size, serial_number, source, + stolen, stripped } = this.state.bike; - const createdAtFormatted = moment(created_at).tz(timezone).fromNow(); + const createdAtFormatted = (moment(created_at).isValid()) ? moment(created_at).tz(timezone).fromNow() : ''; + const claimedAtFormatted = (moment(claimed_at).isValid()) ? moment(claimed_at).tz(timezone).fromNow() : ''; + const cpicSearchedAtFormatted = (moment(cpic_searched_at).isValid()) ? moment(cpic_searched_at).tz(timezone) + .fromNow() : ''; form = (
-
-
-
-
-
- - - -
- +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+ +
+
); diff --git a/bikeshop_project/assets/js/bikes/components/Size/index.jsx b/bikeshop_project/assets/js/bikes/components/Size/index.jsx index 42eb4d4..80aaa90 100644 --- a/bikeshop_project/assets/js/bikes/components/Size/index.jsx +++ b/bikeshop_project/assets/js/bikes/components/Size/index.jsx @@ -21,17 +21,22 @@ export const friendlySize = (size) => { } }; +const styles = { + float: 'left' +} + const Size = ({ size }) => { const items = sizes.map(s => , ); return ( -
+
{items} diff --git a/bikeshop_project/assets/js/bikes/components/Source/index.jsx b/bikeshop_project/assets/js/bikes/components/Source/index.jsx index c1b96cf..2bfb130 100644 --- a/bikeshop_project/assets/js/bikes/components/Source/index.jsx +++ b/bikeshop_project/assets/js/bikes/components/Source/index.jsx @@ -28,7 +28,7 @@ const Source = ({ source }) => { floatingLabelText="Source" value={source} onChange={undefined} - autoWidth + fullWidth > {items}