merchi_cart 0.0.3-d → 0.0.3-e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,14 +2,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
3
|
import CartItemRow from '../components/CartItemRow';
|
|
4
4
|
import { tabIdItems } from '../slices/sliceCart';
|
|
5
|
-
import CartNav from '../tabs/CartNav';
|
|
6
5
|
import { CartBody, CartTabContent, CartTableContainer, CartTabPanel, NoCartItems, Table, } from '../components';
|
|
7
6
|
function PanelCartItems() {
|
|
8
7
|
var _a = useSelector(function (s) { return s.stateCart; }), cart = _a.cart, deletingCartItemIndex = _a.deletingCartItemIndex;
|
|
9
8
|
var cartItems = cart.cartItems ? cart.cartItems : [];
|
|
10
9
|
var hasItems = cartItems.length > 0;
|
|
11
|
-
return (_jsx(CartTabPanel, { tabId: tabIdItems, children:
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
return (_jsx(CartTabPanel, { tabId: tabIdItems, children: _jsx(CartBody, { children: _jsx(CartTabContent, { children: hasItems ? (_jsx(CartTableContainer, { children: _jsxs(Table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: 'col', className: 'merchi-cart-item-table-head', children: "Product" }), _jsx("th", { scope: 'col', className: 'merchi-cart-item-table-head-right', children: "Quantity" }), _jsx("th", { scope: 'col', className: 'merchi-cart-item-table-head-right', children: "Price" }), _jsx("th", { scope: 'col', className: 'merchi-cart-item-table-head-right', children: "Actions" })] }) }), _jsx("tbody", { children: cartItems.map(function (cartItem, index) {
|
|
11
|
+
return _jsx(CartItemRow, { cartItem: cartItem, index: index, loading: deletingCartItemIndex === index }, cartItem.id);
|
|
12
|
+
}) })] }) })) : (_jsx(NoCartItems, {})) }) }) }));
|
|
14
13
|
}
|
|
15
14
|
export default PanelCartItems;
|
|
@@ -5,16 +5,15 @@ import { ActiveFormShipmentAddressAndNotes } from '../forms/FormShipmentAddressA
|
|
|
5
5
|
import { CheckoutContainer, InnerContainer, } from '../components/containers';
|
|
6
6
|
import { Alert, CartBody, CartTabPanel, LoadingTemplateSm, ShipmentGroupCard, Title, } from '../components';
|
|
7
7
|
import { tabIdShipment } from '../slices/sliceCart';
|
|
8
|
-
import CartNav from '../tabs/CartNav';
|
|
9
8
|
function PanelCartShipment() {
|
|
10
9
|
var _a = useSelector(function (s) { return s.stateCartShipment; }), fetchingShipmentGroups = _a.fetchingShipmentGroups, shipmentGroups = _a.shipmentGroups;
|
|
11
|
-
return (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
return (_jsx(CartTabPanel, { tabId: tabIdShipment, children: _jsx(CartBody, { style: { paddingTop: '2rem' }, children: _jsxs("div", { className: 'merchi-cart-tab-content', children: [_jsx(CheckoutContainer, { textAlign: 'left', children: _jsx(InnerContainer, { width: 700, paddingBottom: '3rem', children: _jsx(ActiveFormShipmentAddressAndNotes, {}) }) }), fetchingShipmentGroups ? (_jsx(CheckoutContainer, { children: _jsxs(InnerContainer, { width: 700, children: [_jsx(LoadingTemplateSm, {}), _jsx("p", { children: "Fetching shipping options." })] }) })) : (_jsxs(_Fragment, { children: [_jsx(CheckoutContainer, { textAlign: 'left', children: _jsx(InnerContainer, { paddingBottom: '1rem', width: 700, children: _jsx(Title, { icon: faTruck, title: shipmentGroups.length > 1 ?
|
|
11
|
+
'Select shipment methods'
|
|
12
|
+
: shipmentGroups.length ?
|
|
13
|
+
'Select a shipment method'
|
|
14
|
+
: '' }) }) }), _jsx(CheckoutContainer, { textAlign: 'left', children: _jsxs(InnerContainer, { paddingBottom: '1rem', width: 700, children: [shipmentGroups.length > 1 &&
|
|
15
|
+
_jsx(Alert, { alertType: 'warning', children: "Items within this cart are warehoused in different locations and will be shipped separately. Please select how you would like your items to be shipped." }), shipmentGroups.map(function (group, index) {
|
|
16
|
+
return _jsx(ShipmentGroupCard, { group: group, groupIndex: index }, "".concat(index, "-shipment-group"));
|
|
17
|
+
})] }) })] }))] }) }) }));
|
|
19
18
|
}
|
|
20
19
|
export default PanelCartShipment;
|
package/lib/styles/globals.css
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
.merchi-cart-header {
|
|
2
|
+
margin-bottom: 1rem;
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
.merchi-cart-body {
|
|
2
6
|
display: block;
|
|
3
7
|
min-height: 100px;
|
|
@@ -120,6 +124,9 @@
|
|
|
120
124
|
cursor: pointer;
|
|
121
125
|
display: block;
|
|
122
126
|
padding: 0.5rem 1rem;
|
|
127
|
+
width: 100%;
|
|
128
|
+
border: 0px;
|
|
129
|
+
border-radius: 0.375rem;
|
|
123
130
|
}
|
|
124
131
|
|
|
125
132
|
.merchi-nav-link:hover, .merchi-nav-link:focus {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../src/styles/globals.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAGF;AACA;EACE;EACA;;;AAGF;EACE;IACE;;EAGF;IACE;IACA;;EAGF;IACE;IACA;;;AAIJ;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;AAAA;EAEE;EACA;EACA;;;AAGF;EACE;;;AAGF;AAAA;EAEE;EACA;;;AAGF;EACE;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA","file":"globals.css"}
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../src/styles/globals.scss"],"names":[],"mappings":"AAAA;EACE;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAGF;AACA;EACE;EACA;;;AAGF;EACE;IACE;;EAGF;IACE;IACA;;EAGF;IACE;IACA;;;AAIJ;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;AAAA;EAEE;EACA;EACA;;;AAGF;EACE;;;AAGF;AAAA;EAEE;EACA;;;AAGF;EACE;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA","file":"globals.css"}
|