@open-tender/store 1.1.264 → 1.1.266
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.
|
@@ -4,10 +4,17 @@ var hooks_1 = require("../app/hooks");
|
|
|
4
4
|
var slices_1 = require("../slices");
|
|
5
5
|
var Ingredients = function (_a) {
|
|
6
6
|
var title = _a.title, subtitle = _a.subtitle, ingredients = _a.ingredients, close = _a.close, children = _a.children;
|
|
7
|
-
var
|
|
7
|
+
var _b = (0, hooks_1.useAppSelector)(slices_1.selectKioskConfig), config = _b.ingredients, modalContentConfig = _b.modalContent;
|
|
8
8
|
var handlers = { close: close };
|
|
9
9
|
if (!config)
|
|
10
10
|
return null;
|
|
11
|
-
return children({
|
|
11
|
+
return children({
|
|
12
|
+
config: config,
|
|
13
|
+
modalContentConfig: modalContentConfig,
|
|
14
|
+
handlers: handlers,
|
|
15
|
+
title: title,
|
|
16
|
+
subtitle: subtitle,
|
|
17
|
+
ingredients: ingredients
|
|
18
|
+
});
|
|
12
19
|
};
|
|
13
20
|
exports.default = Ingredients;
|
|
@@ -8,6 +8,7 @@ var useOrder = function (order, callback) {
|
|
|
8
8
|
var orderId = order.order_id, status = order.status, serviceType = order.service_type, orderType = order.order_type, revenueCenter = order.revenue_center, requested_at = order.requested_at, timezone = order.timezone, cart = order.cart, totals = order.totals, orderPrep = order.order_prep;
|
|
9
9
|
var _a = (orderPrep || {}).is_in_prep_queue, isInPrepQueue = _a === void 0 ? false : _a;
|
|
10
10
|
var orderTypeName = (0, utils_1.makeOrderTypeName)(orderType, serviceType);
|
|
11
|
+
var orderPrepType = (orderPrep === null || orderPrep === void 0 ? void 0 : orderPrep.prep_type) === 'TAKE_OUT' ? 'Take Out' : 'Dine In';
|
|
11
12
|
var tz = utils_1.timezoneMap[timezone];
|
|
12
13
|
var requestedAt = (0, utils_1.isoToDateStr)(requested_at, tz, 'MMMM d, yyyy @ h:mma');
|
|
13
14
|
var isUpcoming = (0, utils_1.isoToDate)(requested_at) > new Date();
|
|
@@ -21,7 +22,7 @@ var useOrder = function (order, callback) {
|
|
|
21
22
|
var itemNames = cart.map(function (i) { return i.name; }).join(', ');
|
|
22
23
|
var total = totals.total;
|
|
23
24
|
var orderNo = "Order #".concat(orderId);
|
|
24
|
-
var title = "".concat(
|
|
25
|
+
var title = "".concat(orderPrepType, " from ").concat(revenueCenter.name);
|
|
25
26
|
var subtitle = "".concat(requestedAt, " | ").concat((0, utils_1.formatDollars)(total));
|
|
26
27
|
var reorder = function () {
|
|
27
28
|
// const { revenue_center_id: revenueCenterId } = revenueCenter
|
|
@@ -2,10 +2,17 @@ import { useAppSelector } from '../app/hooks';
|
|
|
2
2
|
import { selectKioskConfig } from '../slices';
|
|
3
3
|
var Ingredients = function (_a) {
|
|
4
4
|
var title = _a.title, subtitle = _a.subtitle, ingredients = _a.ingredients, close = _a.close, children = _a.children;
|
|
5
|
-
var
|
|
5
|
+
var _b = useAppSelector(selectKioskConfig), config = _b.ingredients, modalContentConfig = _b.modalContent;
|
|
6
6
|
var handlers = { close: close };
|
|
7
7
|
if (!config)
|
|
8
8
|
return null;
|
|
9
|
-
return children({
|
|
9
|
+
return children({
|
|
10
|
+
config: config,
|
|
11
|
+
modalContentConfig: modalContentConfig,
|
|
12
|
+
handlers: handlers,
|
|
13
|
+
title: title,
|
|
14
|
+
subtitle: subtitle,
|
|
15
|
+
ingredients: ingredients
|
|
16
|
+
});
|
|
10
17
|
};
|
|
11
18
|
export default Ingredients;
|
|
@@ -6,6 +6,7 @@ var useOrder = function (order, callback) {
|
|
|
6
6
|
var orderId = order.order_id, status = order.status, serviceType = order.service_type, orderType = order.order_type, revenueCenter = order.revenue_center, requested_at = order.requested_at, timezone = order.timezone, cart = order.cart, totals = order.totals, orderPrep = order.order_prep;
|
|
7
7
|
var _a = (orderPrep || {}).is_in_prep_queue, isInPrepQueue = _a === void 0 ? false : _a;
|
|
8
8
|
var orderTypeName = makeOrderTypeName(orderType, serviceType);
|
|
9
|
+
var orderPrepType = (orderPrep === null || orderPrep === void 0 ? void 0 : orderPrep.prep_type) === 'TAKE_OUT' ? 'Take Out' : 'Dine In';
|
|
9
10
|
var tz = timezoneMap[timezone];
|
|
10
11
|
var requestedAt = isoToDateStr(requested_at, tz, 'MMMM d, yyyy @ h:mma');
|
|
11
12
|
var isUpcoming = isoToDate(requested_at) > new Date();
|
|
@@ -19,7 +20,7 @@ var useOrder = function (order, callback) {
|
|
|
19
20
|
var itemNames = cart.map(function (i) { return i.name; }).join(', ');
|
|
20
21
|
var total = totals.total;
|
|
21
22
|
var orderNo = "Order #".concat(orderId);
|
|
22
|
-
var title = "".concat(
|
|
23
|
+
var title = "".concat(orderPrepType, " from ").concat(revenueCenter.name);
|
|
23
24
|
var subtitle = "".concat(requestedAt, " | ").concat(formatDollars(total));
|
|
24
25
|
var reorder = function () {
|
|
25
26
|
// const { revenue_center_id: revenueCenterId } = revenueCenter
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/store",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.266",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our in-store POS API",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@emotion/react": "^11.11.1",
|
|
64
|
-
"@open-tender/types": "^0.4.
|
|
65
|
-
"@open-tender/ui": "^0.4.
|
|
66
|
-
"@open-tender/utils": "^0.
|
|
64
|
+
"@open-tender/types": "^0.4.141",
|
|
65
|
+
"@open-tender/ui": "^0.4.46",
|
|
66
|
+
"@open-tender/utils": "^0.5.24",
|
|
67
67
|
"@reduxjs/toolkit": "^2.0.1",
|
|
68
68
|
"date-fns": "2.30.0",
|
|
69
69
|
"date-fns-tz": "^2.0.0",
|