From 413703fd96a34463f8947697d3908e554239c736 Mon Sep 17 00:00:00 2001 From: sovanna Date: Tue, 14 Apr 2020 16:08:28 +0900 Subject: [PATCH] feat(issue19/UI): Allows to show configuration --- sass/css/_shop.scss | 22 ++++++--- static/css/order-hardware.css | 12 ++--- static/js/shop.jsx | 85 ++++++++++++++++++++++++++++------- 3 files changed, 89 insertions(+), 30 deletions(-) diff --git a/sass/css/_shop.scss b/sass/css/_shop.scss index 9b70692..d3127f9 100644 --- a/sass/css/_shop.scss +++ b/sass/css/_shop.scss @@ -17,14 +17,14 @@ button { align-items: center; padding: 2rem 3rem; text-align: center; - position: absolute; - width: 350px; + /*position: absolute; + width: 350px;*/ background: white; - left: calc(100%/2 - 350px/2); + /*left: calc(100%/2 - 350px/2);*/ -webkit-box-shadow: 0px 0px 33px -7px rgba(0,0,0,0.75); -moz-box-shadow: 0px 0px 33px -7px rgba(0,0,0,0.75); box-shadow: 0px 0px 33px -7px rgba(0,0,0,0.75); - top: calc(50% - 50px); + /*top: calc(50% - 50px);*/ border: 1px solid $brand-color; font-size: .9rem; @@ -280,6 +280,7 @@ button { width: 90%; input:not([type="submit"]), + input:not(.submit), textarea { border: 1px solid $color-secondary; border-radius: 3px; @@ -288,11 +289,11 @@ button { outline: none; } - input[type="submit"] { - background-color: $btn-primary-2; + input[type="submit"], + .btn-cla { + /*background-color: $btn-primary-2;*/ font-weight: 700; color: white; - padding: .7rem; border: 0; border-radius: 3px; outline: none; @@ -306,6 +307,13 @@ button { .errorField { border: 1px solid #e53e3e !important; } + + .btn-outline-primary, + .btn-outline-primary:hover { + color: $btn-primary-2; + border-color: $btn-primary-2; + background-color: inherit; + } } } } diff --git a/static/css/order-hardware.css b/static/css/order-hardware.css index 1799148..7b53be8 100644 --- a/static/css/order-hardware.css +++ b/static/css/order-hardware.css @@ -171,9 +171,9 @@ font-size: .85rem; } - #root-shop .panel .summary>.summary-form form input[type="submit"] { + /*#root-shop .panel .summary>.summary-form form input[type="submit"] { margin-bottom: 1em; - } + }*/ #root-shop .panel .summary>.summary-price, #root-shop .panel .summary>.summary-form { width: 100%; @@ -278,9 +278,9 @@ font-size: .85rem; } - #root-shop .panel .summary>.summary-form form input[type="submit"] { + /*#root-shop .panel .summary>.summary-form form input[type="submit"] { margin-bottom: 1em; - } + }*/ #root-shop .mobileBtnDisplaySideMenu { background-color: #0d3547; @@ -532,9 +532,9 @@ font-size: .85rem; } - #root-shop .panel .summary>.summary-form form input[type="submit"] { + /*#root-shop .panel .summary>.summary-form form input[type="submit"] { margin-bottom: 1em; - } + }*/ #root-shop .mobileBtnDisplaySideMenu { background-color: #0d3547; diff --git a/static/js/shop.jsx b/static/js/shop.jsx index 083ccb8..8991394 100644 --- a/static/js/shop.jsx +++ b/static/js/shop.jsx @@ -143,6 +143,7 @@ class Layout extends React.PureComponent { onClickToggleMobileSideMenu: PropTypes.func, onClickCloseRFQFeedback: PropTypes.func, RFQBodyType: PropTypes.string, + RFQBodyOrder: PropTypes.string, }; } @@ -163,6 +164,7 @@ class Layout extends React.PureComponent { onClickCloseRFQFeedback, showRFQFeedback, RFQBodyType, + RFQBodyOrder, } = this.props; return ( @@ -188,32 +190,42 @@ class Layout extends React.PureComponent { -
+
); @@ -999,6 +1011,10 @@ class OrderForm extends React.PureComponent { handleSubmit, } = this; + const { + onClickShow, + } = this.props; + const { email, note, @@ -1040,7 +1056,17 @@ class OrderForm extends React.PureComponent { rows="5" placeholder="Additional notes" /> - +
+ + + +
{/*This will open an email window. Send the email to make your request.*/} @@ -1368,6 +1394,7 @@ class Shop extends React.PureComponent { this.handleToggleOverlayRemove = this.handleToggleOverlayRemove.bind(this); this.handleClickToggleMobileSideMenu = this.handleClickToggleMobileSideMenu.bind(this); this.handleClickCloseRFQFeedback = this.handleClickCloseRFQFeedback.bind(this); + this.handleClickShowOrder = this.handleClickShowOrder.bind(this); this.timer = null; } @@ -1569,6 +1596,27 @@ class Shop extends React.PureComponent { }); } + handleClickShowOrder() { + const crate = { + items: [], + type: this.state.currentMode, + }; + const clonedCart = Array.from(this.state.columns.cart.items); + for (const i in clonedCart) { + const item = clonedCart[i]; + crate.items.push({ + 'pn': item.name_number, + }); + } + + this.setState({ + isProcessing: false, + shouldShowRFQFeedback: true, + RFQBodyType: 'show', + RFQBodyOrder: JSON.stringify(crate), + }); + } + handleClickSubmit(note, email) { const crate = { items: [], @@ -2028,6 +2076,7 @@ class Shop extends React.PureComponent { isProcessing, shouldShowRFQFeedback, RFQBodyType, + RFQBodyOrder, isProcessingComplete, } = this.state; @@ -2039,6 +2088,7 @@ class Shop extends React.PureComponent { + onClickSubmit={this.handleClickSubmit} + onClickShow={this.handleClickShowOrder}> }>