ordering-ui-external 10.1.0 → 10.2.0
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.
- package/_bundles/{0.ordering-ui.e9827c5566d8cce0eaa4.js → 0.ordering-ui.8384f3801abcc340af2a.js} +1 -1
- package/_bundles/{1.ordering-ui.e9827c5566d8cce0eaa4.js → 1.ordering-ui.8384f3801abcc340af2a.js} +1 -1
- package/_bundles/{2.ordering-ui.e9827c5566d8cce0eaa4.js → 2.ordering-ui.8384f3801abcc340af2a.js} +1 -1
- package/_bundles/{4.ordering-ui.e9827c5566d8cce0eaa4.js → 4.ordering-ui.8384f3801abcc340af2a.js} +1 -1
- package/_bundles/{5.ordering-ui.e9827c5566d8cce0eaa4.js → 5.ordering-ui.8384f3801abcc340af2a.js} +1 -1
- package/_bundles/{6.ordering-ui.e9827c5566d8cce0eaa4.js → 6.ordering-ui.8384f3801abcc340af2a.js} +1 -1
- package/_bundles/{7.ordering-ui.e9827c5566d8cce0eaa4.js → 7.ordering-ui.8384f3801abcc340af2a.js} +2 -2
- package/_bundles/{8.ordering-ui.e9827c5566d8cce0eaa4.js → 8.ordering-ui.8384f3801abcc340af2a.js} +1 -1
- package/_bundles/{9.ordering-ui.e9827c5566d8cce0eaa4.js → 9.ordering-ui.8384f3801abcc340af2a.js} +1 -1
- package/_bundles/ordering-ui.8384f3801abcc340af2a.js +2 -0
- package/_modules/components/BusinessBasicInformation/index.js +7 -10
- package/_modules/components/OrderDetails/index.js +14 -17
- package/_modules/components/ProductItemAccordion/index.js +4 -5
- package/_modules/components/RenderProductsLayout/SearchProducts/index.js +2 -5
- package/_modules/components/UserFormDetails/index.js +7 -8
- package/_modules/components/UserProfileForm/ProfileOptions/index.js +4 -5
- package/_modules/components/UserProfileForm/index.js +10 -11
- package/_modules/contexts/ThemeContext/index.js +1 -1
- package/_modules/themes/five/src/components/AddressList/index.js +0 -3
- package/_modules/themes/five/src/components/BusinessController/index.js +11 -14
- package/_modules/themes/five/src/components/BusinessInformation/styles.js +19 -14
- package/_modules/themes/five/src/components/BusinessPreorder/index.js +51 -10
- package/_modules/themes/five/src/components/BusinessPreorder/styles.js +32 -25
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +2 -5
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +11 -4
- package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +11 -12
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +5 -10
- package/_modules/themes/five/src/components/Cart/index.js +17 -9
- package/_modules/themes/five/src/components/CartPopover/index.js +4 -7
- package/_modules/themes/five/src/components/CartPopover/styles.js +4 -1
- package/_modules/themes/five/src/components/Checkout/index.js +3 -6
- package/_modules/themes/five/src/components/Confirm/styles.js +16 -13
- package/_modules/themes/five/src/components/DatePicker/index.js +2 -1
- package/_modules/themes/five/src/components/Favorite/index.js +4 -5
- package/_modules/themes/five/src/components/Footer/index.js +2 -3
- package/_modules/themes/five/src/components/Header/index.js +5 -8
- package/_modules/themes/five/src/components/HeaderOption/index.js +4 -5
- package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +7 -10
- package/_modules/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -1
- package/_modules/themes/five/src/components/Modal/styles.js +4 -2
- package/_modules/themes/five/src/components/MomentContent/index.js +16 -6
- package/_modules/themes/five/src/components/MomentControl/index.js +44 -34
- package/_modules/themes/five/src/components/MomentControl/styles.js +49 -27
- package/_modules/themes/five/src/components/OrderDetails/index.js +31 -24
- package/_modules/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +4 -7
- package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +11 -1
- package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +4 -5
- package/_modules/themes/five/src/components/PageBanner/index.js +75 -54
- package/_modules/themes/five/src/components/ProductForm/styles.js +12 -9
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +0 -3
- package/_modules/themes/five/src/components/ProductOption/styles.js +4 -1
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +8 -9
- package/_modules/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +0 -3
- package/_modules/themes/five/src/components/UserFormDetails/index.js +3 -6
- package/_modules/themes/five/src/components/UserPopover/index.js +3 -6
- package/_modules/themes/five/src/components/UserPopover/styles.js +8 -5
- package/_modules/themes/five/src/components/UserProfileForm/ProfileOptions/index.js +4 -5
- package/_modules/themes/five/src/components/UserProfileForm/index.js +2 -5
- package/_modules/themes/six/src/components/BusinessBasicInformation/index.js +8 -9
- package/_modules/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +3 -6
- package/package.json +2 -2
- package/src/components/BusinessBasicInformation/index.js +7 -8
- package/src/components/OrderDetails/index.js +14 -16
- package/src/components/ProductItemAccordion/index.js +4 -3
- package/src/components/RenderProductsLayout/SearchProducts/index.js +2 -3
- package/src/components/UserFormDetails/index.js +6 -5
- package/src/components/UserProfileForm/ProfileOptions/index.js +4 -4
- package/src/components/UserProfileForm/index.js +10 -10
- package/src/contexts/ThemeContext/index.js +1 -1
- package/src/themes/five/src/components/AddressForm/index.js +1 -2
- package/src/themes/five/src/components/AddressList/index.js +1 -3
- package/src/themes/five/src/components/BusinessController/index.js +2 -4
- package/src/themes/five/src/components/BusinessInformation/index.js +1 -2
- package/src/themes/five/src/components/BusinessInformation/styles.js +2 -2
- package/src/themes/five/src/components/BusinessPreorder/index.js +61 -10
- package/src/themes/five/src/components/BusinessPreorder/styles.js +93 -43
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +2 -3
- package/src/themes/five/src/components/BusinessProductsList/index.js +1 -2
- package/src/themes/five/src/components/BusinessProductsListing/index.js +10 -3
- package/src/themes/five/src/components/BusinessProductsListing/styles.js +1 -1
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +6 -7
- package/src/themes/five/src/components/Cart/index.js +11 -4
- package/src/themes/five/src/components/CartPopover/index.js +2 -3
- package/src/themes/five/src/components/CartPopover/styles.js +1 -1
- package/src/themes/five/src/components/Checkout/index.js +2 -4
- package/src/themes/five/src/components/Confirm/styles.js +1 -1
- package/src/themes/five/src/components/DatePicker/index.js +1 -0
- package/src/themes/five/src/components/Favorite/index.js +4 -3
- package/src/themes/five/src/components/Footer/index.js +3 -2
- package/src/themes/five/src/components/Header/index.js +4 -5
- package/src/themes/five/src/components/HeaderOption/index.js +4 -3
- package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +7 -8
- package/src/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -0
- package/src/themes/five/src/components/Modal/styles.js +1 -1
- package/src/themes/five/src/components/MomentContent/index.js +17 -8
- package/src/themes/five/src/components/MomentControl/index.js +83 -45
- package/src/themes/five/src/components/MomentControl/styles.js +137 -34
- package/src/themes/five/src/components/MyOrders/index.js +1 -1
- package/src/themes/five/src/components/OrderDetails/index.js +50 -21
- package/src/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +4 -6
- package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +13 -1
- package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +4 -3
- package/src/themes/five/src/components/PageBanner/index.js +64 -50
- package/src/themes/five/src/components/ProductForm/styles.js +1 -1
- package/src/themes/five/src/components/ProductItemAccordion/index.js +1 -2
- package/src/themes/five/src/components/ProductOption/styles.js +1 -1
- package/src/themes/five/src/components/RenderProductsLayout/index.js +9 -6
- package/src/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +1 -2
- package/src/themes/five/src/components/UserFormDetails/index.js +3 -4
- package/src/themes/five/src/components/UserPopover/index.js +3 -4
- package/src/themes/five/src/components/UserPopover/styles.js +1 -1
- package/src/themes/five/src/components/UserProfileForm/ProfileOptions/index.js +4 -3
- package/src/themes/five/src/components/UserProfileForm/index.js +2 -4
- package/src/themes/six/src/components/BusinessBasicInformation/index.js +8 -7
- package/src/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +2 -3
- package/template/app.js +15 -10
- package/template/components/HelmetTags/index.js +3 -2
- package/template/pages/AddressList/index.js +4 -3
- package/template/pages/BusinessProductsList/index.js +5 -4
- package/template/pages/BusinessesList/index.js +6 -6
- package/template/pages/Checkout/index.js +6 -4
- package/template/pages/Home/index.js +4 -2
- package/template/pages/MessagesList/index.js +5 -4
- package/template/pages/MyOrders/index.js +6 -5
- package/template/pages/OrderDetails/index.js +4 -3
- package/_bundles/ordering-ui.e9827c5566d8cce0eaa4.js +0 -2
- package/template/components/OrderingThemeUpdated/index.js +0 -41
- /package/_bundles/{7.ordering-ui.e9827c5566d8cce0eaa4.js.LICENSE.txt → 7.ordering-ui.8384f3801abcc340af2a.js.LICENSE.txt} +0 -0
- /package/_bundles/{ordering-ui.e9827c5566d8cce0eaa4.js.LICENSE.txt → ordering-ui.8384f3801abcc340af2a.js.LICENSE.txt} +0 -0
|
@@ -13,6 +13,7 @@ var _FaStar = _interopRequireDefault(require("@meronex/icons/fa/FaStar"));
|
|
|
13
13
|
var _orderingComponentsExternal = require("ordering-components-external");
|
|
14
14
|
var _utils = require("../../../../../utils");
|
|
15
15
|
var _styles = require("./styles");
|
|
16
|
+
var _styledComponents = require("styled-components");
|
|
16
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
18
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
18
19
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -23,7 +24,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
23
24
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
24
25
|
var types = ['food', 'laundry', 'alcohol', 'groceries'];
|
|
25
26
|
var BusinessBasicInformation = function BusinessBasicInformation(props) {
|
|
26
|
-
var
|
|
27
|
+
var _theme$business_view, _theme$business_view$, _theme$business_view$2, _theme$business_view$3, _theme$business_view$4, _theme$business_view$5, _theme$business_view$6, _theme$business_view2, _theme$business_view3, _theme$business_view4, _theme$business_view5, _theme$business_view6, _theme$business_view7, _theme$business_view8, _theme$business_view9, _theme$business_view10, _theme$business_view11, _theme$business_view12, _theme$business_view13, _theme$business_view14, _theme$business_view15, _theme$business_view16, _theme$business_view17, _theme$business_view18, _theme$business_view19, _theme$business_view20, _theme$business_view21, _theme$business_view22, _theme$business_view23, _theme$business_view24, _theme$business_view25, _theme$business_view26, _theme$business_view27, _theme$business_view28, _theme$business_view29, _props$beforeElements, _props$beforeComponen, _orderState$options, _business$reviews, _props$afterComponent, _props$afterElements;
|
|
27
28
|
var isSkeleton = props.isSkeleton,
|
|
28
29
|
businessState = props.businessState;
|
|
29
30
|
var business = businessState.business,
|
|
@@ -39,9 +40,7 @@ var BusinessBasicInformation = function BusinessBasicInformation(props) {
|
|
|
39
40
|
_useUtils2$ = _useUtils2[0],
|
|
40
41
|
parsePrice = _useUtils2$.parsePrice,
|
|
41
42
|
parseDistance = _useUtils2$.parseDistance;
|
|
42
|
-
var
|
|
43
|
-
_useOrderingTheme2 = _slicedToArray(_useOrderingTheme, 1),
|
|
44
|
-
orderingTheme = _useOrderingTheme2[0];
|
|
43
|
+
var theme = (0, _styledComponents.useTheme)();
|
|
45
44
|
var getBusinessType = function getBusinessType() {
|
|
46
45
|
if (Object.keys(business).length <= 0) return t('GENERAL', 'General');
|
|
47
46
|
var _types = [];
|
|
@@ -51,11 +50,11 @@ var BusinessBasicInformation = function BusinessBasicInformation(props) {
|
|
|
51
50
|
});
|
|
52
51
|
return _types.join(', ');
|
|
53
52
|
};
|
|
54
|
-
var showDeliveryFee = !(
|
|
55
|
-
var showTime = !(
|
|
56
|
-
var showBusinessInfo = !(
|
|
57
|
-
var showReviews = !(
|
|
58
|
-
var showDistance = !(
|
|
53
|
+
var showDeliveryFee = !(theme !== null && theme !== void 0 && (_theme$business_view = theme.business_view) !== null && _theme$business_view !== void 0 && (_theme$business_view$ = _theme$business_view.components) !== null && _theme$business_view$ !== void 0 && (_theme$business_view$2 = _theme$business_view$.header) !== null && _theme$business_view$2 !== void 0 && (_theme$business_view$3 = _theme$business_view$2.components) !== null && _theme$business_view$3 !== void 0 && (_theme$business_view$4 = _theme$business_view$3.business) !== null && _theme$business_view$4 !== void 0 && (_theme$business_view$5 = _theme$business_view$4.components) !== null && _theme$business_view$5 !== void 0 && (_theme$business_view$6 = _theme$business_view$5.fee) !== null && _theme$business_view$6 !== void 0 && _theme$business_view$6.hidden);
|
|
54
|
+
var showTime = !(theme !== null && theme !== void 0 && (_theme$business_view2 = theme.business_view) !== null && _theme$business_view2 !== void 0 && (_theme$business_view3 = _theme$business_view2.components) !== null && _theme$business_view3 !== void 0 && (_theme$business_view4 = _theme$business_view3.header) !== null && _theme$business_view4 !== void 0 && (_theme$business_view5 = _theme$business_view4.components) !== null && _theme$business_view5 !== void 0 && (_theme$business_view6 = _theme$business_view5.business) !== null && _theme$business_view6 !== void 0 && (_theme$business_view7 = _theme$business_view6.components) !== null && _theme$business_view7 !== void 0 && (_theme$business_view8 = _theme$business_view7.time) !== null && _theme$business_view8 !== void 0 && _theme$business_view8.hidden);
|
|
55
|
+
var showBusinessInfo = !(theme !== null && theme !== void 0 && (_theme$business_view9 = theme.business_view) !== null && _theme$business_view9 !== void 0 && (_theme$business_view10 = _theme$business_view9.components) !== null && _theme$business_view10 !== void 0 && (_theme$business_view11 = _theme$business_view10.header) !== null && _theme$business_view11 !== void 0 && (_theme$business_view12 = _theme$business_view11.components) !== null && _theme$business_view12 !== void 0 && (_theme$business_view13 = _theme$business_view12.business) !== null && _theme$business_view13 !== void 0 && (_theme$business_view14 = _theme$business_view13.components) !== null && _theme$business_view14 !== void 0 && (_theme$business_view15 = _theme$business_view14.business_info) !== null && _theme$business_view15 !== void 0 && _theme$business_view15.hidden);
|
|
56
|
+
var showReviews = !(theme !== null && theme !== void 0 && (_theme$business_view16 = theme.business_view) !== null && _theme$business_view16 !== void 0 && (_theme$business_view17 = _theme$business_view16.components) !== null && _theme$business_view17 !== void 0 && (_theme$business_view18 = _theme$business_view17.header) !== null && _theme$business_view18 !== void 0 && (_theme$business_view19 = _theme$business_view18.components) !== null && _theme$business_view19 !== void 0 && (_theme$business_view20 = _theme$business_view19.business) !== null && _theme$business_view20 !== void 0 && (_theme$business_view21 = _theme$business_view20.components) !== null && _theme$business_view21 !== void 0 && (_theme$business_view22 = _theme$business_view21.reviews) !== null && _theme$business_view22 !== void 0 && _theme$business_view22.hidden);
|
|
57
|
+
var showDistance = !(theme !== null && theme !== void 0 && (_theme$business_view23 = theme.business_view) !== null && _theme$business_view23 !== void 0 && (_theme$business_view24 = _theme$business_view23.components) !== null && _theme$business_view24 !== void 0 && (_theme$business_view25 = _theme$business_view24.header) !== null && _theme$business_view25 !== void 0 && (_theme$business_view26 = _theme$business_view25.components) !== null && _theme$business_view26 !== void 0 && (_theme$business_view27 = _theme$business_view26.business) !== null && _theme$business_view27 !== void 0 && (_theme$business_view28 = _theme$business_view27.components) !== null && _theme$business_view28 !== void 0 && (_theme$business_view29 = _theme$business_view28.distance) !== null && _theme$business_view29 !== void 0 && _theme$business_view29.hidden);
|
|
59
58
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (_props$beforeElements = props.beforeElements) === null || _props$beforeElements === void 0 ? void 0 : _props$beforeElements.map(function (BeforeElement, i) {
|
|
60
59
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
61
60
|
key: i
|
|
@@ -17,7 +17,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
17
17
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
18
18
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
19
|
var SearchProducts = function SearchProducts(props) {
|
|
20
|
-
var
|
|
20
|
+
var _theme$business_view, _theme$business_view$, _theme$business_view$2, _theme$business_view$3, _theme$business_view$4, _theme$business_view$5, _theme$business_view$6, _theme$business_view2, _theme$business_view3, _theme$business_view4, _theme$business_view5, _theme$business_view6, _theme$defaultLanguag, _businessState$busine;
|
|
21
21
|
var handleChangeSearch = props.handleChangeSearch,
|
|
22
22
|
searchValue = props.searchValue,
|
|
23
23
|
businessState = props.businessState,
|
|
@@ -28,11 +28,8 @@ var SearchProducts = function SearchProducts(props) {
|
|
|
28
28
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
29
29
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
30
30
|
t = _useLanguage2[1];
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
orderingTheme = _useOrderingTheme2[0];
|
|
34
|
-
var showSort = !(orderingTheme !== null && orderingTheme !== void 0 && (_orderingTheme$theme = orderingTheme.theme) !== null && _orderingTheme$theme !== void 0 && (_orderingTheme$theme$ = _orderingTheme$theme.business_view) !== null && _orderingTheme$theme$ !== void 0 && (_orderingTheme$theme$2 = _orderingTheme$theme$.components) !== null && _orderingTheme$theme$2 !== void 0 && (_orderingTheme$theme$3 = _orderingTheme$theme$2.header) !== null && _orderingTheme$theme$3 !== void 0 && (_orderingTheme$theme$4 = _orderingTheme$theme$3.components) !== null && _orderingTheme$theme$4 !== void 0 && (_orderingTheme$theme$5 = _orderingTheme$theme$4.business) !== null && _orderingTheme$theme$5 !== void 0 && (_orderingTheme$theme$6 = _orderingTheme$theme$5.components) !== null && _orderingTheme$theme$6 !== void 0 && (_orderingTheme$theme$7 = _orderingTheme$theme$6.sort) !== null && _orderingTheme$theme$7 !== void 0 && _orderingTheme$theme$7.hidden);
|
|
35
|
-
var searchLayout = theme === null || theme === void 0 ? void 0 : (_theme$business_view = theme.business_view) === null || _theme$business_view === void 0 ? void 0 : (_theme$business_view$ = _theme$business_view.components) === null || _theme$business_view$ === void 0 ? void 0 : (_theme$business_view$2 = _theme$business_view$.product_search) === null || _theme$business_view$2 === void 0 ? void 0 : (_theme$business_view$3 = _theme$business_view$2.components) === null || _theme$business_view$3 === void 0 ? void 0 : (_theme$business_view$4 = _theme$business_view$3.layout) === null || _theme$business_view$4 === void 0 ? void 0 : _theme$business_view$4.type;
|
|
31
|
+
var showSort = !(theme !== null && theme !== void 0 && (_theme$business_view = theme.business_view) !== null && _theme$business_view !== void 0 && (_theme$business_view$ = _theme$business_view.components) !== null && _theme$business_view$ !== void 0 && (_theme$business_view$2 = _theme$business_view$.header) !== null && _theme$business_view$2 !== void 0 && (_theme$business_view$3 = _theme$business_view$2.components) !== null && _theme$business_view$3 !== void 0 && (_theme$business_view$4 = _theme$business_view$3.business) !== null && _theme$business_view$4 !== void 0 && (_theme$business_view$5 = _theme$business_view$4.components) !== null && _theme$business_view$5 !== void 0 && (_theme$business_view$6 = _theme$business_view$5.sort) !== null && _theme$business_view$6 !== void 0 && _theme$business_view$6.hidden);
|
|
32
|
+
var searchLayout = theme === null || theme === void 0 ? void 0 : (_theme$business_view2 = theme.business_view) === null || _theme$business_view2 === void 0 ? void 0 : (_theme$business_view3 = _theme$business_view2.components) === null || _theme$business_view3 === void 0 ? void 0 : (_theme$business_view4 = _theme$business_view3.product_search) === null || _theme$business_view4 === void 0 ? void 0 : (_theme$business_view5 = _theme$business_view4.components) === null || _theme$business_view5 === void 0 ? void 0 : (_theme$business_view6 = _theme$business_view5.layout) === null || _theme$business_view6 === void 0 ? void 0 : _theme$business_view6.type;
|
|
36
33
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_SearchBar.SearchBar, {
|
|
37
34
|
onSearch: handleChangeSearch,
|
|
38
35
|
search: searchValue,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-external",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"description": "Ordering UI Components",
|
|
5
5
|
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"lodash": "^4.17.19",
|
|
89
89
|
"moment": "^2.29.4",
|
|
90
90
|
"nanoid": "^4.0.0",
|
|
91
|
-
"ordering-components-external": "9.
|
|
91
|
+
"ordering-components-external": "9.2.0",
|
|
92
92
|
"payment": "^2.4.6",
|
|
93
93
|
"polished": "^3.6.6",
|
|
94
94
|
"react-bootstrap-icons": "^1.7.2",
|
|
@@ -9,7 +9,7 @@ import { useTheme } from 'styled-components'
|
|
|
9
9
|
import { Modal } from '../Modal'
|
|
10
10
|
import { BusinessInformation } from '../BusinessInformation'
|
|
11
11
|
|
|
12
|
-
import { useUtils, useOrder, useLanguage
|
|
12
|
+
import { useUtils, useOrder, useLanguage } from 'ordering-components-external'
|
|
13
13
|
|
|
14
14
|
import { convertHoursToMinutes } from '../../utils'
|
|
15
15
|
|
|
@@ -37,7 +37,6 @@ export const BusinessBasicInformation = (props) => {
|
|
|
37
37
|
const [orderState] = useOrder()
|
|
38
38
|
const [, t] = useLanguage()
|
|
39
39
|
const [{ parsePrice, parseDistance, optimizeImage }] = useUtils()
|
|
40
|
-
const [orderingTheme] = useOrderingTheme()
|
|
41
40
|
|
|
42
41
|
const getBusinessType = () => {
|
|
43
42
|
if (Object.keys(business).length <= 0) return t('GENERAL', 'General')
|
|
@@ -48,12 +47,12 @@ export const BusinessBasicInformation = (props) => {
|
|
|
48
47
|
return _types.join(', ')
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
const showLogo = !
|
|
52
|
-
const showDeliveryFee = !
|
|
53
|
-
const showTime = !
|
|
54
|
-
const showBusinessInfo = !
|
|
55
|
-
const showReviews = !
|
|
56
|
-
const showDistance = !
|
|
50
|
+
const showLogo = !theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
|
|
51
|
+
const showDeliveryFee = !theme?.business_view?.components?.header?.components?.business?.components?.fee?.hidden
|
|
52
|
+
const showTime = !theme?.business_view?.components?.header?.components?.business?.components?.time?.hidden
|
|
53
|
+
const showBusinessInfo = !theme?.business_view?.components?.header?.components?.business?.components?.business_info?.hidden
|
|
54
|
+
const showReviews = !theme?.business_view?.components?.header?.components?.business?.components?.reviews?.hidden
|
|
55
|
+
const showDistance = !theme?.business_view?.components?.header?.components?.business?.components?.distance?.hidden
|
|
57
56
|
|
|
58
57
|
return (
|
|
59
58
|
<>
|
|
@@ -5,8 +5,7 @@ import {
|
|
|
5
5
|
useEvent,
|
|
6
6
|
useUtils,
|
|
7
7
|
useConfig,
|
|
8
|
-
GoogleMapsMap
|
|
9
|
-
useOrderingTheme
|
|
8
|
+
GoogleMapsMap
|
|
10
9
|
} from 'ordering-components-external'
|
|
11
10
|
import FiPhone from '@meronex/icons/fi/FiPhone'
|
|
12
11
|
import FaUserCircle from '@meronex/icons/fa/FaUserCircle'
|
|
@@ -90,7 +89,6 @@ const OrderDetailsUI = (props) => {
|
|
|
90
89
|
const theme = useTheme()
|
|
91
90
|
const [events] = useEvent()
|
|
92
91
|
const [{ parsePrice, parseNumber, parseDate }] = useUtils()
|
|
93
|
-
const [orderingTheme] = useOrderingTheme()
|
|
94
92
|
const [openMessages, setOpenMessages] = useState({ business: false, driver: false })
|
|
95
93
|
const [isReviewOpen, setIsReviewOpen] = useState(false)
|
|
96
94
|
const [isOrderReviewed, setIsOrderReviewed] = useState(false)
|
|
@@ -106,19 +104,19 @@ const OrderDetailsUI = (props) => {
|
|
|
106
104
|
|
|
107
105
|
const isFromCheckPage = JSON.parse(window.localStorage.getItem('business-address'))
|
|
108
106
|
|
|
109
|
-
const showDeliveryDate = !
|
|
110
|
-
const showDeliveryProgress = !
|
|
111
|
-
const showBusinessMessages = !
|
|
112
|
-
const showBusinessAddress = !
|
|
113
|
-
const showBusinessMap = !
|
|
114
|
-
const showBusinessLogo = !
|
|
115
|
-
const showDriverName = !
|
|
116
|
-
const showDriverPhone = !
|
|
117
|
-
const showDriverMessages = !
|
|
118
|
-
const showDriverEmail = !
|
|
119
|
-
const showDriverPhoto = !
|
|
120
|
-
const showCustomerAddress = !
|
|
121
|
-
const showCustomerPhoto = !
|
|
107
|
+
const showDeliveryDate = !theme?.confirmation?.components?.order?.components?.date?.hidden
|
|
108
|
+
const showDeliveryProgress = !theme?.confirmation?.components?.order?.components?.progress?.hidden
|
|
109
|
+
const showBusinessMessages = !theme?.confirmation?.components?.business?.components?.messages?.hidden
|
|
110
|
+
const showBusinessAddress = !theme?.confirmation?.components?.business?.components?.address?.hidden
|
|
111
|
+
const showBusinessMap = !theme?.confirmation?.components?.business?.components?.map?.hidden
|
|
112
|
+
const showBusinessLogo = !theme?.confirmation?.components?.business?.components?.logo?.hidden
|
|
113
|
+
const showDriverName = !theme?.confirmation?.components?.driver?.components?.name?.hidden
|
|
114
|
+
const showDriverPhone = !theme?.confirmation?.components?.driver?.components?.phone?.hidden
|
|
115
|
+
const showDriverMessages = !theme?.confirmation?.components?.driver?.components?.messages?.hidden
|
|
116
|
+
const showDriverEmail = !theme?.confirmation?.components?.driver?.components?.email?.hidden
|
|
117
|
+
const showDriverPhoto = !theme?.confirmation?.components?.driver?.components?.photo?.hidden
|
|
118
|
+
const showCustomerAddress = !theme?.confirmation?.components?.customer?.components?.address?.hidden
|
|
119
|
+
const showCustomerPhoto = !theme?.confirmation?.components?.customer?.components?.photo?.hidden
|
|
122
120
|
|
|
123
121
|
const getOrderStatus = (s) => {
|
|
124
122
|
const status = parseInt(s)
|
|
@@ -2,7 +2,7 @@ import React, { useState, useRef } from 'react'
|
|
|
2
2
|
import TiPencil from '@meronex/icons/ti/TiPencil'
|
|
3
3
|
import IosArrowDown from '@meronex/icons/ios/IosArrowDown'
|
|
4
4
|
import VscTrash from '@meronex/icons/vsc/VscTrash'
|
|
5
|
-
import { useUtils, useLanguage, useOrder
|
|
5
|
+
import { useUtils, useLanguage, useOrder } from 'ordering-components-external'
|
|
6
6
|
import { useWindowSize } from '../../hooks/useWindowSize'
|
|
7
7
|
|
|
8
8
|
import {
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
ProductOptionsList,
|
|
26
26
|
ProductQuantity
|
|
27
27
|
} from './styles'
|
|
28
|
+
import { useTheme } from 'styled-components'
|
|
28
29
|
|
|
29
30
|
export const ProductItemAccordion = (props) => {
|
|
30
31
|
const {
|
|
@@ -40,8 +41,8 @@ export const ProductItemAccordion = (props) => {
|
|
|
40
41
|
const [, t] = useLanguage()
|
|
41
42
|
const [orderState] = useOrder()
|
|
42
43
|
const [{ parsePrice }] = useUtils()
|
|
44
|
+
const theme = useTheme()
|
|
43
45
|
const windowSize = useWindowSize()
|
|
44
|
-
const [orderingTheme] = useOrderingTheme()
|
|
45
46
|
const [setActive, setActiveState] = useState('')
|
|
46
47
|
const [setHeight, setHeightState] = useState('0px')
|
|
47
48
|
const [setRotate, setRotateState] = useState('accordion__icon')
|
|
@@ -51,7 +52,7 @@ export const ProductItemAccordion = (props) => {
|
|
|
51
52
|
const productActionsEdit = useRef(null)
|
|
52
53
|
const productActionsDelete = useRef(null)
|
|
53
54
|
|
|
54
|
-
const showProductImage = !
|
|
55
|
+
const showProductImage = !theme?.confirmation?.components?.cart?.components?.products?.components?.image?.hidden
|
|
55
56
|
|
|
56
57
|
const productInfo = () => {
|
|
57
58
|
if (isCartProduct) {
|
|
@@ -3,7 +3,7 @@ import React from 'react'
|
|
|
3
3
|
import { Select } from '../../../styles/Select'
|
|
4
4
|
import { SearchBar } from '../../SearchBar'
|
|
5
5
|
import { useTheme } from 'styled-components'
|
|
6
|
-
import { useLanguage
|
|
6
|
+
import { useLanguage } from 'ordering-components-external'
|
|
7
7
|
|
|
8
8
|
export const SearchProducts = (props) => {
|
|
9
9
|
const {
|
|
@@ -17,8 +17,7 @@ export const SearchProducts = (props) => {
|
|
|
17
17
|
|
|
18
18
|
const theme = useTheme()
|
|
19
19
|
const [, t] = useLanguage()
|
|
20
|
-
const
|
|
21
|
-
const showSort = !orderingTheme?.theme?.business_view?.components?.header?.components?.business?.components?.sort?.hidden
|
|
20
|
+
const showSort = !theme?.business_view?.components?.header?.components?.business?.components?.sort?.hidden
|
|
22
21
|
|
|
23
22
|
return (
|
|
24
23
|
<>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef } from 'react'
|
|
2
2
|
import Skeleton from 'react-loading-skeleton'
|
|
3
|
-
import { useSession, useLanguage, useCustomer
|
|
3
|
+
import { useSession, useLanguage, useCustomer } from 'ordering-components-external'
|
|
4
4
|
import { useForm } from 'react-hook-form'
|
|
5
5
|
import parsePhoneNumber from 'libphonenumber-js'
|
|
6
6
|
|
|
@@ -11,6 +11,7 @@ import { Button } from '../../styles/Buttons'
|
|
|
11
11
|
import { InputPhoneNumber } from '../InputPhoneNumber'
|
|
12
12
|
import { Alert } from '../Confirm'
|
|
13
13
|
import { sortInputFields } from '../../utils'
|
|
14
|
+
import { useTheme } from 'styled-components'
|
|
14
15
|
|
|
15
16
|
export const UserFormDetailsUI = (props) => {
|
|
16
17
|
const {
|
|
@@ -33,11 +34,11 @@ export const UserFormDetailsUI = (props) => {
|
|
|
33
34
|
const formMethods = useForm()
|
|
34
35
|
const [, t] = useLanguage()
|
|
35
36
|
const [{ user: userSession }] = useSession()
|
|
37
|
+
const theme = useTheme()
|
|
36
38
|
const [isValidPhoneNumber, setIsValidPhoneNumber] = useState(null)
|
|
37
39
|
const [userPhoneNumber, setUserPhoneNumber] = useState(null)
|
|
38
40
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
39
41
|
const [, { setUserCustomer }] = useCustomer()
|
|
40
|
-
const [orderingTheme] = useOrderingTheme()
|
|
41
42
|
const emailInput = useRef(null)
|
|
42
43
|
|
|
43
44
|
const user = userData || userSession
|
|
@@ -51,8 +52,8 @@ export const UserFormDetailsUI = (props) => {
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
const showInputPhoneNumber = validationFields?.fields?.checkout?.cellphone?.enabled ?? false
|
|
54
|
-
const showCustomerCellphone = !
|
|
55
|
-
const showCustomerPassword = !
|
|
55
|
+
const showCustomerCellphone = !theme?.profile?.components?.cellphone?.hidden
|
|
56
|
+
const showCustomerPassword = !theme?.profile?.components?.password?.hidden
|
|
56
57
|
|
|
57
58
|
const setUserCellPhone = (isEdit = false) => {
|
|
58
59
|
if (userPhoneNumber && !userPhoneNumber.includes('null') && !isEdit) {
|
|
@@ -159,7 +160,7 @@ export const UserFormDetailsUI = (props) => {
|
|
|
159
160
|
}
|
|
160
161
|
|
|
161
162
|
const showFieldWithTheme = (name) => {
|
|
162
|
-
return !
|
|
163
|
+
return !theme?.profile?.components?.[name]?.hidden
|
|
163
164
|
}
|
|
164
165
|
|
|
165
166
|
useEffect(() => {
|
|
@@ -4,15 +4,15 @@ import { Tabs, Tab } from '../../../styles/Tabs'
|
|
|
4
4
|
import BsPerson from '@meronex/icons/bs/BsPerson'
|
|
5
5
|
import AiOutlineUnorderedList from '@meronex/icons/ai/AiOutlineUnorderedList'
|
|
6
6
|
import FaAddressBook from '@meronex/icons/fa/FaAddressBook';
|
|
7
|
-
import { useEvent, useLanguage
|
|
7
|
+
import { useEvent, useLanguage } from 'ordering-components-external'
|
|
8
|
+
import { useTheme } from 'styled-components'
|
|
8
9
|
|
|
9
10
|
export const ProfileOptions = ({ value }) => {
|
|
10
11
|
const [tabValue] = useState(value)
|
|
11
12
|
const [, t] = useLanguage()
|
|
12
13
|
const [events] = useEvent()
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
const showAddressListTab = orderingTheme?.theme?.profile?.components?.address_list?.components?.layout?.position === 'new_page'
|
|
14
|
+
const theme = useTheme()
|
|
15
|
+
const showAddressListTab = theme?.profile?.components?.address_list?.components?.layout?.position === 'new_page'
|
|
16
16
|
|
|
17
17
|
const handleGoToPage = (data) => {
|
|
18
18
|
events.emit('go_to_page', data)
|
|
@@ -5,8 +5,7 @@ import {
|
|
|
5
5
|
useLanguage,
|
|
6
6
|
useSession,
|
|
7
7
|
DragAndDrop,
|
|
8
|
-
ExamineClick
|
|
9
|
-
useOrderingTheme
|
|
8
|
+
ExamineClick
|
|
10
9
|
} from 'ordering-components-external'
|
|
11
10
|
|
|
12
11
|
import { useWindowSize } from '../../hooks/useWindowSize'
|
|
@@ -37,6 +36,7 @@ import {
|
|
|
37
36
|
WrapperForm
|
|
38
37
|
} from './styles'
|
|
39
38
|
import { LogoutButton } from '../LogoutButton'
|
|
39
|
+
import { useTheme } from 'styled-components'
|
|
40
40
|
|
|
41
41
|
const UserProfileFormUI = (props) => {
|
|
42
42
|
const {
|
|
@@ -52,18 +52,18 @@ const UserProfileFormUI = (props) => {
|
|
|
52
52
|
const [, t] = useLanguage()
|
|
53
53
|
const [{ user }] = useSession()
|
|
54
54
|
const [edit, setEdit] = useState(false)
|
|
55
|
+
const theme = useTheme()
|
|
55
56
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
56
57
|
const inputRef = useRef(null)
|
|
57
|
-
const [orderingTheme] = useOrderingTheme()
|
|
58
58
|
const windowSize = useWindowSize()
|
|
59
59
|
|
|
60
|
-
const showCustomerPicture = !
|
|
61
|
-
const showCustomerName = !
|
|
62
|
-
const showCustomerLastName = !
|
|
63
|
-
const showCustomerEmail = !
|
|
64
|
-
const showCustomerCellphone = !
|
|
65
|
-
const showAddressList = !
|
|
66
|
-
const userFormLayoutColumn =
|
|
60
|
+
const showCustomerPicture = !theme?.profile?.components?.picture?.hidden
|
|
61
|
+
const showCustomerName = !theme?.profile?.components?.name?.hidden
|
|
62
|
+
const showCustomerLastName = !theme?.profile?.components?.last_name?.hidden
|
|
63
|
+
const showCustomerEmail = !theme?.profile?.components?.email?.hidden
|
|
64
|
+
const showCustomerCellphone = !theme?.profile?.components?.cellphone?.hidden
|
|
65
|
+
const showAddressList = !theme?.profile?.components?.address_list?.hidden
|
|
66
|
+
const userFormLayoutColumn = theme?.profile?.components?.layout?.position === 'column'
|
|
67
67
|
const showEditButton = showCustomerName || showCustomerLastName || showCustomerEmail || showCustomerCellphone
|
|
68
68
|
|
|
69
69
|
const handleFiles = (files) => {
|
|
@@ -16,8 +16,7 @@ import {
|
|
|
16
16
|
GoogleMapsMap,
|
|
17
17
|
useSession,
|
|
18
18
|
useOrder,
|
|
19
|
-
useConfig
|
|
20
|
-
useOrderingTheme
|
|
19
|
+
useConfig
|
|
21
20
|
} from 'ordering-components-external'
|
|
22
21
|
import { Alert } from '../Confirm'
|
|
23
22
|
import { GoogleGpsButton } from '../../../../../components/GoogleGpsButton'
|
|
@@ -19,8 +19,7 @@ import {
|
|
|
19
19
|
useLanguage,
|
|
20
20
|
useOrder,
|
|
21
21
|
useCustomer,
|
|
22
|
-
useEvent
|
|
23
|
-
useOrderingTheme
|
|
22
|
+
useEvent
|
|
24
23
|
} from 'ordering-components-external'
|
|
25
24
|
|
|
26
25
|
import {
|
|
@@ -76,7 +75,6 @@ const AddressListUI = (props) => {
|
|
|
76
75
|
const [addressOpen, setAddressOpen] = useState(false)
|
|
77
76
|
const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
|
|
78
77
|
const theme = useTheme()
|
|
79
|
-
const [orderingTheme] = useOrderingTheme()
|
|
80
78
|
const [{ user }] = useCustomer()
|
|
81
79
|
const { width } = useWindowSize()
|
|
82
80
|
const isCompletedLayout = width < 769 || isProfile
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useRef } from 'react'
|
|
2
|
-
import { useLanguage, useUtils, useOrder, useConfig, useSession,
|
|
2
|
+
import { useLanguage, useUtils, useOrder, useConfig, useSession, BusinessController as BusinessSingleCard } from 'ordering-components-external'
|
|
3
3
|
import Skeleton from 'react-loading-skeleton'
|
|
4
4
|
import { Heart as DisLike, HeartFill as Like } from 'react-bootstrap-icons'
|
|
5
5
|
import { useTheme } from 'styled-components'
|
|
@@ -73,14 +73,12 @@ const BusinessControllerUI = (props) => {
|
|
|
73
73
|
const [{ auth }, { login }] = useSession()
|
|
74
74
|
const [{ parsePrice, parseDistance, optimizeImage }] = useUtils()
|
|
75
75
|
const [orderState] = useOrder()
|
|
76
|
-
const [orderingTheme] = useOrderingTheme()
|
|
77
76
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
78
77
|
const [isModalOpen, setIsModalOpen] = useState(false)
|
|
79
78
|
const [modalPageToShow, setModalPageToShow] = useState(null)
|
|
80
79
|
|
|
81
80
|
const favoriteRef = useRef(null)
|
|
82
|
-
|
|
83
|
-
const businessRows = orderingTheme?.theme?.business_listing_view?.components?.layout?.rows
|
|
81
|
+
const businessRows = theme?.business_listing_view?.components?.layout?.rows
|
|
84
82
|
const hideBusinessLogo = theme?.business_listing_view?.components?.business?.components?.logo?.hidden
|
|
85
83
|
const hideBusinessFee = theme?.business_listing_view?.components?.business?.components?.fee?.hidden
|
|
86
84
|
const hideBusinessTime = theme?.business_listing_view?.components?.business?.components?.time?.hidden
|
|
@@ -11,7 +11,7 @@ export const BussinessTitle = styled.div`
|
|
|
11
11
|
z-index: 1000;
|
|
12
12
|
display: inline-flex;
|
|
13
13
|
width: 50%;
|
|
14
|
-
background:
|
|
14
|
+
background: ${(props) => props.theme?.colors?.backgroundPage};
|
|
15
15
|
align-items: center;
|
|
16
16
|
margin-left: 10px;
|
|
17
17
|
margin-bottom: 10px;
|
|
@@ -76,7 +76,7 @@ export const Information = styled.div`
|
|
|
76
76
|
|
|
77
77
|
export const BusinessContent = styled.div`
|
|
78
78
|
padding: 0 10px;
|
|
79
|
-
background:
|
|
79
|
+
background: ${props => props.theme.colors.backgroundPage};
|
|
80
80
|
@media(min-width: 768px){
|
|
81
81
|
padding: 0 20px;
|
|
82
82
|
padding-top: 30px;
|
|
@@ -34,7 +34,9 @@ import {
|
|
|
34
34
|
Day,
|
|
35
35
|
DayName,
|
|
36
36
|
DayNumber,
|
|
37
|
-
ClosedBusinessMsg
|
|
37
|
+
ClosedBusinessMsg,
|
|
38
|
+
CheckIcon,
|
|
39
|
+
CheckedIcon
|
|
38
40
|
} from './styles'
|
|
39
41
|
import { BusinessMenuList } from '../BusinessMenuList'
|
|
40
42
|
import { Swiper, SwiperSlide } from 'swiper/react'
|
|
@@ -44,6 +46,7 @@ import SwiperCore, {
|
|
|
44
46
|
import 'swiper/swiper-bundle.min.css'
|
|
45
47
|
import 'swiper/swiper.min.css'
|
|
46
48
|
import { getTimes } from '../../../../../utils'
|
|
49
|
+
import CgRadioCheck from '@meronex/icons/cg/CgRadioCheck'
|
|
47
50
|
|
|
48
51
|
SwiperCore.use([Navigation])
|
|
49
52
|
|
|
@@ -61,11 +64,15 @@ const BusinessPreorderUI = (props) => {
|
|
|
61
64
|
handleAsap,
|
|
62
65
|
isProfessional,
|
|
63
66
|
isDisabled,
|
|
64
|
-
maxDays
|
|
67
|
+
maxDays,
|
|
68
|
+
hoursList,
|
|
69
|
+
cateringPreorder,
|
|
70
|
+
preorderLeadTime,
|
|
71
|
+
getActualSchedule
|
|
65
72
|
} = props
|
|
66
73
|
|
|
67
74
|
const { pathname } = useLocation()
|
|
68
|
-
const [{ optimizeImage }] = useUtils()
|
|
75
|
+
const [{ optimizeImage, parseTime }] = useUtils()
|
|
69
76
|
const theme = useTheme()
|
|
70
77
|
const [{ configs }] = useConfig()
|
|
71
78
|
const [orderState] = useOrder()
|
|
@@ -124,17 +131,51 @@ const BusinessPreorderUI = (props) => {
|
|
|
124
131
|
}
|
|
125
132
|
|
|
126
133
|
useEffect(() => {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
134
|
+
if (cateringPreorder) {
|
|
135
|
+
const schedule = business && getActualSchedule()
|
|
136
|
+
if (!schedule && cateringPreorder && Object.keys(business)?.length > 0) {
|
|
137
|
+
setIsEnabled(false)
|
|
138
|
+
return
|
|
139
|
+
}
|
|
140
|
+
const _timeLists = hoursList
|
|
141
|
+
.filter(hour => (Object.keys(business || {})?.length === 0 || schedule?.lapses?.some(lapse =>
|
|
142
|
+
moment(dateSelected + ` ${hour.startTime}`) >= moment(dateSelected + ` ${lapse.open.hour}:${lapse.open.minute}`).add(preorderLeadTime, 'minutes') && moment(dateSelected + ` ${hour.endTime}`) <= moment(dateSelected + ` ${lapse.close.hour}:${lapse.close.minute}`))) &&
|
|
143
|
+
moment(dateSelected + ` ${hour.startTime}`) < moment(dateSelected + ` ${hour.endTime}`) &&
|
|
144
|
+
(moment().add(preorderLeadTime, 'minutes') < moment(dateSelected + ` ${hour.startTime}`) || !cateringPreorder))
|
|
145
|
+
.map(hour => {
|
|
146
|
+
return {
|
|
147
|
+
value: hour.startTime,
|
|
148
|
+
text: is12Hours ? (
|
|
149
|
+
hour.startTime.includes('12')
|
|
150
|
+
? `${hour.startTime}PM`
|
|
151
|
+
: parseTime(moment(hour.startTime, 'HH:mm'), { outputFormat: 'hh:mma' })
|
|
152
|
+
) : (
|
|
153
|
+
parseTime(moment(hour.startTime, 'HH:mm'), { outputFormat: 'HH:mm' })
|
|
154
|
+
),
|
|
155
|
+
endText: is12Hours ? (
|
|
156
|
+
hour.endTime.includes('12')
|
|
157
|
+
? `${hour.endTime}PM`
|
|
158
|
+
: parseTime(moment(hour.endTime, 'HH:mm'), { outputFormat: 'hh:mma' })
|
|
159
|
+
) : (
|
|
160
|
+
parseTime(moment(hour.endTime, 'HH:mm'), { outputFormat: 'HH:mm' })
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
})
|
|
164
|
+
setIsEnabled(true)
|
|
165
|
+
setTimeList(_timeLists)
|
|
166
|
+
} else {
|
|
167
|
+
const selectedMenu = menu ? (menu?.use_business_schedule ? business : menu) : business
|
|
168
|
+
const _times = getTimeList(dateSelected, selectedMenu)
|
|
169
|
+
setTimeList(_times)
|
|
170
|
+
}
|
|
171
|
+
}, [dateSelected, menu, business, cateringPreorder, hoursList])
|
|
131
172
|
|
|
132
173
|
useEffect(() => {
|
|
133
174
|
if (type === 'business_hours') setMenu(null)
|
|
134
175
|
}, [type])
|
|
135
176
|
|
|
136
177
|
useEffect(() => {
|
|
137
|
-
if (pathname.includes('store') || isProfessional) return
|
|
178
|
+
if (pathname.includes('store') || isProfessional || cateringPreorder) return
|
|
138
179
|
handleAsap && handleAsap()
|
|
139
180
|
}, [])
|
|
140
181
|
|
|
@@ -147,7 +188,7 @@ const BusinessPreorderUI = (props) => {
|
|
|
147
188
|
<p>{business.name}</p>
|
|
148
189
|
</LogoWrapper>
|
|
149
190
|
)}
|
|
150
|
-
{!isProfessional && isPreOrderSetting && (
|
|
191
|
+
{!isProfessional && isPreOrderSetting && !cateringPreorder && (
|
|
151
192
|
<PreorderTypeWrapper>
|
|
152
193
|
<p>{t('PREORDER_TYPE', 'Preorder type')}</p>
|
|
153
194
|
<SelectWrapper>
|
|
@@ -232,8 +273,18 @@ const BusinessPreorderUI = (props) => {
|
|
|
232
273
|
isDisabled={isDisabled}
|
|
233
274
|
isProfessional={isProfessional}
|
|
234
275
|
busyTime={isProfessional && isBusyTime(business, getMomentTime(time.value))}
|
|
276
|
+
cateringPreorder={cateringPreorder}
|
|
235
277
|
>
|
|
236
|
-
<span>
|
|
278
|
+
<span>
|
|
279
|
+
{cateringPreorder && (
|
|
280
|
+
<CheckIcon>
|
|
281
|
+
{timeSelected === time.value ? <CheckedIcon cateringPreorder={cateringPreorder} /> : <CgRadioCheck />}
|
|
282
|
+
</CheckIcon>
|
|
283
|
+
)}
|
|
284
|
+
<p>
|
|
285
|
+
{time.text} {cateringPreorder && `- ${time.endText}`}
|
|
286
|
+
</p>
|
|
287
|
+
</span>
|
|
237
288
|
</TimeItem>
|
|
238
289
|
))}
|
|
239
290
|
</>
|