ordering-ui-external 1.4.5 → 1.5.1
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.9c913f613f7ccfd32dd9.js → 0.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
- package/_bundles/{1.ordering-ui.9c913f613f7ccfd32dd9.js → 1.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
- package/_bundles/{2.ordering-ui.9c913f613f7ccfd32dd9.js → 2.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
- package/_bundles/{4.ordering-ui.9c913f613f7ccfd32dd9.js → 4.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
- package/_bundles/{5.ordering-ui.9c913f613f7ccfd32dd9.js → 5.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
- package/_bundles/{6.ordering-ui.9c913f613f7ccfd32dd9.js → 6.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
- package/_bundles/{7.ordering-ui.9c913f613f7ccfd32dd9.js → 7.ordering-ui.5de718771fdf8a9bc402.js} +2 -2
- package/_bundles/{7.ordering-ui.9c913f613f7ccfd32dd9.js.LICENSE.txt → 7.ordering-ui.5de718771fdf8a9bc402.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.9c913f613f7ccfd32dd9.js → 8.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
- package/_bundles/{9.ordering-ui.9c913f613f7ccfd32dd9.js → 9.ordering-ui.5de718771fdf8a9bc402.js} +1 -1
- package/_bundles/{ordering-ui.9c913f613f7ccfd32dd9.js → ordering-ui.5de718771fdf8a9bc402.js} +2 -2
- package/_bundles/{ordering-ui.9c913f613f7ccfd32dd9.js.LICENSE.txt → ordering-ui.5de718771fdf8a9bc402.js.LICENSE.txt} +0 -0
- package/_modules/components/LogoutButton/index.js +9 -4
- package/_modules/components/PaymentOptions/index.js +14 -7
- package/_modules/components/SpinnerLoader/styles.js +1 -1
- package/_modules/components/UserProfileForm/index.js +15 -2
- package/_modules/components/UserProfileForm/styles.js +1 -1
- package/_modules/hooks/useRecaptcha.js +62 -0
- package/_modules/themes/five/src/components/AddressForm/styles.js +3 -3
- package/_modules/themes/five/src/components/AddressList/index.js +1 -1
- package/_modules/themes/five/src/components/AddressList/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +5 -5
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +12 -10
- package/_modules/themes/five/src/components/BusinessController/index.js +6 -4
- package/_modules/themes/five/src/components/BusinessController/styles.js +10 -4
- package/_modules/themes/five/src/components/BusinessListingSearch/index.js +21 -6
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +6 -17
- package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +3 -4
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +11 -3
- package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +2 -2
- package/_modules/themes/five/src/components/BusinessReviews/index.js +16 -8
- package/_modules/themes/five/src/components/BusinessReviews/styles.js +6 -4
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +58 -34
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +40 -23
- package/_modules/themes/five/src/components/DriverTips/styles.js +1 -1
- package/_modules/themes/five/src/components/Footer/index.js +2 -1
- package/_modules/themes/five/src/components/Footer/styles.js +1 -1
- package/_modules/themes/five/src/components/Header/index.js +18 -11
- package/_modules/themes/five/src/components/Header/styles.js +7 -7
- package/_modules/themes/five/src/components/HomeHero/index.js +0 -15
- package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +116 -31
- package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +36 -37
- package/_modules/themes/five/src/components/LoginForm/index.js +62 -21
- package/_modules/themes/five/src/components/LoginForm/styles.js +1 -1
- package/_modules/themes/five/src/components/Messages/index.js +19 -3
- package/_modules/themes/five/src/components/MultiOrdersDetails/styles.js +6 -6
- package/_modules/themes/five/src/components/MyOrders/index.js +4 -4
- package/_modules/themes/five/src/components/NavigationBar/index.js +145 -34
- package/_modules/themes/five/src/components/NavigationBar/styles.js +1 -1
- package/_modules/themes/five/src/components/OrderDetails/index.js +46 -7
- package/_modules/themes/five/src/components/OrderDetails/styles.js +11 -3
- package/_modules/themes/five/src/components/PaymentOptionStripe/index.js +2 -14
- package/_modules/themes/five/src/components/PaymentOptions/index.js +23 -16
- package/_modules/themes/five/src/components/PaymentOptions/styles.js +1 -1
- package/_modules/themes/five/src/components/ProductForm/index.js +9 -7
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +10 -4
- package/_modules/themes/five/src/components/ProductItemAccordion/styles.js +11 -3
- package/_modules/themes/five/src/components/ProductShare/ProductCopyURL.js +61 -0
- package/_modules/themes/five/src/components/ProductShare/index.js +107 -0
- package/_modules/themes/five/src/components/ProductShare/styles.js +40 -0
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -2
- package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +18 -16
- package/_modules/themes/five/src/components/ReviewProduct/index.js +5 -3
- package/_modules/themes/five/src/components/ReviewProduct/styles.js +19 -3
- package/_modules/themes/five/src/components/SearchProducts/index.js +13 -2
- package/_modules/themes/five/src/components/SignUpApproval/index.js +6 -6
- package/_modules/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js +57 -17
- package/_modules/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js +57 -17
- package/_modules/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +57 -17
- package/_modules/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +57 -17
- package/_modules/themes/five/src/components/SignUpForm/index.js +60 -20
- package/_modules/themes/five/src/components/SignUpForm/styles.js +2 -2
- package/_modules/themes/five/src/components/SingleProductCard/index.js +36 -2
- package/_modules/themes/five/src/components/UserProfileForm/index.js +105 -8
- package/_modules/themes/five/src/components/UserProfileForm/styles.js +30 -17
- package/_modules/utils/index.js +26 -11
- package/index-template.js +11 -1
- package/package.json +2 -2
- package/src/components/LogoutButton/index.js +10 -8
- package/src/components/PaymentOptions/index.js +16 -11
- package/src/components/SpinnerLoader/styles.js +1 -0
- package/src/components/UserProfileForm/index.js +12 -2
- package/src/components/UserProfileForm/styles.js +1 -1
- package/src/hooks/useRecaptcha.js +40 -0
- package/src/themes/five/src/components/AddressForm/styles.js +3 -2
- package/src/themes/five/src/components/AddressList/index.js +1 -1
- package/src/themes/five/src/components/AddressList/styles.js +2 -2
- package/src/themes/five/src/components/BusinessBasicInformation/index.js +74 -71
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +69 -20
- package/src/themes/five/src/components/BusinessController/index.js +3 -1
- package/src/themes/five/src/components/BusinessController/styles.js +8 -0
- package/src/themes/five/src/components/BusinessListingSearch/index.js +16 -1
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +6 -18
- package/src/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
- package/src/themes/five/src/components/BusinessProductsListing/index.js +2 -0
- package/src/themes/five/src/components/BusinessProductsListing/styles.js +2 -3
- package/src/themes/five/src/components/BusinessReviews/index.js +17 -10
- package/src/themes/five/src/components/BusinessReviews/styles.js +7 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +64 -19
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +99 -1
- package/src/themes/five/src/components/DriverTips/styles.js +1 -1
- package/src/themes/five/src/components/Footer/index.js +9 -5
- package/src/themes/five/src/components/Footer/styles.js +2 -6
- package/src/themes/five/src/components/Header/index.js +16 -8
- package/src/themes/five/src/components/Header/styles.js +49 -8
- package/src/themes/five/src/components/HomeHero/index.js +0 -6
- package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +163 -60
- package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +145 -82
- package/src/themes/five/src/components/LoginForm/index.js +30 -4
- package/src/themes/five/src/components/LoginForm/styles.js +8 -0
- package/src/themes/five/src/components/Messages/index.js +8 -2
- package/src/themes/five/src/components/MultiOrdersDetails/styles.js +34 -1
- package/src/themes/five/src/components/MyOrders/index.js +4 -4
- package/src/themes/five/src/components/NavigationBar/index.js +153 -39
- package/src/themes/five/src/components/NavigationBar/styles.js +2 -2
- package/src/themes/five/src/components/OrderDetails/index.js +45 -8
- package/src/themes/five/src/components/OrderDetails/styles.js +50 -0
- package/src/themes/five/src/components/PaymentOptionStripe/index.js +2 -14
- package/src/themes/five/src/components/PaymentOptions/index.js +13 -7
- package/src/themes/five/src/components/PaymentOptions/styles.js +5 -0
- package/src/themes/five/src/components/ProductForm/index.js +9 -7
- package/src/themes/five/src/components/ProductItemAccordion/index.js +67 -53
- package/src/themes/five/src/components/ProductItemAccordion/styles.js +26 -0
- package/src/themes/five/src/components/ProductShare/ProductCopyURL.js +53 -0
- package/src/themes/five/src/components/ProductShare/index.js +104 -0
- package/src/themes/five/src/components/ProductShare/styles.js +165 -0
- package/src/themes/five/src/components/RenderProductsLayout/index.js +2 -8
- package/src/themes/five/src/components/RenderProductsLayout/styles.js +5 -0
- package/src/themes/five/src/components/ReviewProduct/index.js +10 -3
- package/src/themes/five/src/components/ReviewProduct/styles.js +43 -0
- package/src/themes/five/src/components/SearchProducts/index.js +16 -3
- package/src/themes/five/src/components/SignUpApproval/index.js +8 -7
- package/src/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js +26 -2
- package/src/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js +26 -2
- package/src/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +26 -2
- package/src/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +26 -2
- package/src/themes/five/src/components/SignUpForm/index.js +26 -1
- package/src/themes/five/src/components/SignUpForm/styles.js +9 -2
- package/src/themes/five/src/components/SingleProductCard/index.js +26 -1
- package/src/themes/five/src/components/UserPopover/index.js +1 -1
- package/src/themes/five/src/components/UserProfileForm/index.js +83 -5
- package/src/themes/five/src/components/UserProfileForm/styles.js +49 -0
- package/src/utils/index.js +36 -9
- package/template/app.js +12 -11
- package/template/assets/images/amex.svg +30 -0
- package/template/assets/images/diners.svg +16 -0
- package/template/assets/images/discover.svg +17 -0
- package/template/assets/images/jcb.svg +33 -0
- package/template/assets/images/unionpay.svg +25 -0
- package/template/components/HelmetTags/index.js +1 -1
- package/template/components/ScrollToTop/index.js +7 -5
- package/template/pages/BusinessProductsList/index.js +8 -4
- package/template/pages/MyOrders/index.js +4 -1
- package/template/pages/OrderDetails/index.js +11 -2
- package/template/pages/Profile/index.js +8 -2
|
@@ -10,6 +10,7 @@ var _orderingComponentsExternal = require("ordering-components-external");
|
|
|
10
10
|
var _SearchBar = require("../SearchBar");
|
|
11
11
|
var _styledComponents = require("styled-components");
|
|
12
12
|
var _BusinessProductsList = require("../BusinessProductsList");
|
|
13
|
+
var _groceries = require("../BusinessProductsList/layouts/groceries");
|
|
13
14
|
var _styles = require("./styles");
|
|
14
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -24,8 +25,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
24
25
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
25
26
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
26
27
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
28
|
+
var layoutOne = 'groceries';
|
|
27
29
|
var SearchProducts = function SearchProducts(props) {
|
|
28
|
-
var _theme$images, _theme$images$logos, _theme$defaultLanguag, _theme$defaultLanguag2;
|
|
30
|
+
var _configs$use_parent_c, _configs$use_parent_c2, _theme$images, _theme$images$logos, _theme$defaultLanguag, _theme$defaultLanguag2;
|
|
29
31
|
var onClose = props.onClose,
|
|
30
32
|
searchValue = props.searchValue,
|
|
31
33
|
handleChangeSearch = props.handleChangeSearch,
|
|
@@ -39,11 +41,20 @@ var SearchProducts = function SearchProducts(props) {
|
|
|
39
41
|
var _useEvent = (0, _orderingComponentsExternal.useEvent)(),
|
|
40
42
|
_useEvent2 = _slicedToArray(_useEvent, 1),
|
|
41
43
|
events = _useEvent2[0];
|
|
44
|
+
var _useConfig = (0, _orderingComponentsExternal.useConfig)(),
|
|
45
|
+
_useConfig2 = _slicedToArray(_useConfig, 1),
|
|
46
|
+
configs = _useConfig2[0].configs;
|
|
42
47
|
var searchRef = (0, _react.useRef)();
|
|
48
|
+
var isUseParentCategory = (configs === null || configs === void 0 ? void 0 : (_configs$use_parent_c = configs.use_parent_category) === null || _configs$use_parent_c === void 0 ? void 0 : _configs$use_parent_c.value) === 'true' || (configs === null || configs === void 0 ? void 0 : (_configs$use_parent_c2 = configs.use_parent_category) === null || _configs$use_parent_c2 === void 0 ? void 0 : _configs$use_parent_c2.value) === '1';
|
|
49
|
+
var frontLayout = business === null || business === void 0 ? void 0 : business.front_layout;
|
|
50
|
+
var businessLayout = {
|
|
51
|
+
layoutOne: frontLayout === layoutOne && isUseParentCategory
|
|
52
|
+
};
|
|
43
53
|
var handleGoToPage = function handleGoToPage(data) {
|
|
44
54
|
events.emit('go_to_page', data);
|
|
45
55
|
document.body.style.overflowY = 'auto';
|
|
46
56
|
};
|
|
57
|
+
var BusinessLayoutProductsList = businessLayout.layoutOne ? _groceries.BusinessProductsList : _BusinessProductsList.BusinessProductsList;
|
|
47
58
|
(0, _react.useEffect)(function () {
|
|
48
59
|
var _searchRef$current;
|
|
49
60
|
(searchRef === null || searchRef === void 0 ? void 0 : (_searchRef$current = searchRef.current) === null || _searchRef$current === void 0 ? void 0 : _searchRef$current.focus) && searchRef.current.focus();
|
|
@@ -69,7 +80,7 @@ var SearchProducts = function SearchProducts(props) {
|
|
|
69
80
|
forwardRef: searchRef
|
|
70
81
|
})), /*#__PURE__*/_react.default.createElement(_styles.CancelButton, {
|
|
71
82
|
onClick: onClose
|
|
72
|
-
}, t('CANCEL', 'Cancel')))), searchValue && /*#__PURE__*/_react.default.createElement(_styles.BusinessProductsListContainer, null, /*#__PURE__*/_react.default.createElement(_styles.BusinessProductsListWrapper, null, /*#__PURE__*/_react.default.createElement(
|
|
83
|
+
}, t('CANCEL', 'Cancel')))), searchValue && /*#__PURE__*/_react.default.createElement(_styles.BusinessProductsListContainer, null, /*#__PURE__*/_react.default.createElement(_styles.BusinessProductsListWrapper, null, /*#__PURE__*/_react.default.createElement(BusinessLayoutProductsList, _extends({}, props, {
|
|
73
84
|
categories: [{
|
|
74
85
|
id: null,
|
|
75
86
|
name: t('ALL', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag = theme.defaultLanguages) === null || _theme$defaultLanguag === void 0 ? void 0 : _theme$defaultLanguag.ALL) || 'All')
|
|
@@ -32,8 +32,8 @@ var SignUpApproval = function SignUpApproval(props) {
|
|
|
32
32
|
onCancel = props.onCancel;
|
|
33
33
|
var contactEmail = 'support@ordering.co';
|
|
34
34
|
var showDomain = false;
|
|
35
|
-
var logoImgUrl = businessType ===
|
|
36
|
-
var userType = businessType ===
|
|
35
|
+
var logoImgUrl = businessType === 2 ? approvalType === 'automatic' ? (_theme$images = theme.images) === null || _theme$images === void 0 ? void 0 : (_theme$images$general = _theme$images.general) === null || _theme$images$general === void 0 ? void 0 : _theme$images$general.CongratulationApproval : (_theme$images2 = theme.images) === null || _theme$images2 === void 0 ? void 0 : (_theme$images2$genera = _theme$images2.general) === null || _theme$images2$genera === void 0 ? void 0 : _theme$images2$genera.CongratulationNoApproval : approvalType === 'automatic' ? (_theme$images3 = theme.images) === null || _theme$images3 === void 0 ? void 0 : (_theme$images3$genera = _theme$images3.general) === null || _theme$images3$genera === void 0 ? void 0 : _theme$images3$genera.driverCongratulationApproval : (_theme$images4 = theme.images) === null || _theme$images4 === void 0 ? void 0 : (_theme$images4$genera = _theme$images4.general) === null || _theme$images4$genera === void 0 ? void 0 : _theme$images4$genera.driverCongratulationNoApproval;
|
|
36
|
+
var userType = businessType === 2 ? 'business' : 'driver';
|
|
37
37
|
return /*#__PURE__*/_react.default.createElement(_styles.Container, null, /*#__PURE__*/_react.default.createElement(_styles.HeaderSection, null, showDomain && /*#__PURE__*/_react.default.createElement(_styles.Title, null, "Domain or Brand"), /*#__PURE__*/_react.default.createElement(_styles.LogoImage, {
|
|
38
38
|
approvalType: approvalType === 'automatic',
|
|
39
39
|
src: logoImgUrl
|
|
@@ -58,16 +58,16 @@ var SignUpApproval = function SignUpApproval(props) {
|
|
|
58
58
|
href: dashboardLoginUrl,
|
|
59
59
|
target: "_blank",
|
|
60
60
|
rel: "noopener noreferrer"
|
|
61
|
-
}, dashboardUrl)))))) : /*#__PURE__*/_react.default.createElement(_styles.BodySection, null,
|
|
61
|
+
}, dashboardUrl)))))) : /*#__PURE__*/_react.default.createElement(_styles.BodySection, null, userType === 'business' ? /*#__PURE__*/_react.default.createElement(_styles.DescriptionContainer, null, /*#__PURE__*/_react.default.createElement(_styles.Description, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
62
62
|
className: "bigger"
|
|
63
63
|
}, t('YOUR_STORE_UNDER_APPROVAL', 'Your store is under approval'))), /*#__PURE__*/_react.default.createElement(_styles.Description, null, t('BUSINESS_SIGNUP_MESSAGE', 'We will contact you as soon as possible')), /*#__PURE__*/_react.default.createElement(_styles.Description, null, t('FEEL_FREE_CONTACT_US', 'feel free to contact us at '), " ", /*#__PURE__*/_react.default.createElement("a", {
|
|
64
64
|
className: "green-text",
|
|
65
|
-
href: "mailto:".concat(contactEmail)
|
|
65
|
+
href: "mailto:".concat(t('SIGNUP_DRIVER_EMAIL', contactEmail))
|
|
66
66
|
}, contactEmail))) : /*#__PURE__*/_react.default.createElement(_styles.DescriptionContainer, null, /*#__PURE__*/_react.default.createElement(_styles.Description, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
67
67
|
className: "bigger"
|
|
68
68
|
}, t('REQUEST_TO_START_UNDER_APPROVAL', 'Your request to start as a driver is under approval.'))), /*#__PURE__*/_react.default.createElement(_styles.Description, null, t('BUSINESS_SIGNUP_MESSAGE', 'We will contact you as soon as possible')), /*#__PURE__*/_react.default.createElement(_styles.Description, null, t('FEEL_FREE_CONTACT_US', 'feel free to contact us at '), " ", /*#__PURE__*/_react.default.createElement("a", {
|
|
69
69
|
className: "green-text",
|
|
70
|
-
href: "mailto:".concat(contactEmail)
|
|
70
|
+
href: "mailto:".concat(t('SIGNUP_DRIVER_EMAIL', contactEmail))
|
|
71
71
|
}, contactEmail)))), /*#__PURE__*/_react.default.createElement(_styles.FooterSection, null, /*#__PURE__*/_react.default.createElement(_styles.ActionGroup, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
72
72
|
outline: true,
|
|
73
73
|
color: "primary",
|
|
@@ -83,7 +83,7 @@ var SignUpApproval = function SignUpApproval(props) {
|
|
|
83
83
|
}
|
|
84
84
|
}, t('ACCEPT', 'Accept'))), approvalType === 'automatic' && userType === 'business' && /*#__PURE__*/_react.default.createElement(_styles.ContactSection, null, t('CONTACT_US_QUESTIONS', 'If you have some questions do no hestitate to contact us at '), " ", /*#__PURE__*/_react.default.createElement("a", {
|
|
85
85
|
className: "green-text",
|
|
86
|
-
href: "mailto:".concat(contactEmail)
|
|
86
|
+
href: "mailto:".concat(t('SIGNUP_DRIVER_EMAIL', contactEmail))
|
|
87
87
|
}, contactEmail))));
|
|
88
88
|
};
|
|
89
89
|
exports.SignUpApproval = SignUpApproval;
|
package/_modules/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var _Inputs = require("../../../../styles/Inputs");
|
|
|
16
16
|
var _Buttons = require("../../../../styles/Buttons");
|
|
17
17
|
var _Checkbox = require("../../../../../../../styles/Checkbox");
|
|
18
18
|
var _utils = require("../../../../../../../utils");
|
|
19
|
+
var _useRecaptcha3 = require("../../../../../../../hooks/useRecaptcha");
|
|
19
20
|
var _AiOutlineEye = _interopRequireDefault(require("@meronex/icons/ai/AiOutlineEye"));
|
|
20
21
|
var _AiOutlineEyeInvisible = _interopRequireDefault(require("@meronex/icons/ai/AiOutlineEyeInvisible"));
|
|
21
22
|
var _orderingComponentsExternal = require("ordering-components-external");
|
|
@@ -70,19 +71,29 @@ var SignUpBusinessUI = function SignUpBusinessUI(props) {
|
|
|
70
71
|
_useState2 = _slicedToArray(_useState, 2),
|
|
71
72
|
alertState = _useState2[0],
|
|
72
73
|
setAlertState = _useState2[1];
|
|
73
|
-
var
|
|
74
|
-
|
|
74
|
+
var _useRecaptcha = (0, _useRecaptcha3.useRecaptcha)(enableReCaptcha),
|
|
75
|
+
_useRecaptcha2 = _slicedToArray(_useRecaptcha, 1),
|
|
76
|
+
recaptchaConfig = _useRecaptcha2[0];
|
|
77
|
+
var _useState3 = (0, _react.useState)({
|
|
78
|
+
version: '',
|
|
79
|
+
siteKey: ''
|
|
80
|
+
}),
|
|
75
81
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
var
|
|
82
|
+
reCaptchaVersion = _useState4[0],
|
|
83
|
+
setRecaptchaVersion = _useState4[1];
|
|
84
|
+
var emailInput = (0, _react.useRef)(null);
|
|
85
|
+
var _useState5 = (0, _react.useState)(''),
|
|
79
86
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
var _useState7 = (0, _react.useState)(
|
|
87
|
+
userPhoneNumber = _useState6[0],
|
|
88
|
+
setUserPhoneNumber = _useState6[1];
|
|
89
|
+
var _useState7 = (0, _react.useState)(null),
|
|
83
90
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
84
|
-
|
|
85
|
-
|
|
91
|
+
isValidPhoneNumber = _useState8[0],
|
|
92
|
+
setIsValidPhoneNumber = _useState8[1];
|
|
93
|
+
var _useState9 = (0, _react.useState)(false),
|
|
94
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
95
|
+
passwordSee = _useState10[0],
|
|
96
|
+
setPasswordSee = _useState10[1];
|
|
86
97
|
var showInputPhoneNumber = ((_validationFields$fie = validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie2 = validationFields.fields) === null || _validationFields$fie2 === void 0 ? void 0 : (_validationFields$fie3 = _validationFields$fie2.checkout) === null || _validationFields$fie3 === void 0 ? void 0 : (_validationFields$fie4 = _validationFields$fie3.cellphone) === null || _validationFields$fie4 === void 0 ? void 0 : _validationFields$fie4.enabled) !== null && _validationFields$fie !== void 0 ? _validationFields$fie : false) || (configs === null || configs === void 0 ? void 0 : (_configs$verification = configs.verification_phone_required) === null || _configs$verification === void 0 ? void 0 : _configs$verification.value) === '1';
|
|
87
98
|
var togglePasswordView = function togglePasswordView() {
|
|
88
99
|
setPasswordSee(!passwordSee);
|
|
@@ -158,16 +169,36 @@ var SignUpBusinessUI = function SignUpBusinessUI(props) {
|
|
|
158
169
|
}
|
|
159
170
|
};
|
|
160
171
|
(0, _react.useEffect)(function () {
|
|
161
|
-
var _formState$result, _formState$
|
|
172
|
+
var _formState$result, _formState$result4, _formState$result5;
|
|
162
173
|
if (!formState.loading && (_formState$result = formState.result) !== null && _formState$result !== void 0 && _formState$result.error) {
|
|
163
|
-
var _formState$result2;
|
|
174
|
+
var _formState$result2, _formState$result2$re, _formState$result3;
|
|
175
|
+
if (((_formState$result2 = formState.result) === null || _formState$result2 === void 0 ? void 0 : (_formState$result2$re = _formState$result2.result) === null || _formState$result2$re === void 0 ? void 0 : _formState$result2$re[0]) === 'ERROR_AUTH_VERIFICATION_CODE') {
|
|
176
|
+
var _configs$security_rec;
|
|
177
|
+
if (configs !== null && configs !== void 0 && (_configs$security_rec = configs.security_recaptcha_site_key) !== null && _configs$security_rec !== void 0 && _configs$security_rec.value) {
|
|
178
|
+
var _configs$security_rec2;
|
|
179
|
+
setRecaptchaVersion({
|
|
180
|
+
version: 'v2',
|
|
181
|
+
siteKey: configs === null || configs === void 0 ? void 0 : (_configs$security_rec2 = configs.security_recaptcha_site_key) === null || _configs$security_rec2 === void 0 ? void 0 : _configs$security_rec2.value
|
|
182
|
+
});
|
|
183
|
+
setAlertState({
|
|
184
|
+
open: true,
|
|
185
|
+
content: [t('TRY_AGAIN', 'Please try again')]
|
|
186
|
+
});
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
setAlertState({
|
|
190
|
+
open: true,
|
|
191
|
+
content: [t('CONFIG_DOESNOT_RECAPTCHA_KEY', 'the config doesn\'t have recaptcha site key')]
|
|
192
|
+
});
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
164
195
|
setAlertState({
|
|
165
196
|
open: true,
|
|
166
|
-
content: ((_formState$
|
|
197
|
+
content: ((_formState$result3 = formState.result) === null || _formState$result3 === void 0 ? void 0 : _formState$result3.result) || [t('ERROR', 'Error')]
|
|
167
198
|
});
|
|
168
|
-
} else if (!formState.loading && !((_formState$
|
|
169
|
-
var _formState$
|
|
170
|
-
saveCustomerUser && saveCustomerUser((_formState$
|
|
199
|
+
} else if (!formState.loading && !((_formState$result4 = formState.result) !== null && _formState$result4 !== void 0 && _formState$result4.error) && (_formState$result5 = formState.result) !== null && _formState$result5 !== void 0 && _formState$result5.result) {
|
|
200
|
+
var _formState$result6;
|
|
201
|
+
saveCustomerUser && saveCustomerUser((_formState$result6 = formState.result) === null || _formState$result6 === void 0 ? void 0 : _formState$result6.result);
|
|
171
202
|
}
|
|
172
203
|
}, [formState]);
|
|
173
204
|
(0, _react.useEffect)(function () {
|
|
@@ -207,6 +238,14 @@ var SignUpBusinessUI = function SignUpBusinessUI(props) {
|
|
|
207
238
|
handleChangePhoneNumber(externalPhoneNumber, true);
|
|
208
239
|
}
|
|
209
240
|
}, [externalPhoneNumber]);
|
|
241
|
+
(0, _react.useEffect)(function () {
|
|
242
|
+
if (recaptchaConfig !== null && recaptchaConfig !== void 0 && recaptchaConfig.siteKey) {
|
|
243
|
+
setRecaptchaVersion({
|
|
244
|
+
version: recaptchaConfig === null || recaptchaConfig === void 0 ? void 0 : recaptchaConfig.version,
|
|
245
|
+
siteKey: recaptchaConfig === null || recaptchaConfig === void 0 ? void 0 : recaptchaConfig.siteKey
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}, [recaptchaConfig]);
|
|
210
249
|
(0, _react.useEffect)(function () {
|
|
211
250
|
handleChangeInput({
|
|
212
251
|
target: {
|
|
@@ -297,7 +336,8 @@ var SignUpBusinessUI = function SignUpBusinessUI(props) {
|
|
|
297
336
|
height: 43
|
|
298
337
|
}));
|
|
299
338
|
})), props.isRecaptchaEnable && enableReCaptcha && /*#__PURE__*/_react.default.createElement(_styles.ReCaptchaWrapper, null, /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.ReCaptcha, {
|
|
300
|
-
handleReCaptcha: handleReCaptcha
|
|
339
|
+
handleReCaptcha: handleReCaptcha,
|
|
340
|
+
reCaptchaVersion: reCaptchaVersion
|
|
301
341
|
})), (configs === null || configs === void 0 ? void 0 : (_configs$terms_and_co = configs.terms_and_conditions) === null || _configs$terms_and_co === void 0 ? void 0 : _configs$terms_and_co.value) === 'true' && /*#__PURE__*/_react.default.createElement(_styles.TermsConditionWrapper, null, /*#__PURE__*/_react.default.createElement(_Checkbox.Checkbox, {
|
|
302
342
|
name: "acceptTerms",
|
|
303
343
|
ref: formMethods.register({
|
package/_modules/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var _Inputs = require("../../../../styles/Inputs");
|
|
|
16
16
|
var _Buttons = require("../../../../styles/Buttons");
|
|
17
17
|
var _Checkbox = require("../../../../../../../styles/Checkbox");
|
|
18
18
|
var _utils = require("../../../../../../../utils");
|
|
19
|
+
var _useRecaptcha3 = require("../../../../../../../hooks/useRecaptcha");
|
|
19
20
|
var _AiOutlineEye = _interopRequireDefault(require("@meronex/icons/ai/AiOutlineEye"));
|
|
20
21
|
var _AiOutlineEyeInvisible = _interopRequireDefault(require("@meronex/icons/ai/AiOutlineEyeInvisible"));
|
|
21
22
|
var _orderingComponentsExternal = require("ordering-components-external");
|
|
@@ -70,19 +71,29 @@ var SignUpBusinessUI = function SignUpBusinessUI(props) {
|
|
|
70
71
|
_useState2 = _slicedToArray(_useState, 2),
|
|
71
72
|
alertState = _useState2[0],
|
|
72
73
|
setAlertState = _useState2[1];
|
|
73
|
-
var
|
|
74
|
-
|
|
74
|
+
var _useRecaptcha = (0, _useRecaptcha3.useRecaptcha)(enableReCaptcha),
|
|
75
|
+
_useRecaptcha2 = _slicedToArray(_useRecaptcha, 1),
|
|
76
|
+
recaptchaConfig = _useRecaptcha2[0];
|
|
77
|
+
var _useState3 = (0, _react.useState)({
|
|
78
|
+
version: '',
|
|
79
|
+
siteKey: ''
|
|
80
|
+
}),
|
|
75
81
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
var
|
|
82
|
+
reCaptchaVersion = _useState4[0],
|
|
83
|
+
setRecaptchaVersion = _useState4[1];
|
|
84
|
+
var emailInput = (0, _react.useRef)(null);
|
|
85
|
+
var _useState5 = (0, _react.useState)(''),
|
|
79
86
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
var _useState7 = (0, _react.useState)(
|
|
87
|
+
userPhoneNumber = _useState6[0],
|
|
88
|
+
setUserPhoneNumber = _useState6[1];
|
|
89
|
+
var _useState7 = (0, _react.useState)(null),
|
|
83
90
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
84
|
-
|
|
85
|
-
|
|
91
|
+
isValidPhoneNumber = _useState8[0],
|
|
92
|
+
setIsValidPhoneNumber = _useState8[1];
|
|
93
|
+
var _useState9 = (0, _react.useState)(false),
|
|
94
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
95
|
+
passwordSee = _useState10[0],
|
|
96
|
+
setPasswordSee = _useState10[1];
|
|
86
97
|
var showInputPhoneNumber = ((_validationFields$fie = validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie2 = validationFields.fields) === null || _validationFields$fie2 === void 0 ? void 0 : (_validationFields$fie3 = _validationFields$fie2.checkout) === null || _validationFields$fie3 === void 0 ? void 0 : (_validationFields$fie4 = _validationFields$fie3.cellphone) === null || _validationFields$fie4 === void 0 ? void 0 : _validationFields$fie4.enabled) !== null && _validationFields$fie !== void 0 ? _validationFields$fie : false) || (configs === null || configs === void 0 ? void 0 : (_configs$verification = configs.verification_phone_required) === null || _configs$verification === void 0 ? void 0 : _configs$verification.value) === '1';
|
|
87
98
|
var togglePasswordView = function togglePasswordView() {
|
|
88
99
|
setPasswordSee(!passwordSee);
|
|
@@ -158,16 +169,36 @@ var SignUpBusinessUI = function SignUpBusinessUI(props) {
|
|
|
158
169
|
}
|
|
159
170
|
};
|
|
160
171
|
(0, _react.useEffect)(function () {
|
|
161
|
-
var _formState$result, _formState$
|
|
172
|
+
var _formState$result, _formState$result4, _formState$result5;
|
|
162
173
|
if (!formState.loading && (_formState$result = formState.result) !== null && _formState$result !== void 0 && _formState$result.error) {
|
|
163
|
-
var _formState$result2;
|
|
174
|
+
var _formState$result2, _formState$result2$re, _formState$result3;
|
|
175
|
+
if (((_formState$result2 = formState.result) === null || _formState$result2 === void 0 ? void 0 : (_formState$result2$re = _formState$result2.result) === null || _formState$result2$re === void 0 ? void 0 : _formState$result2$re[0]) === 'ERROR_AUTH_VERIFICATION_CODE') {
|
|
176
|
+
var _configs$security_rec;
|
|
177
|
+
if (configs !== null && configs !== void 0 && (_configs$security_rec = configs.security_recaptcha_site_key) !== null && _configs$security_rec !== void 0 && _configs$security_rec.value) {
|
|
178
|
+
var _configs$security_rec2;
|
|
179
|
+
setRecaptchaVersion({
|
|
180
|
+
version: 'v2',
|
|
181
|
+
siteKey: configs === null || configs === void 0 ? void 0 : (_configs$security_rec2 = configs.security_recaptcha_site_key) === null || _configs$security_rec2 === void 0 ? void 0 : _configs$security_rec2.value
|
|
182
|
+
});
|
|
183
|
+
setAlertState({
|
|
184
|
+
open: true,
|
|
185
|
+
content: [t('TRY_AGAIN', 'Please try again')]
|
|
186
|
+
});
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
setAlertState({
|
|
190
|
+
open: true,
|
|
191
|
+
content: [t('CONFIG_DOESNOT_RECAPTCHA_KEY', 'the config doesn\'t have recaptcha site key')]
|
|
192
|
+
});
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
164
195
|
setAlertState({
|
|
165
196
|
open: true,
|
|
166
|
-
content: ((_formState$
|
|
197
|
+
content: ((_formState$result3 = formState.result) === null || _formState$result3 === void 0 ? void 0 : _formState$result3.result) || [t('ERROR', 'Error')]
|
|
167
198
|
});
|
|
168
|
-
} else if (!formState.loading && !((_formState$
|
|
169
|
-
var _formState$
|
|
170
|
-
saveCustomerUser && saveCustomerUser((_formState$
|
|
199
|
+
} else if (!formState.loading && !((_formState$result4 = formState.result) !== null && _formState$result4 !== void 0 && _formState$result4.error) && (_formState$result5 = formState.result) !== null && _formState$result5 !== void 0 && _formState$result5.result) {
|
|
200
|
+
var _formState$result6;
|
|
201
|
+
saveCustomerUser && saveCustomerUser((_formState$result6 = formState.result) === null || _formState$result6 === void 0 ? void 0 : _formState$result6.result);
|
|
171
202
|
}
|
|
172
203
|
}, [formState]);
|
|
173
204
|
(0, _react.useEffect)(function () {
|
|
@@ -207,6 +238,14 @@ var SignUpBusinessUI = function SignUpBusinessUI(props) {
|
|
|
207
238
|
handleChangePhoneNumber(externalPhoneNumber, true);
|
|
208
239
|
}
|
|
209
240
|
}, [externalPhoneNumber]);
|
|
241
|
+
(0, _react.useEffect)(function () {
|
|
242
|
+
if (recaptchaConfig !== null && recaptchaConfig !== void 0 && recaptchaConfig.siteKey) {
|
|
243
|
+
setRecaptchaVersion({
|
|
244
|
+
version: recaptchaConfig === null || recaptchaConfig === void 0 ? void 0 : recaptchaConfig.version,
|
|
245
|
+
siteKey: recaptchaConfig === null || recaptchaConfig === void 0 ? void 0 : recaptchaConfig.siteKey
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}, [recaptchaConfig]);
|
|
210
249
|
(0, _react.useEffect)(function () {
|
|
211
250
|
handleChangeInput({
|
|
212
251
|
target: {
|
|
@@ -293,7 +332,8 @@ var SignUpBusinessUI = function SignUpBusinessUI(props) {
|
|
|
293
332
|
height: 43
|
|
294
333
|
}));
|
|
295
334
|
})), props.isRecaptchaEnable && enableReCaptcha && /*#__PURE__*/_react.default.createElement(_styles.ReCaptchaWrapper, null, /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.ReCaptcha, {
|
|
296
|
-
handleReCaptcha: handleReCaptcha
|
|
335
|
+
handleReCaptcha: handleReCaptcha,
|
|
336
|
+
reCaptchaVersion: reCaptchaVersion
|
|
297
337
|
})), (configs === null || configs === void 0 ? void 0 : (_configs$terms_and_co = configs.terms_and_conditions) === null || _configs$terms_and_co === void 0 ? void 0 : _configs$terms_and_co.value) === 'true' && /*#__PURE__*/_react.default.createElement(_styles.TermsConditionWrapper, null, /*#__PURE__*/_react.default.createElement(_Checkbox.Checkbox, {
|
|
298
338
|
name: "acceptTerms",
|
|
299
339
|
ref: formMethods.register({
|
|
@@ -16,6 +16,7 @@ var _Inputs = require("../../../../styles/Inputs");
|
|
|
16
16
|
var _Buttons = require("../../../../styles/Buttons");
|
|
17
17
|
var _Checkbox = require("../../../../../../../styles/Checkbox");
|
|
18
18
|
var _utils = require("../../../../../../../utils");
|
|
19
|
+
var _useRecaptcha3 = require("../../../../../../../hooks/useRecaptcha");
|
|
19
20
|
var _AiOutlineEye = _interopRequireDefault(require("@meronex/icons/ai/AiOutlineEye"));
|
|
20
21
|
var _AiOutlineEyeInvisible = _interopRequireDefault(require("@meronex/icons/ai/AiOutlineEyeInvisible"));
|
|
21
22
|
var _orderingComponentsExternal = require("ordering-components-external");
|
|
@@ -70,19 +71,29 @@ var SignUpDriverUI = function SignUpDriverUI(props) {
|
|
|
70
71
|
_useState2 = _slicedToArray(_useState, 2),
|
|
71
72
|
alertState = _useState2[0],
|
|
72
73
|
setAlertState = _useState2[1];
|
|
73
|
-
var
|
|
74
|
-
|
|
74
|
+
var _useRecaptcha = (0, _useRecaptcha3.useRecaptcha)(enableReCaptcha),
|
|
75
|
+
_useRecaptcha2 = _slicedToArray(_useRecaptcha, 1),
|
|
76
|
+
recaptchaConfig = _useRecaptcha2[0];
|
|
77
|
+
var _useState3 = (0, _react.useState)({
|
|
78
|
+
version: '',
|
|
79
|
+
siteKey: ''
|
|
80
|
+
}),
|
|
75
81
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
var
|
|
82
|
+
reCaptchaVersion = _useState4[0],
|
|
83
|
+
setRecaptchaVersion = _useState4[1];
|
|
84
|
+
var emailInput = (0, _react.useRef)(null);
|
|
85
|
+
var _useState5 = (0, _react.useState)(''),
|
|
79
86
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
var _useState7 = (0, _react.useState)(
|
|
87
|
+
userPhoneNumber = _useState6[0],
|
|
88
|
+
setUserPhoneNumber = _useState6[1];
|
|
89
|
+
var _useState7 = (0, _react.useState)(null),
|
|
83
90
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
84
|
-
|
|
85
|
-
|
|
91
|
+
isValidPhoneNumber = _useState8[0],
|
|
92
|
+
setIsValidPhoneNumber = _useState8[1];
|
|
93
|
+
var _useState9 = (0, _react.useState)(false),
|
|
94
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
95
|
+
passwordSee = _useState10[0],
|
|
96
|
+
setPasswordSee = _useState10[1];
|
|
86
97
|
var showInputPhoneNumber = ((_validationFields$fie = validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie2 = validationFields.fields) === null || _validationFields$fie2 === void 0 ? void 0 : (_validationFields$fie3 = _validationFields$fie2.checkout) === null || _validationFields$fie3 === void 0 ? void 0 : (_validationFields$fie4 = _validationFields$fie3.cellphone) === null || _validationFields$fie4 === void 0 ? void 0 : _validationFields$fie4.enabled) !== null && _validationFields$fie !== void 0 ? _validationFields$fie : false) || (configs === null || configs === void 0 ? void 0 : (_configs$verification = configs.verification_phone_required) === null || _configs$verification === void 0 ? void 0 : _configs$verification.value) === '1';
|
|
87
98
|
var togglePasswordView = function togglePasswordView() {
|
|
88
99
|
setPasswordSee(!passwordSee);
|
|
@@ -158,16 +169,36 @@ var SignUpDriverUI = function SignUpDriverUI(props) {
|
|
|
158
169
|
}
|
|
159
170
|
};
|
|
160
171
|
(0, _react.useEffect)(function () {
|
|
161
|
-
var _formState$result, _formState$
|
|
172
|
+
var _formState$result, _formState$result4, _formState$result5;
|
|
162
173
|
if (!formState.loading && (_formState$result = formState.result) !== null && _formState$result !== void 0 && _formState$result.error) {
|
|
163
|
-
var _formState$result2;
|
|
174
|
+
var _formState$result2, _formState$result2$re, _formState$result3;
|
|
175
|
+
if (((_formState$result2 = formState.result) === null || _formState$result2 === void 0 ? void 0 : (_formState$result2$re = _formState$result2.result) === null || _formState$result2$re === void 0 ? void 0 : _formState$result2$re[0]) === 'ERROR_AUTH_VERIFICATION_CODE') {
|
|
176
|
+
var _configs$security_rec;
|
|
177
|
+
if (configs !== null && configs !== void 0 && (_configs$security_rec = configs.security_recaptcha_site_key) !== null && _configs$security_rec !== void 0 && _configs$security_rec.value) {
|
|
178
|
+
var _configs$security_rec2;
|
|
179
|
+
setRecaptchaVersion({
|
|
180
|
+
version: 'v2',
|
|
181
|
+
siteKey: configs === null || configs === void 0 ? void 0 : (_configs$security_rec2 = configs.security_recaptcha_site_key) === null || _configs$security_rec2 === void 0 ? void 0 : _configs$security_rec2.value
|
|
182
|
+
});
|
|
183
|
+
setAlertState({
|
|
184
|
+
open: true,
|
|
185
|
+
content: [t('TRY_AGAIN', 'Please try again')]
|
|
186
|
+
});
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
setAlertState({
|
|
190
|
+
open: true,
|
|
191
|
+
content: [t('CONFIG_DOESNOT_RECAPTCHA_KEY', 'the config doesn\'t have recaptcha site key')]
|
|
192
|
+
});
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
164
195
|
setAlertState({
|
|
165
196
|
open: true,
|
|
166
|
-
content: ((_formState$
|
|
197
|
+
content: ((_formState$result3 = formState.result) === null || _formState$result3 === void 0 ? void 0 : _formState$result3.result) || [t('ERROR', 'Error')]
|
|
167
198
|
});
|
|
168
|
-
} else if (!formState.loading && !((_formState$
|
|
169
|
-
var _formState$
|
|
170
|
-
saveCustomerUser && saveCustomerUser((_formState$
|
|
199
|
+
} else if (!formState.loading && !((_formState$result4 = formState.result) !== null && _formState$result4 !== void 0 && _formState$result4.error) && (_formState$result5 = formState.result) !== null && _formState$result5 !== void 0 && _formState$result5.result) {
|
|
200
|
+
var _formState$result6;
|
|
201
|
+
saveCustomerUser && saveCustomerUser((_formState$result6 = formState.result) === null || _formState$result6 === void 0 ? void 0 : _formState$result6.result);
|
|
171
202
|
}
|
|
172
203
|
}, [formState]);
|
|
173
204
|
(0, _react.useEffect)(function () {
|
|
@@ -207,6 +238,14 @@ var SignUpDriverUI = function SignUpDriverUI(props) {
|
|
|
207
238
|
handleChangePhoneNumber(externalPhoneNumber, true);
|
|
208
239
|
}
|
|
209
240
|
}, [externalPhoneNumber]);
|
|
241
|
+
(0, _react.useEffect)(function () {
|
|
242
|
+
if (recaptchaConfig !== null && recaptchaConfig !== void 0 && recaptchaConfig.siteKey) {
|
|
243
|
+
setRecaptchaVersion({
|
|
244
|
+
version: recaptchaConfig === null || recaptchaConfig === void 0 ? void 0 : recaptchaConfig.version,
|
|
245
|
+
siteKey: recaptchaConfig === null || recaptchaConfig === void 0 ? void 0 : recaptchaConfig.siteKey
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}, [recaptchaConfig]);
|
|
210
249
|
(0, _react.useEffect)(function () {
|
|
211
250
|
handleChangeInput({
|
|
212
251
|
target: {
|
|
@@ -297,7 +336,8 @@ var SignUpDriverUI = function SignUpDriverUI(props) {
|
|
|
297
336
|
height: 43
|
|
298
337
|
}));
|
|
299
338
|
})), props.isRecaptchaEnable && enableReCaptcha && /*#__PURE__*/_react.default.createElement(_styles.ReCaptchaWrapper, null, /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.ReCaptcha, {
|
|
300
|
-
handleReCaptcha: handleReCaptcha
|
|
339
|
+
handleReCaptcha: handleReCaptcha,
|
|
340
|
+
reCaptchaVersion: reCaptchaVersion
|
|
301
341
|
})), (configs === null || configs === void 0 ? void 0 : (_configs$terms_and_co = configs.terms_and_conditions) === null || _configs$terms_and_co === void 0 ? void 0 : _configs$terms_and_co.value) === 'true' && /*#__PURE__*/_react.default.createElement(_styles.TermsConditionWrapper, null, /*#__PURE__*/_react.default.createElement(_Checkbox.Checkbox, {
|
|
302
342
|
name: "acceptTerms",
|
|
303
343
|
ref: formMethods.register({
|
|
@@ -16,6 +16,7 @@ var _Inputs = require("../../../../styles/Inputs");
|
|
|
16
16
|
var _Buttons = require("../../../../styles/Buttons");
|
|
17
17
|
var _Checkbox = require("../../../../../../../styles/Checkbox");
|
|
18
18
|
var _utils = require("../../../../../../../utils");
|
|
19
|
+
var _useRecaptcha3 = require("../../../../../../../hooks/useRecaptcha");
|
|
19
20
|
var _AiOutlineEye = _interopRequireDefault(require("@meronex/icons/ai/AiOutlineEye"));
|
|
20
21
|
var _AiOutlineEyeInvisible = _interopRequireDefault(require("@meronex/icons/ai/AiOutlineEyeInvisible"));
|
|
21
22
|
var _orderingComponentsExternal = require("ordering-components-external");
|
|
@@ -70,19 +71,29 @@ var SignUpDriverUI = function SignUpDriverUI(props) {
|
|
|
70
71
|
_useState2 = _slicedToArray(_useState, 2),
|
|
71
72
|
alertState = _useState2[0],
|
|
72
73
|
setAlertState = _useState2[1];
|
|
73
|
-
var
|
|
74
|
-
|
|
74
|
+
var _useRecaptcha = (0, _useRecaptcha3.useRecaptcha)(enableReCaptcha),
|
|
75
|
+
_useRecaptcha2 = _slicedToArray(_useRecaptcha, 1),
|
|
76
|
+
recaptchaConfig = _useRecaptcha2[0];
|
|
77
|
+
var _useState3 = (0, _react.useState)({
|
|
78
|
+
version: '',
|
|
79
|
+
siteKey: ''
|
|
80
|
+
}),
|
|
75
81
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
var
|
|
82
|
+
reCaptchaVersion = _useState4[0],
|
|
83
|
+
setRecaptchaVersion = _useState4[1];
|
|
84
|
+
var emailInput = (0, _react.useRef)(null);
|
|
85
|
+
var _useState5 = (0, _react.useState)(''),
|
|
79
86
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
var _useState7 = (0, _react.useState)(
|
|
87
|
+
userPhoneNumber = _useState6[0],
|
|
88
|
+
setUserPhoneNumber = _useState6[1];
|
|
89
|
+
var _useState7 = (0, _react.useState)(null),
|
|
83
90
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
84
|
-
|
|
85
|
-
|
|
91
|
+
isValidPhoneNumber = _useState8[0],
|
|
92
|
+
setIsValidPhoneNumber = _useState8[1];
|
|
93
|
+
var _useState9 = (0, _react.useState)(false),
|
|
94
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
95
|
+
passwordSee = _useState10[0],
|
|
96
|
+
setPasswordSee = _useState10[1];
|
|
86
97
|
var showInputPhoneNumber = ((_validationFields$fie = validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie2 = validationFields.fields) === null || _validationFields$fie2 === void 0 ? void 0 : (_validationFields$fie3 = _validationFields$fie2.checkout) === null || _validationFields$fie3 === void 0 ? void 0 : (_validationFields$fie4 = _validationFields$fie3.cellphone) === null || _validationFields$fie4 === void 0 ? void 0 : _validationFields$fie4.enabled) !== null && _validationFields$fie !== void 0 ? _validationFields$fie : false) || (configs === null || configs === void 0 ? void 0 : (_configs$verification = configs.verification_phone_required) === null || _configs$verification === void 0 ? void 0 : _configs$verification.value) === '1';
|
|
87
98
|
var togglePasswordView = function togglePasswordView() {
|
|
88
99
|
setPasswordSee(!passwordSee);
|
|
@@ -158,16 +169,36 @@ var SignUpDriverUI = function SignUpDriverUI(props) {
|
|
|
158
169
|
}
|
|
159
170
|
};
|
|
160
171
|
(0, _react.useEffect)(function () {
|
|
161
|
-
var _formState$result, _formState$
|
|
172
|
+
var _formState$result, _formState$result4, _formState$result5;
|
|
162
173
|
if (!formState.loading && (_formState$result = formState.result) !== null && _formState$result !== void 0 && _formState$result.error) {
|
|
163
|
-
var _formState$result2;
|
|
174
|
+
var _formState$result2, _formState$result2$re, _formState$result3;
|
|
175
|
+
if (((_formState$result2 = formState.result) === null || _formState$result2 === void 0 ? void 0 : (_formState$result2$re = _formState$result2.result) === null || _formState$result2$re === void 0 ? void 0 : _formState$result2$re[0]) === 'ERROR_AUTH_VERIFICATION_CODE') {
|
|
176
|
+
var _configs$security_rec;
|
|
177
|
+
if (configs !== null && configs !== void 0 && (_configs$security_rec = configs.security_recaptcha_site_key) !== null && _configs$security_rec !== void 0 && _configs$security_rec.value) {
|
|
178
|
+
var _configs$security_rec2;
|
|
179
|
+
setRecaptchaVersion({
|
|
180
|
+
version: 'v2',
|
|
181
|
+
siteKey: configs === null || configs === void 0 ? void 0 : (_configs$security_rec2 = configs.security_recaptcha_site_key) === null || _configs$security_rec2 === void 0 ? void 0 : _configs$security_rec2.value
|
|
182
|
+
});
|
|
183
|
+
setAlertState({
|
|
184
|
+
open: true,
|
|
185
|
+
content: [t('TRY_AGAIN', 'Please try again')]
|
|
186
|
+
});
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
setAlertState({
|
|
190
|
+
open: true,
|
|
191
|
+
content: [t('CONFIG_DOESNOT_RECAPTCHA_KEY', 'the config doesn\'t have recaptcha site key')]
|
|
192
|
+
});
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
164
195
|
setAlertState({
|
|
165
196
|
open: true,
|
|
166
|
-
content: ((_formState$
|
|
197
|
+
content: ((_formState$result3 = formState.result) === null || _formState$result3 === void 0 ? void 0 : _formState$result3.result) || [t('ERROR', 'Error')]
|
|
167
198
|
});
|
|
168
|
-
} else if (!formState.loading && !((_formState$
|
|
169
|
-
var _formState$
|
|
170
|
-
saveCustomerUser && saveCustomerUser((_formState$
|
|
199
|
+
} else if (!formState.loading && !((_formState$result4 = formState.result) !== null && _formState$result4 !== void 0 && _formState$result4.error) && (_formState$result5 = formState.result) !== null && _formState$result5 !== void 0 && _formState$result5.result) {
|
|
200
|
+
var _formState$result6;
|
|
201
|
+
saveCustomerUser && saveCustomerUser((_formState$result6 = formState.result) === null || _formState$result6 === void 0 ? void 0 : _formState$result6.result);
|
|
171
202
|
}
|
|
172
203
|
}, [formState]);
|
|
173
204
|
(0, _react.useEffect)(function () {
|
|
@@ -207,6 +238,14 @@ var SignUpDriverUI = function SignUpDriverUI(props) {
|
|
|
207
238
|
handleChangePhoneNumber(externalPhoneNumber, true);
|
|
208
239
|
}
|
|
209
240
|
}, [externalPhoneNumber]);
|
|
241
|
+
(0, _react.useEffect)(function () {
|
|
242
|
+
if (recaptchaConfig !== null && recaptchaConfig !== void 0 && recaptchaConfig.siteKey) {
|
|
243
|
+
setRecaptchaVersion({
|
|
244
|
+
version: recaptchaConfig === null || recaptchaConfig === void 0 ? void 0 : recaptchaConfig.version,
|
|
245
|
+
siteKey: recaptchaConfig === null || recaptchaConfig === void 0 ? void 0 : recaptchaConfig.siteKey
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}, [recaptchaConfig]);
|
|
210
249
|
(0, _react.useEffect)(function () {
|
|
211
250
|
handleChangeInput({
|
|
212
251
|
target: {
|
|
@@ -293,7 +332,8 @@ var SignUpDriverUI = function SignUpDriverUI(props) {
|
|
|
293
332
|
height: 43
|
|
294
333
|
}));
|
|
295
334
|
})), props.isRecaptchaEnable && enableReCaptcha && /*#__PURE__*/_react.default.createElement(_styles.ReCaptchaWrapper, null, /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.ReCaptcha, {
|
|
296
|
-
handleReCaptcha: handleReCaptcha
|
|
335
|
+
handleReCaptcha: handleReCaptcha,
|
|
336
|
+
reCaptchaVersion: reCaptchaVersion
|
|
297
337
|
})), (configs === null || configs === void 0 ? void 0 : (_configs$terms_and_co = configs.terms_and_conditions) === null || _configs$terms_and_co === void 0 ? void 0 : _configs$terms_and_co.value) === 'true' && /*#__PURE__*/_react.default.createElement(_styles.TermsConditionWrapper, null, /*#__PURE__*/_react.default.createElement(_Checkbox.Checkbox, {
|
|
298
338
|
name: "acceptTerms",
|
|
299
339
|
ref: formMethods.register({
|