ordering-ui-admin-external 1.6.2 → 1.6.4

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.
Files changed (175) hide show
  1. package/_bundles/main.css +134 -129
  2. package/_bundles/{ordering-ui-admin.488bdda58ba73188d3b5.js → ordering-ui-admin.e16bb3bc2dee43d1cf23.js} +2 -2
  3. package/_bundles/{ordering-ui-admin.488bdda58ba73188d3b5.js.LICENSE.txt → ordering-ui-admin.e16bb3bc2dee43d1cf23.js.LICENSE.txt} +4 -4
  4. package/_modules/components/BusinessIntelligence/Reports/index.js +1 -1
  5. package/_modules/components/CartRecovery/OpenCartsFilterGroup/index.js +1 -1
  6. package/_modules/components/CartRecovery/RecoveryActionHeader/index.js +1 -1
  7. package/_modules/components/Delivery/AddressForm/index.js +1 -1
  8. package/_modules/components/Delivery/DriversCompaniesListing/index.js +1 -1
  9. package/_modules/components/Delivery/DriversGroupLogs/index.js +2 -2
  10. package/_modules/components/Delivery/DriversGroupsListing/index.js +1 -1
  11. package/_modules/components/Home/HomePage/index.js +38 -6
  12. package/_modules/components/Home/HomePage/styles.js +31 -5
  13. package/_modules/components/LanguageSelector/index.js +1 -1
  14. package/_modules/components/Login/LoginForm/index.js +119 -20
  15. package/_modules/components/Login/LoginForm/styles.js +60 -30
  16. package/_modules/components/Loyalty/RewardsPrograms/index.js +1 -1
  17. package/_modules/components/Marketing/CampaignSignUpOption/index.js +1 -1
  18. package/_modules/components/Marketing/EnterprisePromotionListing/index.js +1 -1
  19. package/_modules/components/Messages/MessagesListing/styles.js +1 -1
  20. package/_modules/components/MyProducts/AppLayout/index.js +75 -0
  21. package/_modules/components/MyProducts/AppLayout/styles.js +41 -0
  22. package/_modules/components/MyProducts/CallCenterApp/index.js +42 -0
  23. package/_modules/components/MyProducts/ContentForm/index.js +245 -0
  24. package/_modules/components/MyProducts/ContentForm/styles.js +32 -0
  25. package/_modules/components/MyProducts/CustomerApp/index.js +18 -25
  26. package/_modules/components/MyProducts/DriverApp/index.js +18 -45
  27. package/_modules/components/MyProducts/KioskApp/index.js +42 -0
  28. package/_modules/components/MyProducts/OrderingWebsite/index.js +352 -3
  29. package/_modules/components/MyProducts/OrderingWebsite/styles.js +54 -3
  30. package/_modules/components/MyProducts/PosApp/index.js +42 -0
  31. package/_modules/components/MyProducts/StoreApp/index.js +18 -45
  32. package/_modules/components/MyProducts/index.js +22 -1
  33. package/_modules/components/OrderingProducts/OrderingProductDetails/index.js +6 -8
  34. package/_modules/components/OrderingProducts/SiteTheme/index.js +13 -4
  35. package/_modules/components/Orders/DeliveriesManager/index.js +6 -0
  36. package/_modules/components/Orders/DriversManager/index.js +7 -1
  37. package/_modules/components/Orders/GoogleMapsApiKeySettingButton/index.js +110 -0
  38. package/_modules/components/{MyProducts/CustomerApp/styles.js → Orders/GoogleMapsApiKeySettingButton/style.js} +9 -13
  39. package/_modules/components/Orders/Messages/styles.js +3 -3
  40. package/_modules/components/Orders/OrderContactInformation/index.js +7 -7
  41. package/_modules/components/Orders/OrdersContentHeader/index.js +4 -2
  42. package/_modules/components/Orders/OrdersManager/index.js +3 -2
  43. package/_modules/components/Profile/ProfilePage/index.js +2 -1
  44. package/_modules/components/Profile/ProfilePage/styles.js +2 -2
  45. package/_modules/components/Profile/Sessions/index.js +209 -0
  46. package/_modules/components/Profile/Sessions/styles.js +46 -0
  47. package/_modules/components/Profile/index.js +8 -1
  48. package/_modules/components/Settings/EmailSetting/index.js +2 -29
  49. package/_modules/components/Settings/PageForm/index.js +6 -1
  50. package/_modules/components/Settings/Settings/index.js +0 -62
  51. package/_modules/components/Shared/CitySelector/index.js +9 -1
  52. package/_modules/components/Shared/Modal/index.js +5 -3
  53. package/_modules/components/Shared/Modal/styles.js +25 -23
  54. package/_modules/components/SidebarMenu/index.js +132 -76
  55. package/_modules/components/SidebarMenu/styles.js +4 -2
  56. package/_modules/components/Stores/AddBusinessForm/index.js +22 -8
  57. package/_modules/components/Stores/BusinessBrandGENDetail/index.js +6 -1
  58. package/_modules/components/Stores/BusinessProductList/styles.js +1 -1
  59. package/_modules/components/Stores/BusinessProductsCategories/styles.js +1 -1
  60. package/_modules/components/Stores/BusinessProductsCategoyInfo/index.js +6 -1
  61. package/_modules/components/Stores/BusinessProductsListing/index.js +35 -8
  62. package/_modules/components/Stores/BusinessProductsListing/styles.js +6 -4
  63. package/_modules/components/Stores/BusinessSelectHeader/index.js +17 -9
  64. package/_modules/components/Stores/BusinessSelectHeader/styles.js +1 -1
  65. package/_modules/components/Stores/BusinessSummary/index.js +21 -8
  66. package/_modules/components/Stores/BusinessSummary/styles.js +5 -3
  67. package/_modules/components/Stores/BusinessSync/index.js +6 -2
  68. package/_modules/components/Stores/BusinessSyncItsaCheckmate/index.js +52 -0
  69. package/_modules/components/Stores/BusinessSyncItsaCheckmate/styles.js +31 -0
  70. package/_modules/components/Support/index.js +1 -1
  71. package/_modules/hooks/useCountdownTimer.js +40 -0
  72. package/_modules/index.js +18 -0
  73. package/_modules/utils/index.js +65 -4
  74. package/index-template.js +49 -8
  75. package/package.json +3 -2
  76. package/src/components/BusinessIntelligence/Reports/index.js +1 -1
  77. package/src/components/CartRecovery/OpenCartsFilterGroup/index.js +1 -1
  78. package/src/components/CartRecovery/RecoveryActionHeader/index.js +1 -1
  79. package/src/components/Delivery/AddressForm/index.js +1 -1
  80. package/src/components/Delivery/DriversCompaniesListing/index.js +1 -1
  81. package/src/components/Delivery/DriversGroupLogs/index.js +1 -1
  82. package/src/components/Delivery/DriversGroupsListing/index.js +1 -1
  83. package/src/components/Home/HomePage/index.js +74 -7
  84. package/src/components/Home/HomePage/styles.js +62 -1
  85. package/src/components/LanguageSelector/index.js +1 -1
  86. package/src/components/Login/LoginForm/index.js +211 -94
  87. package/src/components/Login/LoginForm/styles.js +74 -8
  88. package/src/components/Loyalty/RewardsPrograms/index.js +1 -1
  89. package/src/components/Marketing/CampaignSignUpOption/index.js +1 -1
  90. package/src/components/Marketing/EnterprisePromotionListing/index.js +1 -1
  91. package/src/components/Messages/MessagesListing/styles.js +3 -5
  92. package/src/components/MyProducts/AppLayout/index.js +97 -0
  93. package/src/components/MyProducts/AppLayout/styles.js +145 -0
  94. package/src/components/MyProducts/CallCenterApp/index.js +29 -0
  95. package/src/components/MyProducts/ContentForm/index.js +240 -0
  96. package/src/components/MyProducts/ContentForm/styles.js +67 -0
  97. package/src/components/MyProducts/CustomerApp/index.js +17 -41
  98. package/src/components/MyProducts/DriverApp/index.js +16 -70
  99. package/src/components/MyProducts/KioskApp/index.js +29 -0
  100. package/src/components/MyProducts/OrderingWebsite/index.js +455 -25
  101. package/src/components/MyProducts/OrderingWebsite/styles.js +235 -0
  102. package/src/components/MyProducts/PosApp/index.js +29 -0
  103. package/src/components/MyProducts/StoreApp/index.js +16 -70
  104. package/src/components/MyProducts/index.js +7 -1
  105. package/src/components/OrderingProducts/OrderingProductDetails/index.js +4 -4
  106. package/src/components/OrderingProducts/SiteTheme/index.js +8 -0
  107. package/src/components/Orders/DeliveriesManager/index.js +5 -1
  108. package/src/components/Orders/DriversManager/index.js +7 -1
  109. package/src/components/Orders/GoogleMapsApiKeySettingButton/index.js +94 -0
  110. package/src/components/Orders/GoogleMapsApiKeySettingButton/style.js +38 -0
  111. package/src/components/Orders/Messages/styles.js +6 -0
  112. package/src/components/Orders/OrderContactInformation/index.js +1 -1
  113. package/src/components/Orders/OrdersContentHeader/index.js +6 -1
  114. package/src/components/Orders/OrdersManager/index.js +2 -1
  115. package/src/components/Profile/ProfilePage/index.js +2 -0
  116. package/src/components/Profile/ProfilePage/styles.js +2 -1
  117. package/src/components/Profile/Sessions/index.js +209 -0
  118. package/src/components/Profile/Sessions/styles.js +132 -0
  119. package/src/components/Profile/index.js +3 -1
  120. package/src/components/Settings/EmailSetting/index.js +0 -32
  121. package/src/components/Settings/PageForm/index.js +3 -0
  122. package/src/components/Settings/Settings/index.js +0 -65
  123. package/src/components/Shared/CitySelector/index.js +8 -0
  124. package/src/components/Shared/Modal/index.js +32 -26
  125. package/src/components/Shared/Modal/styles.js +11 -3
  126. package/src/components/SidebarMenu/index.js +92 -70
  127. package/src/components/SidebarMenu/styles.js +8 -1
  128. package/src/components/Stores/AddBusinessForm/index.js +10 -8
  129. package/src/components/Stores/BusinessBrandGENDetail/index.js +3 -0
  130. package/src/components/Stores/BusinessProductList/styles.js +1 -1
  131. package/src/components/Stores/BusinessProductsCategories/styles.js +1 -1
  132. package/src/components/Stores/BusinessProductsCategoyInfo/index.js +3 -0
  133. package/src/components/Stores/BusinessProductsListing/index.js +35 -1
  134. package/src/components/Stores/BusinessProductsListing/styles.js +9 -1
  135. package/src/components/Stores/BusinessSelectHeader/index.js +14 -2
  136. package/src/components/Stores/BusinessSelectHeader/styles.js +5 -0
  137. package/src/components/Stores/BusinessSummary/index.js +27 -10
  138. package/src/components/Stores/BusinessSummary/styles.js +7 -0
  139. package/src/components/Stores/BusinessSync/index.js +7 -2
  140. package/src/components/Stores/BusinessSyncItsaCheckmate/index.js +63 -0
  141. package/src/components/Stores/BusinessSyncItsaCheckmate/styles.js +88 -0
  142. package/src/components/Support/index.js +1 -1
  143. package/src/hooks/useCountdownTimer.js +26 -0
  144. package/src/index.js +7 -1
  145. package/src/utils/index.js +61 -0
  146. package/template/app.js +14 -12
  147. package/template/assets/images/ItsaCheckmateLogo.png +0 -0
  148. package/template/assets/images/door-dash.png +0 -0
  149. package/template/assets/images/myProducts/driver-app-brand.png +0 -0
  150. package/template/assets/images/myProducts/driver-app-free.png +0 -0
  151. package/template/assets/images/myProducts/multi-store-customer-app.png +0 -0
  152. package/template/assets/images/myProducts/my-callcenter-app-brand.png +0 -0
  153. package/template/assets/images/myProducts/my-callcenter-app-live.png +0 -0
  154. package/template/assets/images/myProducts/my-kiosk-app-brand.png +0 -0
  155. package/template/assets/images/myProducts/my-kiosk-app-live.png +0 -0
  156. package/template/assets/images/myProducts/my-pos-app-brand.png +0 -0
  157. package/template/assets/images/myProducts/my-pos-app-live.png +0 -0
  158. package/template/assets/images/myProducts/single-store-customer-app.png +0 -0
  159. package/template/assets/images/myProducts/store-app-brand.png +0 -0
  160. package/template/assets/images/myProducts/store-app-free.png +0 -0
  161. package/template/assets/images/projectStatuses/project-active.png +0 -0
  162. package/template/assets/images/projectStatuses/project-past-due-payment.png +0 -0
  163. package/template/components/AutologinParams/index.js +79 -0
  164. package/template/components/ListenPageChanges/index.js +3 -2
  165. package/template/config.json +1 -0
  166. package/template/helmetdata.json +21 -0
  167. package/template/pages/CallCenterApp/index.js +12 -0
  168. package/template/pages/KioskApp/index.js +12 -0
  169. package/template/pages/PosApp/index.js +12 -0
  170. package/template/theme.json +3 -0
  171. package/_modules/components/MyProducts/DriverApp/styles.js +0 -29
  172. package/_modules/components/MyProducts/StoreApp/styles.js +0 -29
  173. package/src/components/MyProducts/CustomerApp/styles.js +0 -59
  174. package/src/components/MyProducts/DriverApp/styles.js +0 -104
  175. package/src/components/MyProducts/StoreApp/styles.js +0 -104
@@ -1,4 +1,6 @@
1
1
  import styled, { css } from 'styled-components'
2
+ import { lighten } from 'polished'
3
+
2
4
  export const HomeContainer = styled.div`
3
5
  flex: 1;
4
6
  padding: 20px;
@@ -52,6 +54,7 @@ export const Breadcrumb = styled.div`
52
54
  }
53
55
  `
54
56
  export const HeaderContainer = styled.div`
57
+ margin-bottom: 25px;
55
58
  `
56
59
  export const WelcomeMsg = styled.h1`
57
60
  font-weight: bold;
@@ -64,7 +67,6 @@ export const WelcomeMsg = styled.h1`
64
67
  export const GuideMsg = styled.p`
65
68
  font-size: 16px;
66
69
  color: ${props => props.theme.colors.headingColor};
67
- margin-bottom: 25px;
68
70
  `
69
71
  export const Reports = styled.div`
70
72
  display: flex;
@@ -422,3 +424,62 @@ export const ButtonWrapper = styled.div`
422
424
  justify-content: center;
423
425
  margin-top: 20px;
424
426
  `
427
+
428
+ export const ProjectStatusContainer = styled.div`
429
+ box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);
430
+ border-radius: 8px;
431
+ display: flex;
432
+ flex-direction: column;
433
+ align-items: center;
434
+ margin-bottom: 60px;
435
+
436
+ > img {
437
+ max-height: 250px;
438
+ }
439
+
440
+ @media (min-width: 768px) {
441
+ flex-direction: row;
442
+ justify-content: space-between;
443
+ }
444
+ `
445
+ export const ProjectInfoWrapper = styled.div`
446
+ padding: 20px 30px;
447
+ `
448
+ export const GreetingText = styled.h1`
449
+ font-size: 32px;
450
+ font-weight: 700;
451
+ line-height: 48px;
452
+ margin: 0;
453
+ `
454
+ export const ProjectStatusDescription = styled.p`
455
+ font-size: 16px;
456
+ line-height: 24px;
457
+ `
458
+ export const ProjectCurrentStatus = styled.div`
459
+ width: fit-content;
460
+ /* margin-top: 15px; */
461
+ padding: 10px 16px;
462
+ border-radius: 8px;
463
+ font-size: 14px;
464
+ line-height: 24px;
465
+ color: ${props => props.theme.colors.warning};
466
+ background-color: ${(props) => lighten(0.4, props.theme.colors.warning)};
467
+ ${({ isActive }) => isActive && css`
468
+ color: ${props => props.theme.colors.success};
469
+ background-color: ${(props) => lighten(0.5, props.theme.colors.success)};
470
+ `}
471
+ `
472
+
473
+ export const ProjectStatusWrapper = styled.div`
474
+ display: flex;
475
+ align-items: center;
476
+
477
+ > button {
478
+ height: 44px;
479
+ margin-left: 15px;
480
+ ${props => props.theme.rtl && css`
481
+ margin-right: 15px;
482
+ margin-left: 0px;
483
+ `}
484
+ }
485
+ `
@@ -30,7 +30,7 @@ const LanguageSelectorUI = (props) => {
30
30
  <SelectWrapper>
31
31
  <Globe2 />
32
32
  <Select
33
- optionInnerMaxHeight='60vh'
33
+ optionInnerMaxHeight='300px'
34
34
  options={languagesState?.loading ? defaultLanguages : _languages}
35
35
  defaultValue={languagesState?.loading ? defaultCurrentLanguage : currentLanguage}
36
36
  onChange={(languageId) => handleChangeLanguage(languageId, true)}
@@ -8,14 +8,17 @@ import {
8
8
  useApi,
9
9
  useConfig
10
10
  } from 'ordering-components-admin-external'
11
+ import { useCountdownTimer } from '../../../hooks/useCountdownTimer'
11
12
  import { Alert } from '../../Shared'
12
13
  import BsArrowRightShort from '@meronex/icons/bs/BsArrowRightShort'
13
14
  import MdExitToApp from '@meronex/icons/md/MdExitToApp'
14
- import { Button, Input, Tabs, Tab } from '../../../styles'
15
+ import { Button, Input } from '../../../styles'
15
16
  import { useTheme } from 'styled-components'
16
17
  import HiOutlineMail from '@meronex/icons/hi/HiOutlineMail'
17
18
  import RiLockPasswordLine from '@meronex/icons/ri/RiLockPasswordLine'
18
19
  import { Eye, EyeSlash } from 'react-bootstrap-icons'
20
+ import OtpInput from 'react-otp-input'
21
+ import { formatSeconds } from '../../../utils'
19
22
 
20
23
  import {
21
24
  LoginContainer,
@@ -28,15 +31,19 @@ import {
28
31
  InputWithIcon,
29
32
  WrapperPassword,
30
33
  TogglePassword,
31
- ReCAPTCHAWrapper
34
+ ReCAPTCHAWrapper,
35
+ Tabs,
36
+ Tab,
37
+ CountdownTimer,
38
+ OtpWrapper,
39
+ ResendCode
32
40
  } from './styles'
33
41
 
34
42
  const LoginFormUI = (props) => {
35
43
  const {
36
- useLoginByEmail,
44
+ useLoginOtpEmail,
37
45
  useLoginByCellphone,
38
46
  handleChangeInput,
39
- hanldeChangeTab,
40
47
  handleButtonLoginClick,
41
48
  elementLinkToSignup,
42
49
  elementLinkToForgotPassword,
@@ -45,7 +52,14 @@ const LoginFormUI = (props) => {
45
52
  isPopup,
46
53
  isReCaptchaEnable,
47
54
  handleReCaptcha,
48
- useProjectDomain
55
+ useProjectDomain,
56
+ checkPhoneCodeState,
57
+ otpType,
58
+ setOtpType,
59
+ handleChangeTab,
60
+ generateOtpCode,
61
+ otpState,
62
+ setOtpState
49
63
  } = props
50
64
  const [, t] = useLanguage()
51
65
  const [ordering] = useApi()
@@ -58,6 +72,15 @@ const LoginFormUI = (props) => {
58
72
  const [reCaptchaVersion, setRecaptchaVersion] = useState({ version: 'v3', siteKey: '' })
59
73
  const [submitted, setSubmitted] = useState(false)
60
74
  const [passwordSee, setPasswordSee] = useState(false)
75
+ const [loginWithOtpState, setLoginWithOtpState] = useState(false)
76
+ const [willVerifyOtpState, setWillVerifyOtpState] = useState(false)
77
+
78
+ const numOtpInputs = loginTab === 'otp' ? 6 : 4
79
+ const otpPlaceholder = [...Array(numOtpInputs)].fill(0).join('')
80
+ const [otpLeftTime, , resetOtpLeftTime] = useCountdownTimer(
81
+ 600, !checkPhoneCodeState?.loading && willVerifyOtpState)
82
+
83
+ const isOtpEmail = loginTab === 'otp' && otpType === 'email'
61
84
 
62
85
  const onSubmit = () => {
63
86
  setSubmitted(true)
@@ -73,9 +96,30 @@ const LoginFormUI = (props) => {
73
96
  }, 750)
74
97
  }
75
98
 
99
+ const handleChangeOtpType = (type) => {
100
+ handleChangeTab('otp')
101
+ setOtpType(type)
102
+ }
103
+
104
+ const handleSendOtp = () => {
105
+ if (willVerifyOtpState) {
106
+ setOtpState('')
107
+ resetOtpLeftTime()
108
+ if (loginTab === 'otp') {
109
+ generateOtpCode()
110
+ setWillVerifyOtpState(true)
111
+ }
112
+ }
113
+ }
114
+
76
115
  useEffect(() => {
77
116
  if (ordering.project === null || !submitted) return
78
- handleButtonLoginClick()
117
+ if (loginTab === 'otp') {
118
+ generateOtpCode()
119
+ setWillVerifyOtpState(true)
120
+ } else {
121
+ handleButtonLoginClick()
122
+ }
79
123
  }, [ordering, submitted])
80
124
 
81
125
  useEffect(() => {
@@ -111,8 +155,41 @@ const LoginFormUI = (props) => {
111
155
  open: false,
112
156
  content: []
113
157
  })
158
+ setOtpState('')
114
159
  }
115
160
 
161
+ useEffect(() => {
162
+ if (otpState?.length === numOtpInputs) {
163
+ if (loginTab === 'otp') {
164
+ handleButtonLoginClick()
165
+ }
166
+ }
167
+ }, [otpState])
168
+
169
+ useEffect(() => {
170
+ if (checkPhoneCodeState?.result?.error) {
171
+ setAlertState({
172
+ open: true,
173
+ content: checkPhoneCodeState?.result?.result || [t('ERROR', 'Error')]
174
+ })
175
+ } else if (checkPhoneCodeState?.result?.result) {
176
+ setAlertState({
177
+ open: true,
178
+ content: t('CODE_SENT', 'The code has been sent')
179
+ })
180
+ resetOtpLeftTime()
181
+ }
182
+ }, [checkPhoneCodeState])
183
+
184
+ useEffect(() => {
185
+ if (otpLeftTime === 0) {
186
+ setAlertState({
187
+ open: true,
188
+ content: t('TIME_IS_UP_PLEASE_RESEND_CODE', 'Time is up. Please resend code again')
189
+ })
190
+ }
191
+ }, [otpLeftTime])
192
+
116
193
  useEffect(() => {
117
194
  if (configs && Object.keys(configs).length > 0 && configs?.security_recaptcha_auth?.value === '1') {
118
195
  if (configs?.security_recaptcha_type?.value === 'v3' &&
@@ -152,100 +229,96 @@ const LoginFormUI = (props) => {
152
229
  </p>
153
230
  </TitleFormSide>
154
231
 
155
- {useLoginByEmail && useLoginByCellphone && (
156
- <LoginWith isPopup={isPopup}>
157
- <Tabs variant='primary'>
158
- {useLoginByEmail && (
159
- <Tab
160
- onClick={() => hanldeChangeTab('email')}
161
- active={loginTab === 'email'}
162
- >
163
- {t('LOGIN_WITH_EMAIL', 'Login with Email')}
164
- </Tab>
165
- )}
166
- {useLoginByCellphone && (
167
- <Tab
168
- onClick={() => hanldeChangeTab('cellphone')}
169
- active={loginTab === 'cellphone'}
170
- >
171
- {t('LOGIN_WITH_CELLPHONE', 'Login with Cellphone')}
172
- </Tab>
173
- )}
232
+ {(ordering?.project && useLoginOtpEmail) && !loginWithOtpState && !willVerifyOtpState && (
233
+ <LoginWith>
234
+ <Tabs>
235
+ <Tab
236
+ onClick={() => handleChangeTab('email')}
237
+ active={loginTab === 'email'}
238
+ >
239
+ {t('LOGIN_WITH_EMAIL', 'Login with Email')}
240
+ </Tab>
241
+ <Tab
242
+ onClick={() => handleChangeOtpType('email')}
243
+ active={isOtpEmail}
244
+ >
245
+ {t('BY_OTP_EMAIL', 'by Otp Email')}
246
+ </Tab>
174
247
  </Tabs>
175
248
  </LoginWith>
176
249
  )}
177
250
 
178
- {(useLoginByCellphone || useLoginByEmail) && (
179
- <FormInput
180
- noValidate
181
- isPopup={isPopup}
182
- onSubmit={handleSubmit(onSubmit)}
183
- >
184
- {!useProjectDomain && (
185
- <InputWithIcon>
186
- <Input
187
- type='text'
188
- name='project'
189
- aria-label='project'
190
- placeholder={t('PROJECT', 'Project')}
191
- ref={register({
192
- required: t(
193
- 'VALIDATION_ERROR_REQUIRED',
194
- 'Project is required'
195
- ).replace('_attribute_', t('PROJECT', 'Project'))
196
- })}
197
- onChange={(e) => hanldeChangeProject(e)}
198
- autoComplete='off'
199
- autoCapitalize='off'
200
- />
201
- <MdExitToApp />
202
- </InputWithIcon>
203
- )}
251
+ <FormInput
252
+ noValidate
253
+ isPopup={isPopup}
254
+ onSubmit={handleSubmit(onSubmit)}
255
+ >
256
+ {!willVerifyOtpState && (
257
+ <InputWithIcon>
258
+ <Input
259
+ type='text'
260
+ name='project'
261
+ aria-label='project'
262
+ placeholder={t('PROJECT', 'Project')}
263
+ ref={register({
264
+ required: t(
265
+ 'VALIDATION_ERROR_REQUIRED',
266
+ 'Project is required'
267
+ ).replace('_attribute_', t('PROJECT', 'Project'))
268
+ })}
269
+ onChange={(e) => hanldeChangeProject(e)}
270
+ autoComplete='off'
271
+ autoCapitalize='off'
272
+ />
273
+ <MdExitToApp />
274
+ </InputWithIcon>
275
+ )}
204
276
 
205
- {useLoginByEmail && loginTab === 'email' && (
206
- <InputWithIcon>
207
- <Input
208
- type='email'
209
- name='email'
210
- aria-label='email'
211
- placeholder={t('EMAIL')}
212
- ref={register({
213
- required: t(
214
- 'VALIDATION_ERROR_REQUIRED',
215
- 'Email is required'
216
- ).replace('_attribute_', t('EMAIL', 'Email')),
217
- pattern: {
218
- value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
219
- message: t(
220
- 'VALIDATION_ERROR_EMAIL',
221
- 'Invalid email address'
222
- ).replace('_attribute_', t('EMAIL', 'Email'))
223
- }
224
- })}
225
- onChange={(e) => handleChangeInput(e)}
226
- autoComplete='off'
227
- autoCapitalize='off'
228
- />
229
- <HiOutlineMail />
230
- </InputWithIcon>
231
- )}
232
- {useLoginByCellphone && loginTab === 'cellphone' && (
277
+ {!willVerifyOtpState && (
278
+ <InputWithIcon>
233
279
  <Input
234
- type='tel'
235
- name='cellphone'
236
- aria-label='cellphone'
237
- placeholder='Cellphone'
280
+ type='email'
281
+ name='email'
282
+ aria-label='email'
283
+ placeholder={t('EMAIL')}
238
284
  ref={register({
239
285
  required: t(
240
286
  'VALIDATION_ERROR_REQUIRED',
241
- 'Cellphone is required'
242
- ).replace('_attribute_', t('CELLPHONE', 'Cellphone'))
287
+ 'Email is required'
288
+ ).replace('_attribute_', t('EMAIL', 'Email')),
289
+ pattern: {
290
+ value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
291
+ message: t(
292
+ 'VALIDATION_ERROR_EMAIL',
293
+ 'Invalid email address'
294
+ ).replace('_attribute_', t('EMAIL', 'Email'))
295
+ }
243
296
  })}
244
297
  onChange={(e) => handleChangeInput(e)}
245
298
  autoComplete='off'
299
+ autoCapitalize='off'
246
300
  />
247
- )}
301
+ <HiOutlineMail />
302
+ </InputWithIcon>
303
+ )}
304
+ {useLoginByCellphone && loginTab === 'cellphone' && !willVerifyOtpState && (
305
+ <Input
306
+ type='tel'
307
+ name='cellphone'
308
+ aria-label='cellphone'
309
+ placeholder='Cellphone'
310
+ ref={register({
311
+ required: t(
312
+ 'VALIDATION_ERROR_REQUIRED',
313
+ 'Cellphone is required'
314
+ ).replace('_attribute_', t('CELLPHONE', 'Cellphone'))
315
+ })}
316
+ onChange={(e) => handleChangeInput(e)}
317
+ autoComplete='off'
318
+ />
319
+ )}
248
320
 
321
+ {loginTab !== 'otp' && !willVerifyOtpState && (
249
322
  <WrapperPassword>
250
323
  <Input
251
324
  type={!passwordSee ? 'password' : 'text'}
@@ -276,29 +349,73 @@ const LoginFormUI = (props) => {
276
349
  {!passwordSee ? <Eye /> : <EyeSlash />}
277
350
  </TogglePassword>
278
351
  </WrapperPassword>
352
+ )}
279
353
 
280
- {isReCaptchaEnable && (
281
- <ReCAPTCHAWrapper>
282
- <ReCaptcha handleReCaptcha={handleReCaptcha} reCaptchaVersion={reCaptchaVersion} />
283
- </ReCAPTCHAWrapper>
284
- )}
354
+ {isReCaptchaEnable && (
355
+ <ReCAPTCHAWrapper>
356
+ <ReCaptcha handleReCaptcha={handleReCaptcha} reCaptchaVersion={reCaptchaVersion} />
357
+ </ReCAPTCHAWrapper>
358
+ )}
285
359
 
360
+ {(!willVerifyOtpState &&
286
361
  <Button
287
362
  borderRadius='8px'
288
363
  color='primary'
289
364
  type='submit'
290
365
  disabled={formState.loading}
291
366
  >
292
- {formState.loading ? t('LOADING') + '...' : t('LOGIN')}
367
+ {formState.loading
368
+ ? t('LOADING') + '...'
369
+ : loginWithOtpState || loginTab === 'otp'
370
+ ? t('GET_VERIFY_CODE', 'Get verify code')
371
+ : t('LOGIN', 'Login')}
293
372
  <BsArrowRightShort />
294
373
  </Button>
374
+ )}
375
+ {(willVerifyOtpState && !checkPhoneCodeState?.loading) && (
376
+ <>
377
+ <CountdownTimer>
378
+ <span>{formatSeconds(otpLeftTime)}</span>
379
+ </CountdownTimer>
295
380
 
381
+ <OtpWrapper>
382
+ <OtpInput
383
+ value={otpState}
384
+ onChange={otp => setOtpState(otp)}
385
+ numInputs={numOtpInputs}
386
+ containerStyle='otp-container'
387
+ inputStyle='otp-input'
388
+ placeholder={otpPlaceholder}
389
+ isInputNum
390
+ shouldAutoFocus
391
+ isDisabled={otpLeftTime === 0}
392
+ />
393
+ </OtpWrapper>
394
+ <ResendCode disabled={otpLeftTime > 520} onClick={handleSendOtp}>
395
+ {t('RESEND_AGAIN', 'Resend again')}?
396
+ </ResendCode>
397
+ <Button
398
+ borderRadius='8px'
399
+ type='button'
400
+ color='primary'
401
+ disabled={formState.loading}
402
+ onClick={() => {
403
+ setLoginWithOtpState(false)
404
+ setWillVerifyOtpState(false)
405
+ }}
406
+ >
407
+ {t('CANCEL', 'Cancel')}
408
+ </Button>
409
+ </>
410
+ )}
411
+
412
+ {loginTab !== 'otp' && (
296
413
  <RedirectLink isPopup={isPopup}>
297
414
  <span>{t('FORGOT_YOUR_PASSWORD', 'Forgot your password?')}</span>
298
415
  {elementLinkToForgotPassword}
299
416
  </RedirectLink>
300
- </FormInput>
301
- )}
417
+ )}
418
+ </FormInput>
302
419
 
303
420
  {elementLinkToSignup && (
304
421
  <RedirectLink register isPopup={isPopup}>
@@ -1,5 +1,6 @@
1
1
  import React from 'react'
2
2
  import styled, { css } from 'styled-components'
3
+ import { darken } from 'polished'
3
4
 
4
5
  export const LoginContainer = styled.div`
5
6
  width: 100%;
@@ -82,13 +83,7 @@ export const LoginWith = styled.div`
82
83
  }
83
84
 
84
85
  @media (min-width: 992px) {
85
- font-size: ${({ isPopup }) => isPopup ? '13px' : '18px'};
86
- }
87
-
88
- @media (min-width: 1200px) {
89
- ${({ isPopup }) => isPopup && css`
90
- font-size: 17px;
91
- `};
86
+ font-size: 18px;
92
87
  }
93
88
  `
94
89
 
@@ -203,7 +198,7 @@ export const SocialButtons = styled.div`
203
198
  `
204
199
 
205
200
  export const TitleFormSide = styled.div`
206
- color: #fff;
201
+ color: ${props => props.theme.colors.white};
207
202
 
208
203
  h1 {
209
204
  text-transform: uppercase;
@@ -307,3 +302,74 @@ export const ReCAPTCHAWrapper = styled.div`
307
302
  padding: 0;
308
303
  }
309
304
  `
305
+
306
+ export const Tabs = styled.div`
307
+ display: flex;
308
+ `
309
+
310
+ export const Tab = styled.div`
311
+ padding: 10px 0;
312
+ cursor: pointer;
313
+ ${props => props.theme?.rtl ? css`
314
+ margin-left: 15px;
315
+ ` : css`
316
+ margin-right: 15px;
317
+ `}
318
+ ${({ active }) => active && css`
319
+ color: ${props => props.theme.colors.white};
320
+ `}
321
+
322
+ ${({ active }) => !active && css`
323
+ color: ${props => props.theme.colors.lightGray};
324
+ `}
325
+ `
326
+
327
+ export const CountdownTimer = styled.div`
328
+ margin: 15px;
329
+ display: flex;
330
+ justify-content: center;
331
+
332
+ span {
333
+ font-size: 30px;
334
+ font-weight: 700;
335
+ color: ${props => props.theme.colors.white};
336
+ }
337
+ `
338
+ export const OtpWrapper = styled.div`
339
+ width: 100%;
340
+ .otp-container{
341
+ display: flex;
342
+ justify-content: space-evenly;
343
+ margin: 20px;
344
+
345
+ .otp-input{
346
+ width: 50px !important;
347
+ height: 45px;
348
+ border-radius: 8px;
349
+ background-color: ${props => props.theme.colors.backgroundPage};
350
+ outline: none;
351
+ border: none;
352
+ font-size: 20px;
353
+ font-weight: bold;
354
+
355
+ &:focus{
356
+ border-color: ${() => darken(0.07, '#CCC')} !important;
357
+ }
358
+
359
+ &::placeholder,
360
+ &::-webkit-input-placeholder {
361
+ color: #DBDCDB;
362
+ }
363
+ &:-ms-input-placeholder {
364
+ color: #DBDCDB;
365
+ }
366
+ }
367
+ }
368
+ `
369
+ export const ResendCode = styled.span`
370
+ color: ${props => props.disabled ? props.theme.colors.disabled : props.theme.colors.primary};
371
+ font-size: 20px;
372
+ align-self: center;
373
+ margin-bottom: 10px;
374
+ cursor: ${props => props.disabled ? 'not-allowed' : 'pointer'};
375
+ `
@@ -46,7 +46,7 @@ const RewardsProgramsUI = (props) => {
46
46
  <MenuIcon />
47
47
  </IconButton>
48
48
  )}
49
- <h1>{t('LOYALTY', 'Loyalty')}</h1>
49
+ <h1>{t('LOYALTY_AUTOMATION', 'Loyalty automation')}</h1>
50
50
  </HeaderTitleContainer>
51
51
 
52
52
  <LoyaltyListContainer>
@@ -109,7 +109,7 @@ const CampaignSignUpOptionUI = (props) => {
109
109
  const scrollDown = (e) => {
110
110
  if (!e.target.closest('.ordering-calendar-btn')) return
111
111
 
112
- const el = document.querySelector('.popup-dialog')
112
+ const el = document.querySelector('.dialog-inner')
113
113
  if (el?.scrollHeight > el?.clientHeight) {
114
114
  const top = contentEndRef.current.offsetTop
115
115
  el.scrollTo({
@@ -82,7 +82,7 @@ const EnterprisePromotionListingUI = (props) => {
82
82
  <MenuIcon />
83
83
  </IconButton>
84
84
  )}
85
- <h1>{t('PROMOTIONS_ENTERPRISE', 'Promotions enterprise')}</h1>
85
+ <h1>{t('PROMOTION_AUTOMATION', 'Promotions automation')}</h1>
86
86
  </HeaderTitleContainer>
87
87
  <ActionsWrapper eventDisabled={advancedOfferModuleDisabled || isDisabledFeature}>
88
88
  <Button
@@ -5,11 +5,9 @@ export const MessagesListingContainer = styled.div`
5
5
  transition: all 0.5s;
6
6
  padding: 20px;
7
7
  box-sizing: border-box;
8
-
9
-
10
- @media print {
11
- display: none;
12
- }
8
+ max-height: 100vh;
9
+ overflow: auto;
10
+ min-height: 100vh;
13
11
  `
14
12
 
15
13
  export const MessagesContent = styled.div`