ordering-ui-external 1.6.3 → 1.6.5
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.9399c2752e3ad5f2250b.js → 0.ordering-ui.bc9da3762eb1b844224f.js} +0 -0
- package/_bundles/{1.ordering-ui.9399c2752e3ad5f2250b.js → 1.ordering-ui.bc9da3762eb1b844224f.js} +0 -0
- package/_bundles/{2.ordering-ui.9399c2752e3ad5f2250b.js → 2.ordering-ui.bc9da3762eb1b844224f.js} +0 -0
- package/_bundles/{4.ordering-ui.9399c2752e3ad5f2250b.js → 4.ordering-ui.bc9da3762eb1b844224f.js} +0 -0
- package/_bundles/{5.ordering-ui.9399c2752e3ad5f2250b.js → 5.ordering-ui.bc9da3762eb1b844224f.js} +0 -0
- package/_bundles/{6.ordering-ui.9399c2752e3ad5f2250b.js → 6.ordering-ui.bc9da3762eb1b844224f.js} +0 -0
- package/_bundles/{7.ordering-ui.9399c2752e3ad5f2250b.js → 7.ordering-ui.bc9da3762eb1b844224f.js} +1 -1
- package/_bundles/{7.ordering-ui.9399c2752e3ad5f2250b.js.LICENSE.txt → 7.ordering-ui.bc9da3762eb1b844224f.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.9399c2752e3ad5f2250b.js → 8.ordering-ui.bc9da3762eb1b844224f.js} +0 -0
- package/_bundles/{9.ordering-ui.9399c2752e3ad5f2250b.js → 9.ordering-ui.bc9da3762eb1b844224f.js} +0 -0
- package/_bundles/ordering-ui.bc9da3762eb1b844224f.js +2 -0
- package/_bundles/{ordering-ui.9399c2752e3ad5f2250b.js.LICENSE.txt → ordering-ui.bc9da3762eb1b844224f.js.LICENSE.txt} +0 -0
- package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +31 -14
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +43 -24
- package/_modules/themes/five/src/components/BusinessController/index.js +2 -2
- package/_modules/themes/five/src/components/BusinessController/styles.js +2 -2
- package/_modules/themes/five/src/components/Checkout/index.js +2 -1
- package/_modules/themes/five/src/components/Header/index.js +2 -2
- package/_modules/themes/five/src/components/Header/styles.js +13 -4
- package/_modules/themes/five/src/components/LoginForm/index.js +8 -17
- package/_modules/themes/five/src/components/LoginForm/styles.js +1 -1
- package/_modules/themes/five/src/components/SignUpForm/index.js +7 -13
- package/_modules/themes/five/src/components/SignUpForm/styles.js +33 -33
- package/_modules/themes/five/src/styles/Buttons/index.js +3 -1
- package/_modules/utils/index.js +27 -16
- package/package.json +2 -2
- package/src/themes/five/src/components/BusinessBasicInformation/index.js +95 -73
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +45 -4
- package/src/themes/five/src/components/BusinessController/index.js +3 -3
- package/src/themes/five/src/components/BusinessController/styles.js +2 -2
- package/src/themes/five/src/components/Checkout/index.js +4 -1
- package/src/themes/five/src/components/Header/index.js +2 -2
- package/src/themes/five/src/components/Header/styles.js +40 -0
- package/src/themes/five/src/components/LoginForm/index.js +5 -11
- package/src/themes/five/src/components/LoginForm/styles.js +29 -8
- package/src/themes/five/src/components/SignUpForm/index.js +6 -12
- package/src/themes/five/src/components/SignUpForm/styles.js +3 -1
- package/src/themes/five/src/styles/Buttons/index.js +4 -0
- package/src/utils/index.js +32 -27
- package/_bundles/ordering-ui.9399c2752e3ad5f2250b.js +0 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components'
|
|
2
|
+
import { darken } from 'polished'
|
|
2
3
|
|
|
3
4
|
export const Header = styled.div`
|
|
4
5
|
display: flex;
|
|
@@ -241,6 +242,11 @@ export const MenuLink = styled.a`
|
|
|
241
242
|
color: ${props => props.theme.colors.primaryContrast};
|
|
242
243
|
border-radius: 7.6px;
|
|
243
244
|
padding: 11px 15px;
|
|
245
|
+
|
|
246
|
+
&:hover {
|
|
247
|
+
background: ${props => darken(0.07, props.theme.colors.primary)};
|
|
248
|
+
color: #FFF;
|
|
249
|
+
}
|
|
244
250
|
`}
|
|
245
251
|
`
|
|
246
252
|
|
|
@@ -431,3 +437,37 @@ export const AddressFormWrapper = styled.div`
|
|
|
431
437
|
margin-top: 20px;
|
|
432
438
|
}
|
|
433
439
|
`
|
|
440
|
+
export const InputGroup = styled.div`
|
|
441
|
+
p {
|
|
442
|
+
font-weight: 500;
|
|
443
|
+
font-size: 20px;
|
|
444
|
+
color: ${props => props.theme.colors.darkTextColor};
|
|
445
|
+
width: 100%;
|
|
446
|
+
text-align: left;
|
|
447
|
+
margin: 0 0 7px 0;
|
|
448
|
+
}
|
|
449
|
+
`
|
|
450
|
+
|
|
451
|
+
export const LanguageSelectorWrapper = styled(InputGroup)`
|
|
452
|
+
> div {
|
|
453
|
+
border-radius: 7.6px;
|
|
454
|
+
text-align: left;
|
|
455
|
+
background: #F8F9FA !important;
|
|
456
|
+
border-color: #F8F9FA;
|
|
457
|
+
background-color: #F8F9FA !important;
|
|
458
|
+
height: 44px;
|
|
459
|
+
|
|
460
|
+
> div:first-child {
|
|
461
|
+
height: 44px;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
#list {
|
|
465
|
+
border-radius: 7.6px;
|
|
466
|
+
background: #F8F9FA !important;
|
|
467
|
+
border-color: #F8F9FA;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
#select-input {
|
|
471
|
+
margin: 0px 10px 0 5px;
|
|
472
|
+
}
|
|
473
|
+
`
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
useLanguage,
|
|
10
10
|
useConfig,
|
|
11
11
|
useSession,
|
|
12
|
+
useToast, ToastType,
|
|
12
13
|
ReCaptcha,
|
|
13
14
|
useApi
|
|
14
15
|
} from 'ordering-components-external'
|
|
@@ -88,10 +89,10 @@ const LoginFormUI = (props) => {
|
|
|
88
89
|
useLoginOtpCellphone
|
|
89
90
|
} = props
|
|
90
91
|
const numOtpInputs = loginTab === 'otp' ? 6 : 4
|
|
91
|
-
const otpPlaceholder = [...Array(numOtpInputs)].fill(0).join('')
|
|
92
92
|
const [ordering, { setOrdering }] = useApi()
|
|
93
93
|
const [, t] = useLanguage()
|
|
94
94
|
const theme = useTheme()
|
|
95
|
+
const [, { showToast }] = useToast()
|
|
95
96
|
const [{ configs }] = useConfig()
|
|
96
97
|
const formMethods = useForm()
|
|
97
98
|
const [recaptchaConfig] = useRecaptcha(enableReCaptcha)
|
|
@@ -305,15 +306,9 @@ const LoginFormUI = (props) => {
|
|
|
305
306
|
|
|
306
307
|
useEffect(() => {
|
|
307
308
|
if (checkPhoneCodeState?.result?.error) {
|
|
308
|
-
|
|
309
|
-
open: true,
|
|
310
|
-
content: checkPhoneCodeState?.result?.result || [t('ERROR', 'Error')]
|
|
311
|
-
})
|
|
309
|
+
showToast(ToastType.Error, checkPhoneCodeState?.result?.result || [t('ERROR', 'Error')])
|
|
312
310
|
} else if (checkPhoneCodeState?.result?.result) {
|
|
313
|
-
|
|
314
|
-
open: true,
|
|
315
|
-
content: t('CODE_SENT', 'The code has been sent')
|
|
316
|
-
})
|
|
311
|
+
showToast(ToastType.Success, t('CODE_SENT', 'The code has been sent'))
|
|
317
312
|
resetOtpLeftTime()
|
|
318
313
|
}
|
|
319
314
|
}, [checkPhoneCodeState])
|
|
@@ -516,13 +511,12 @@ const LoginFormUI = (props) => {
|
|
|
516
511
|
numInputs={numOtpInputs}
|
|
517
512
|
containerStyle='otp-container'
|
|
518
513
|
inputStyle='otp-input'
|
|
519
|
-
placeholder={otpPlaceholder}
|
|
520
514
|
isInputNum
|
|
521
515
|
shouldAutoFocus
|
|
522
516
|
/>
|
|
523
517
|
</OtpWrapper>
|
|
524
518
|
<ResendCode disabled={otpLeftTime > 520} onClick={handleSendOtp}>
|
|
525
|
-
{t('
|
|
519
|
+
{t('LANG_SEND_AGAIN', 'Send again')}?
|
|
526
520
|
</ResendCode>
|
|
527
521
|
<Button
|
|
528
522
|
type='button'
|
|
@@ -233,18 +233,18 @@ export const OtpWrapper = styled.div`
|
|
|
233
233
|
.otp-container{
|
|
234
234
|
display: flex;
|
|
235
235
|
justify-content: space-evenly;
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
flex-wrap: wrap;
|
|
237
|
+
margin-bottom: 20px;
|
|
238
|
+
|
|
238
239
|
.otp-input{
|
|
239
|
-
width:
|
|
240
|
-
height:
|
|
241
|
-
|
|
242
|
-
border:
|
|
243
|
-
border-radius: 16px;
|
|
240
|
+
width: 25px !important;
|
|
241
|
+
height: 35px;
|
|
242
|
+
border: 1px solid #CCC;
|
|
243
|
+
border-radius: 8px;
|
|
244
244
|
background-color: #FFF;
|
|
245
245
|
outline: none;
|
|
246
246
|
font-size: 20px;
|
|
247
|
-
font-weight: bold;
|
|
247
|
+
font-weight: bold;
|
|
248
248
|
|
|
249
249
|
&:focus{
|
|
250
250
|
border-color: ${() => darken(0.07, '#CCC')} !important;
|
|
@@ -259,6 +259,27 @@ export const OtpWrapper = styled.div`
|
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
+
@media (min-width: 768px) {
|
|
263
|
+
.otp-container {
|
|
264
|
+
margin: 20px;
|
|
265
|
+
div {
|
|
266
|
+
padding: 10px;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.otp-input {
|
|
270
|
+
width: 80px !important;
|
|
271
|
+
height: 100px;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
@media (min-width: 1024px) {
|
|
276
|
+
.otp-container {
|
|
277
|
+
.otp-input {
|
|
278
|
+
width: 60px !important;
|
|
279
|
+
height: 80px;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
262
283
|
`
|
|
263
284
|
|
|
264
285
|
export const CountdownTimer = styled.div`
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
useLanguage,
|
|
18
18
|
useConfig,
|
|
19
19
|
useSession,
|
|
20
|
+
useToast, ToastType,
|
|
20
21
|
ReCaptcha,
|
|
21
22
|
useEvent
|
|
22
23
|
} from 'ordering-components-external'
|
|
@@ -98,6 +99,7 @@ const SignUpFormUI = (props) => {
|
|
|
98
99
|
useSignUpOtpCellphone
|
|
99
100
|
} = props
|
|
100
101
|
const [, t] = useLanguage()
|
|
102
|
+
const [, { showToast }] = useToast()
|
|
101
103
|
const [{ configs }] = useConfig()
|
|
102
104
|
const formMethods = useForm()
|
|
103
105
|
const [events] = useEvent()
|
|
@@ -110,8 +112,7 @@ const SignUpFormUI = (props) => {
|
|
|
110
112
|
const facebookLoginEnabled = configs?.facebook_login_enabled?.value === '1' || !configs?.facebook_login_enabled?.enabled
|
|
111
113
|
const appleLoginEnabled = configs?.apple_login_enabled?.value === '1' || !configs?.apple_login_enabled?.enabled
|
|
112
114
|
|
|
113
|
-
const
|
|
114
|
-
const [otpLeftTime, _, resetOtpLeftTime] = useCountdownTimer(600, !checkPhoneCodeState?.loading && willVerifyOtpState)
|
|
115
|
+
const [otpLeftTime, , resetOtpLeftTime] = useCountdownTimer(600, !checkPhoneCodeState?.loading && willVerifyOtpState)
|
|
115
116
|
const [userPhoneNumber, setUserPhoneNumber] = useState('')
|
|
116
117
|
const [isValidPhoneNumber, setIsValidPhoneNumber] = useState(null)
|
|
117
118
|
const [passwordSee, setPasswordSee] = useState(false)
|
|
@@ -310,15 +311,9 @@ const SignUpFormUI = (props) => {
|
|
|
310
311
|
|
|
311
312
|
useEffect(() => {
|
|
312
313
|
if (checkPhoneCodeState?.result?.error) {
|
|
313
|
-
|
|
314
|
-
open: true,
|
|
315
|
-
content: checkPhoneCodeState?.result?.result || [t('ERROR', 'Error')]
|
|
316
|
-
})
|
|
314
|
+
showToast(ToastType.Error, checkPhoneCodeState?.result?.result || [t('ERROR', 'Error')])
|
|
317
315
|
} else if (checkPhoneCodeState?.result?.result && checkPhoneCodeState?.result?.result?.[0] === 'VERIFICATION_CODE_WAS_SENT_TO') {
|
|
318
|
-
|
|
319
|
-
open: true,
|
|
320
|
-
content: t('CODE_SENT', 'The code has been sent')
|
|
321
|
-
})
|
|
316
|
+
showToast(ToastType.Success, t('CODE_SENT', 'The code has been sent'))
|
|
322
317
|
resetOtpLeftTime()
|
|
323
318
|
}
|
|
324
319
|
}, [checkPhoneCodeState])
|
|
@@ -613,13 +608,12 @@ const SignUpFormUI = (props) => {
|
|
|
613
608
|
numInputs={numOtpInputs || 6}
|
|
614
609
|
containerStyle='otp-container'
|
|
615
610
|
inputStyle='otp-input'
|
|
616
|
-
placeholder={otpPlaceholder}
|
|
617
611
|
isInputNum
|
|
618
612
|
shouldAutoFocus
|
|
619
613
|
/>
|
|
620
614
|
</OtpWrapper>
|
|
621
615
|
<ResendCode disabled={otpLeftTime > 520} onClick={handleSendOtp}>
|
|
622
|
-
{t('
|
|
616
|
+
{t('LANG_SEND_AGAIN', 'Send again')}?
|
|
623
617
|
</ResendCode>
|
|
624
618
|
<Button
|
|
625
619
|
type='button'
|
|
@@ -4,7 +4,9 @@ export const SignUpContainer = styled.div`
|
|
|
4
4
|
width: 100%;
|
|
5
5
|
height: 100%;
|
|
6
6
|
display: flex;
|
|
7
|
-
|
|
7
|
+
${({ isPopup }) => !isPopup && css`
|
|
8
|
+
min-height: calc(100vh - 65px);
|
|
9
|
+
`}
|
|
8
10
|
padding: 0 10px;
|
|
9
11
|
box-sizing: border-box;
|
|
10
12
|
|
|
@@ -90,6 +90,10 @@ export const Button = styled.button`
|
|
|
90
90
|
&:active {
|
|
91
91
|
background: ${props => darken(0.07, props.theme.colors.primary)};
|
|
92
92
|
}
|
|
93
|
+
&:hover {
|
|
94
|
+
background: ${props => darken(0.07, props.theme.colors.primary)};
|
|
95
|
+
color: #FFF;
|
|
96
|
+
}
|
|
93
97
|
${({ outline }) => outline && css`
|
|
94
98
|
background: #FFF;
|
|
95
99
|
color: ${props => props.theme.colors.primary};
|
package/src/utils/index.js
CHANGED
|
@@ -132,35 +132,40 @@ export const bytesConverter = bytes => {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
/**
|
|
135
|
-
* Function to get
|
|
135
|
+
* Function to get brightness of color.
|
|
136
136
|
*/
|
|
137
|
-
export const
|
|
137
|
+
export const lightenDarkenColor = (color) => {
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
139
|
+
let r, g, b, hsp;
|
|
140
|
+
if (color.match(/^rgb/)) {
|
|
141
|
+
// If HEX --> store the red, green, blue values in separate variables
|
|
142
|
+
color = color.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);
|
|
143
|
+
|
|
144
|
+
r = color[1];
|
|
145
|
+
g = color[2];
|
|
146
|
+
b = color[3];
|
|
147
|
+
} else {
|
|
148
|
+
// If RGB --> Convert it to HEX
|
|
149
|
+
color = +("0x" + color.slice(1).replace(color.length < 5 && /./g, '$&$&'));
|
|
150
|
+
|
|
151
|
+
r = color >> 16;
|
|
152
|
+
g = color >> 8 & 255;
|
|
153
|
+
b = color & 255;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// HSP (Highly Sensitive Poo) equation
|
|
157
|
+
hsp = Math.sqrt(
|
|
158
|
+
0.299 * (r * r) +
|
|
159
|
+
0.587 * (g * g) +
|
|
160
|
+
0.114 * (b * b)
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
// Using the HSP value, determine whether the color is light or dark
|
|
164
|
+
if (hsp > 197) {
|
|
165
|
+
return true; //is light color
|
|
166
|
+
} else {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
164
169
|
}
|
|
165
170
|
|
|
166
171
|
/**
|