From af6168028ade6e7fb91364f12b6931728ed578b1 Mon Sep 17 00:00:00 2001 From: Drew Larson Date: Sun, 5 Feb 2017 11:14:53 -0600 Subject: [PATCH] Add close button button. --- .../js/bikes/components/BikeForm/index.jsx | 6 ++++-- .../js/bikes/components/BikeModal/index.jsx | 17 +---------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/bikeshop_project/assets/js/bikes/components/BikeForm/index.jsx b/bikeshop_project/assets/js/bikes/components/BikeForm/index.jsx index 0e1f6a8..5a82914 100644 --- a/bikeshop_project/assets/js/bikes/components/BikeForm/index.jsx +++ b/bikeshop_project/assets/js/bikes/components/BikeForm/index.jsx @@ -25,6 +25,7 @@ class BikeForm extends React.Component { static propTypes = { bike: PropTypes.object, editing: PropTypes.bool, + handleClose: PropTypes.func, } constructor({ bike, editing = false }) { super(); @@ -244,8 +245,9 @@ class BikeForm extends React.Component { }
-
- +
+ +
diff --git a/bikeshop_project/assets/js/bikes/components/BikeModal/index.jsx b/bikeshop_project/assets/js/bikes/components/BikeModal/index.jsx index 26bd788..363d16a 100644 --- a/bikeshop_project/assets/js/bikes/components/BikeModal/index.jsx +++ b/bikeshop_project/assets/js/bikes/components/BikeModal/index.jsx @@ -37,20 +37,6 @@ export default class BikeModal extends React.Component { }; render() { - const actions = [ - , - , - ]; - const title = this.state.bike && this.state.bike.stolen ? (

{this.props.editing ? 'Edit Bike' : 'Add Bike'}

@@ -61,8 +47,6 @@ export default class BikeModal extends React.Component { return (
@@ -71,6 +55,7 @@ export default class BikeModal extends React.Component { bike={this.state.bike} editing={this.state.editing} getBikes={this.props.getBikes} + handleClose={this.handleClose} /> :
Unable to edit bike.
}