ordering-ui-external 14.1.62 → 14.1.63
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/{7.ordering-ui.b098ef0ec96cf1136826.js → 7.ordering-ui.60635f39724f9e8adc72.js} +1 -1
- package/_bundles/ordering-ui.60635f39724f9e8adc72.js +2 -0
- package/_modules/themes/five/src/components/SignUpForm/index.js +14 -11
- package/package.json +2 -2
- package/src/themes/five/src/components/SignUpForm/index.js +8 -5
- package/_bundles/ordering-ui.b098ef0ec96cf1136826.js +0 -2
- /package/_bundles/{0.ordering-ui.b098ef0ec96cf1136826.js → 0.ordering-ui.60635f39724f9e8adc72.js} +0 -0
- /package/_bundles/{1.ordering-ui.b098ef0ec96cf1136826.js → 1.ordering-ui.60635f39724f9e8adc72.js} +0 -0
- /package/_bundles/{2.ordering-ui.b098ef0ec96cf1136826.js → 2.ordering-ui.60635f39724f9e8adc72.js} +0 -0
- /package/_bundles/{4.ordering-ui.b098ef0ec96cf1136826.js → 4.ordering-ui.60635f39724f9e8adc72.js} +0 -0
- /package/_bundles/{5.ordering-ui.b098ef0ec96cf1136826.js → 5.ordering-ui.60635f39724f9e8adc72.js} +0 -0
- /package/_bundles/{6.ordering-ui.b098ef0ec96cf1136826.js → 6.ordering-ui.60635f39724f9e8adc72.js} +0 -0
- /package/_bundles/{7.ordering-ui.b098ef0ec96cf1136826.js.LICENSE.txt → 7.ordering-ui.60635f39724f9e8adc72.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.b098ef0ec96cf1136826.js → 8.ordering-ui.60635f39724f9e8adc72.js} +0 -0
- /package/_bundles/{9.ordering-ui.b098ef0ec96cf1136826.js → 9.ordering-ui.60635f39724f9e8adc72.js} +0 -0
- /package/_bundles/{ordering-ui.b098ef0ec96cf1136826.js.LICENSE.txt → ordering-ui.60635f39724f9e8adc72.js.LICENSE.txt} +0 -0
|
@@ -52,7 +52,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
52
52
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
53
53
|
var notValidationFields = ['coupon', 'driver_tip', 'mobile_phone', 'address', 'address_notes'];
|
|
54
54
|
var SignUpFormUI = function SignUpFormUI(props) {
|
|
55
|
-
var _configs$facebook_log, _configs$facebook_log2,
|
|
55
|
+
var _configs$facebook_log, _configs$facebook_log2, _optimizationLoad$res, _optimizationLoad$res2, _optimizationLoad$res3, _validationFields$fie, _validationFields$fie2, _configs$verification, _configs$google_login, _configs$facebook_log3, _configs$facebook_log4, _configs$facebook_id, _configs$google_login2, _configs$google_login3, _configs$google_login4, _configs$apple_login_, _props$beforeElements, _props$beforeComponen, _props$beforeMidEleme, _props$beforeMidCompo, _validationFields$fie7, _validationFields$fie8, _formMethods$errors8, _formMethods$errors9, _formMethods$errors10, _formMethods$errors11, _formMethods$errors12, _formMethods$errors13, _formMethods$errors14, _formMethods$errors15, _props$afterMidElemen, _props$afterMidCompon, _configs$terms_and_co, _formMethods$errors16, _formMethods$errors17, _configs$terms_and_co2, _configs$business_sig, _configs$driver_signu, _configs$business_sig2, _configs$driver_signu2, _configs$facebook_id2, _configs$facebook_id3, _configs$apple_login_2, _configs$google_login5, _configs$google_login6, _configs$google_login7, _props$afterComponent, _props$afterElements;
|
|
56
56
|
var handleChangeInput = props.handleChangeInput,
|
|
57
57
|
handleButtonSignupClick = props.handleButtonSignupClick,
|
|
58
58
|
handleReCaptcha = props.handleReCaptcha,
|
|
@@ -99,6 +99,12 @@ var SignUpFormUI = function SignUpFormUI(props) {
|
|
|
99
99
|
var _useEvent = (0, _orderingComponentsExternal.useEvent)(),
|
|
100
100
|
_useEvent2 = _slicedToArray(_useEvent, 1),
|
|
101
101
|
events = _useEvent2[0];
|
|
102
|
+
var _useOptimizationLoad = (0, _orderingComponentsExternal.useOptimizationLoad)(),
|
|
103
|
+
_useOptimizationLoad2 = _slicedToArray(_useOptimizationLoad, 1),
|
|
104
|
+
optimizationLoad = _useOptimizationLoad2[0];
|
|
105
|
+
var _useSession = (0, _orderingComponentsExternal.useSession)(),
|
|
106
|
+
_useSession2 = _slicedToArray(_useSession, 2),
|
|
107
|
+
login = _useSession2[1].login;
|
|
102
108
|
var _useState = (0, _react.useState)({
|
|
103
109
|
open: false,
|
|
104
110
|
content: []
|
|
@@ -116,13 +122,10 @@ var SignUpFormUI = function SignUpFormUI(props) {
|
|
|
116
122
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
117
123
|
reCaptchaVersion = _useState4[0],
|
|
118
124
|
setRecaptchaVersion = _useState4[1];
|
|
119
|
-
var _useSession = (0, _orderingComponentsExternal.useSession)(),
|
|
120
|
-
_useSession2 = _slicedToArray(_useSession, 2),
|
|
121
|
-
login = _useSession2[1].login;
|
|
122
125
|
var isFacebookLogin = (configs === null || configs === void 0 || (_configs$facebook_log = configs.facebook_login) === null || _configs$facebook_log === void 0 ? void 0 : _configs$facebook_log.value) === 'true' || (configs === null || configs === void 0 || (_configs$facebook_log2 = configs.facebook_login) === null || _configs$facebook_log2 === void 0 ? void 0 : _configs$facebook_log2.value) === '1';
|
|
123
|
-
var googleLoginEnabled = (
|
|
124
|
-
var facebookLoginEnabled = (
|
|
125
|
-
var appleLoginEnabled = (
|
|
126
|
+
var googleLoginEnabled = (optimizationLoad === null || optimizationLoad === void 0 || (_optimizationLoad$res = optimizationLoad.result) === null || _optimizationLoad$res === void 0 || (_optimizationLoad$res = _optimizationLoad$res.configs) === null || _optimizationLoad$res === void 0 || (_optimizationLoad$res = _optimizationLoad$res.google_login_enabled) === null || _optimizationLoad$res === void 0 ? void 0 : _optimizationLoad$res.value) === '1';
|
|
127
|
+
var facebookLoginEnabled = (optimizationLoad === null || optimizationLoad === void 0 || (_optimizationLoad$res2 = optimizationLoad.result) === null || _optimizationLoad$res2 === void 0 || (_optimizationLoad$res2 = _optimizationLoad$res2.configs) === null || _optimizationLoad$res2 === void 0 || (_optimizationLoad$res2 = _optimizationLoad$res2.facebook_login_enabled) === null || _optimizationLoad$res2 === void 0 ? void 0 : _optimizationLoad$res2.value) === '1';
|
|
128
|
+
var appleLoginEnabled = (optimizationLoad === null || optimizationLoad === void 0 || (_optimizationLoad$res3 = optimizationLoad.result) === null || _optimizationLoad$res3 === void 0 || (_optimizationLoad$res3 = _optimizationLoad$res3.configs) === null || _optimizationLoad$res3 === void 0 || (_optimizationLoad$res3 = _optimizationLoad$res3.apple_login_enabled) === null || _optimizationLoad$res3 === void 0 ? void 0 : _optimizationLoad$res3.value) === '1';
|
|
126
129
|
var _useCountdownTimer = (0, _useCountdownTimer3.useCountdownTimer)(600, !(checkPhoneCodeState !== null && checkPhoneCodeState !== void 0 && checkPhoneCodeState.loading) && willVerifyOtpState),
|
|
127
130
|
_useCountdownTimer2 = _slicedToArray(_useCountdownTimer, 3),
|
|
128
131
|
otpLeftTime = _useCountdownTimer2[0],
|
|
@@ -149,11 +152,11 @@ var SignUpFormUI = function SignUpFormUI(props) {
|
|
|
149
152
|
setCurrentPhoneNumber = _useState14[1];
|
|
150
153
|
var showInputPhoneNumber = ((_validationFields$fie = validationFields === null || validationFields === void 0 || (_validationFields$fie2 = validationFields.fields) === null || _validationFields$fie2 === void 0 || (_validationFields$fie2 = _validationFields$fie2.checkout) === null || _validationFields$fie2 === void 0 || (_validationFields$fie2 = _validationFields$fie2.cellphone) === null || _validationFields$fie2 === void 0 ? void 0 : _validationFields$fie2.enabled) !== null && _validationFields$fie !== void 0 ? _validationFields$fie : false) || (configs === null || configs === void 0 || (_configs$verification = configs.verification_phone_required) === null || _configs$verification === void 0 ? void 0 : _configs$verification.value) === '1';
|
|
151
154
|
var initParams = {
|
|
152
|
-
client_id: configs === null || configs === void 0 || (_configs$
|
|
155
|
+
client_id: configs === null || configs === void 0 || (_configs$google_login = configs.google_login_client_id) === null || _configs$google_login === void 0 ? void 0 : _configs$google_login.value,
|
|
153
156
|
cookiepolicy: 'single_host_origin',
|
|
154
157
|
scope: 'profile'
|
|
155
158
|
};
|
|
156
|
-
var hasSocialLogin = ((configs === null || configs === void 0 || (_configs$
|
|
159
|
+
var hasSocialLogin = ((configs === null || configs === void 0 || (_configs$facebook_log3 = configs.facebook_login) === null || _configs$facebook_log3 === void 0 ? void 0 : _configs$facebook_log3.value) === 'true' || (configs === null || configs === void 0 || (_configs$facebook_log4 = configs.facebook_login) === null || _configs$facebook_log4 === void 0 ? void 0 : _configs$facebook_log4.value) === '1') && (configs === null || configs === void 0 || (_configs$facebook_id = configs.facebook_id) === null || _configs$facebook_id === void 0 ? void 0 : _configs$facebook_id.value) || (configs === null || configs === void 0 || (_configs$google_login2 = configs.google_login_client_id) === null || _configs$google_login2 === void 0 ? void 0 : _configs$google_login2.value) && (configs === null || configs === void 0 || (_configs$google_login3 = configs.google_login_auth_domain) === null || _configs$google_login3 === void 0 ? void 0 : _configs$google_login3.value) && (configs === null || configs === void 0 || (_configs$google_login4 = configs.google_login_api_key) === null || _configs$google_login4 === void 0 ? void 0 : _configs$google_login4.value) && googleLoginEnabled || (configs === null || configs === void 0 || (_configs$apple_login_ = configs.apple_login_client_id) === null || _configs$apple_login_ === void 0 ? void 0 : _configs$apple_login_.value) && appleLoginEnabled;
|
|
157
160
|
var hasSocialEnabled = googleLoginEnabled || facebookLoginEnabled || appleLoginEnabled;
|
|
158
161
|
var handleSuccessFacebook = function handleSuccessFacebook(user) {
|
|
159
162
|
var _user$session;
|
|
@@ -579,7 +582,7 @@ var SignUpFormUI = function SignUpFormUI(props) {
|
|
|
579
582
|
}, isFacebookLogin && (configs === null || configs === void 0 || (_configs$facebook_id2 = configs.facebook_id) === null || _configs$facebook_id2 === void 0 ? void 0 : _configs$facebook_id2.value) && facebookLoginEnabled && /*#__PURE__*/_react.default.createElement(_FacebookLogin.FacebookLoginButton, {
|
|
580
583
|
appId: configs === null || configs === void 0 || (_configs$facebook_id3 = configs.facebook_id) === null || _configs$facebook_id3 === void 0 ? void 0 : _configs$facebook_id3.value,
|
|
581
584
|
handleSuccessFacebookLogin: handleSuccessFacebook
|
|
582
|
-
}), (configs === null || configs === void 0 || (_configs$
|
|
585
|
+
}), (configs === null || configs === void 0 || (_configs$apple_login_2 = configs.apple_login_client_id) === null || _configs$apple_login_2 === void 0 ? void 0 : _configs$apple_login_2.value) && appleLoginEnabled && /*#__PURE__*/_react.default.createElement(_AppleLogin.AppleLogin, {
|
|
583
586
|
onSuccess: handleSuccessApple,
|
|
584
587
|
onFailure: function onFailure(data) {
|
|
585
588
|
return setAlertState({
|
|
@@ -587,7 +590,7 @@ var SignUpFormUI = function SignUpFormUI(props) {
|
|
|
587
590
|
content: data
|
|
588
591
|
});
|
|
589
592
|
}
|
|
590
|
-
}), (configs === null || configs === void 0 || (_configs$
|
|
593
|
+
}), (configs === null || configs === void 0 || (_configs$google_login5 = configs.google_login_client_id) === null || _configs$google_login5 === void 0 ? void 0 : _configs$google_login5.value) && (configs === null || configs === void 0 || (_configs$google_login6 = configs.google_login_auth_domain) === null || _configs$google_login6 === void 0 ? void 0 : _configs$google_login6.value) && (configs === null || configs === void 0 || (_configs$google_login7 = configs.google_login_api_key) === null || _configs$google_login7 === void 0 ? void 0 : _configs$google_login7.value) && googleLoginEnabled && /*#__PURE__*/_react.default.createElement(_GoogleLogin.GoogleLoginButton, {
|
|
591
594
|
initParams: initParams,
|
|
592
595
|
handleSuccessGoogleLogin: handleSuccessGoogle,
|
|
593
596
|
onFailure: function onFailure(data) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-external",
|
|
3
|
-
"version": "14.1.
|
|
3
|
+
"version": "14.1.63",
|
|
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": "13.1.
|
|
91
|
+
"ordering-components-external": "13.1.6",
|
|
92
92
|
"payment": "^2.4.6",
|
|
93
93
|
"polished": "^3.6.6",
|
|
94
94
|
"react-bootstrap-icons": "^1.7.2",
|
|
@@ -21,7 +21,8 @@ import {
|
|
|
21
21
|
useSession,
|
|
22
22
|
useToast, ToastType,
|
|
23
23
|
ReCaptcha,
|
|
24
|
-
useEvent
|
|
24
|
+
useEvent,
|
|
25
|
+
useOptimizationLoad
|
|
25
26
|
} from 'ordering-components-external'
|
|
26
27
|
import { useCountdownTimer } from '../../../../../hooks/useCountdownTimer'
|
|
27
28
|
import { useRecaptcha } from '../../../../../hooks/useRecaptcha'
|
|
@@ -107,14 +108,16 @@ const SignUpFormUI = (props) => {
|
|
|
107
108
|
const [{ configs }] = useConfig()
|
|
108
109
|
const formMethods = useForm()
|
|
109
110
|
const [events] = useEvent()
|
|
111
|
+
const [optimizationLoad] = useOptimizationLoad()
|
|
112
|
+
const [, { login }] = useSession()
|
|
113
|
+
|
|
110
114
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
111
115
|
const [recaptchaConfig] = useRecaptcha(enableReCaptcha)
|
|
112
116
|
const [reCaptchaVersion, setRecaptchaVersion] = useState({ version: '', siteKey: '' })
|
|
113
|
-
const [, { login }] = useSession()
|
|
114
117
|
const isFacebookLogin = configs?.facebook_login?.value === 'true' || configs?.facebook_login?.value === '1'
|
|
115
|
-
const googleLoginEnabled = configs?.google_login_enabled?.value === '1'
|
|
116
|
-
const facebookLoginEnabled = configs?.facebook_login_enabled?.value === '1'
|
|
117
|
-
const appleLoginEnabled = configs?.apple_login_enabled?.value === '1'
|
|
118
|
+
const googleLoginEnabled = optimizationLoad?.result?.configs?.google_login_enabled?.value === '1'
|
|
119
|
+
const facebookLoginEnabled = optimizationLoad?.result?.configs?.facebook_login_enabled?.value === '1'
|
|
120
|
+
const appleLoginEnabled = optimizationLoad?.result?.configs?.apple_login_enabled?.value === '1'
|
|
118
121
|
|
|
119
122
|
const [otpLeftTime, , resetOtpLeftTime] = useCountdownTimer(600, !checkPhoneCodeState?.loading && willVerifyOtpState)
|
|
120
123
|
const [userPhoneNumber, setUserPhoneNumber] = useState('')
|