ordering-ui-external 1.4.5 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/_bundles/{0.ordering-ui.9c913f613f7ccfd32dd9.js → 0.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
  2. package/_bundles/{1.ordering-ui.9c913f613f7ccfd32dd9.js → 1.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
  3. package/_bundles/{2.ordering-ui.9c913f613f7ccfd32dd9.js → 2.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
  4. package/_bundles/{4.ordering-ui.9c913f613f7ccfd32dd9.js → 4.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
  5. package/_bundles/{5.ordering-ui.9c913f613f7ccfd32dd9.js → 5.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
  6. package/_bundles/{6.ordering-ui.9c913f613f7ccfd32dd9.js → 6.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
  7. package/_bundles/{7.ordering-ui.9c913f613f7ccfd32dd9.js → 7.ordering-ui.b1e32f04828ea3f944e1.js} +2 -2
  8. package/_bundles/{7.ordering-ui.9c913f613f7ccfd32dd9.js.LICENSE.txt → 7.ordering-ui.b1e32f04828ea3f944e1.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.9c913f613f7ccfd32dd9.js → 8.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
  10. package/_bundles/{9.ordering-ui.9c913f613f7ccfd32dd9.js → 9.ordering-ui.b1e32f04828ea3f944e1.js} +1 -1
  11. package/_bundles/{ordering-ui.9c913f613f7ccfd32dd9.js → ordering-ui.b1e32f04828ea3f944e1.js} +2 -2
  12. package/_bundles/{ordering-ui.9c913f613f7ccfd32dd9.js.LICENSE.txt → ordering-ui.b1e32f04828ea3f944e1.js.LICENSE.txt} +0 -0
  13. package/_modules/components/LogoutButton/index.js +9 -4
  14. package/_modules/components/PaymentOptions/index.js +14 -7
  15. package/_modules/components/SpinnerLoader/styles.js +1 -1
  16. package/_modules/components/UserProfileForm/index.js +15 -2
  17. package/_modules/components/UserProfileForm/styles.js +1 -1
  18. package/_modules/hooks/useRecaptcha.js +62 -0
  19. package/_modules/themes/five/src/components/AddressForm/styles.js +3 -3
  20. package/_modules/themes/five/src/components/AddressList/index.js +1 -1
  21. package/_modules/themes/five/src/components/AddressList/styles.js +1 -1
  22. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +5 -5
  23. package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +12 -10
  24. package/_modules/themes/five/src/components/BusinessController/index.js +6 -4
  25. package/_modules/themes/five/src/components/BusinessController/styles.js +10 -4
  26. package/_modules/themes/five/src/components/BusinessListingSearch/index.js +21 -6
  27. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +6 -17
  28. package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +3 -4
  29. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +11 -3
  30. package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +2 -2
  31. package/_modules/themes/five/src/components/BusinessReviews/index.js +16 -8
  32. package/_modules/themes/five/src/components/BusinessReviews/styles.js +6 -4
  33. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +58 -34
  34. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +40 -23
  35. package/_modules/themes/five/src/components/DriverTips/styles.js +1 -1
  36. package/_modules/themes/five/src/components/Footer/index.js +2 -1
  37. package/_modules/themes/five/src/components/Footer/styles.js +1 -1
  38. package/_modules/themes/five/src/components/Header/index.js +18 -11
  39. package/_modules/themes/five/src/components/Header/styles.js +7 -7
  40. package/_modules/themes/five/src/components/HomeHero/index.js +0 -15
  41. package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +116 -31
  42. package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +36 -37
  43. package/_modules/themes/five/src/components/LoginForm/index.js +62 -21
  44. package/_modules/themes/five/src/components/LoginForm/styles.js +1 -1
  45. package/_modules/themes/five/src/components/Messages/index.js +19 -3
  46. package/_modules/themes/five/src/components/MultiOrdersDetails/styles.js +6 -6
  47. package/_modules/themes/five/src/components/MyOrders/index.js +4 -4
  48. package/_modules/themes/five/src/components/NavigationBar/index.js +145 -34
  49. package/_modules/themes/five/src/components/NavigationBar/styles.js +1 -1
  50. package/_modules/themes/five/src/components/PaymentOptionStripe/index.js +2 -14
  51. package/_modules/themes/five/src/components/PaymentOptions/index.js +23 -16
  52. package/_modules/themes/five/src/components/PaymentOptions/styles.js +1 -1
  53. package/_modules/themes/five/src/components/ProductForm/index.js +9 -7
  54. package/_modules/themes/five/src/components/ProductItemAccordion/index.js +10 -4
  55. package/_modules/themes/five/src/components/ProductItemAccordion/styles.js +11 -3
  56. package/_modules/themes/five/src/components/ProductShare/ProductCopyURL.js +61 -0
  57. package/_modules/themes/five/src/components/ProductShare/index.js +107 -0
  58. package/_modules/themes/five/src/components/ProductShare/styles.js +40 -0
  59. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -2
  60. package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +18 -16
  61. package/_modules/themes/five/src/components/ReviewProduct/index.js +5 -3
  62. package/_modules/themes/five/src/components/ReviewProduct/styles.js +19 -3
  63. package/_modules/themes/five/src/components/SearchProducts/index.js +13 -2
  64. package/_modules/themes/five/src/components/SignUpApproval/index.js +6 -6
  65. package/_modules/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js +57 -17
  66. package/_modules/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js +57 -17
  67. package/_modules/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +57 -17
  68. package/_modules/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +57 -17
  69. package/_modules/themes/five/src/components/SignUpForm/index.js +60 -20
  70. package/_modules/themes/five/src/components/SignUpForm/styles.js +2 -2
  71. package/_modules/themes/five/src/components/SingleProductCard/index.js +36 -2
  72. package/_modules/themes/five/src/components/UserProfileForm/index.js +105 -8
  73. package/_modules/themes/five/src/components/UserProfileForm/styles.js +30 -17
  74. package/_modules/utils/index.js +26 -11
  75. package/index-template.js +11 -1
  76. package/package.json +2 -2
  77. package/src/components/LogoutButton/index.js +10 -8
  78. package/src/components/PaymentOptions/index.js +16 -11
  79. package/src/components/SpinnerLoader/styles.js +1 -0
  80. package/src/components/UserProfileForm/index.js +12 -2
  81. package/src/components/UserProfileForm/styles.js +1 -1
  82. package/src/hooks/useRecaptcha.js +40 -0
  83. package/src/themes/five/src/components/AddressForm/styles.js +3 -2
  84. package/src/themes/five/src/components/AddressList/index.js +1 -1
  85. package/src/themes/five/src/components/AddressList/styles.js +2 -2
  86. package/src/themes/five/src/components/BusinessBasicInformation/index.js +74 -71
  87. package/src/themes/five/src/components/BusinessBasicInformation/styles.js +69 -20
  88. package/src/themes/five/src/components/BusinessController/index.js +3 -1
  89. package/src/themes/five/src/components/BusinessController/styles.js +8 -0
  90. package/src/themes/five/src/components/BusinessListingSearch/index.js +16 -1
  91. package/src/themes/five/src/components/BusinessProductsCategories/index.js +6 -18
  92. package/src/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
  93. package/src/themes/five/src/components/BusinessProductsListing/index.js +2 -0
  94. package/src/themes/five/src/components/BusinessProductsListing/styles.js +2 -3
  95. package/src/themes/five/src/components/BusinessReviews/index.js +17 -10
  96. package/src/themes/five/src/components/BusinessReviews/styles.js +7 -0
  97. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +64 -19
  98. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +99 -1
  99. package/src/themes/five/src/components/DriverTips/styles.js +1 -1
  100. package/src/themes/five/src/components/Footer/index.js +9 -5
  101. package/src/themes/five/src/components/Footer/styles.js +2 -6
  102. package/src/themes/five/src/components/Header/index.js +16 -8
  103. package/src/themes/five/src/components/Header/styles.js +49 -8
  104. package/src/themes/five/src/components/HomeHero/index.js +0 -6
  105. package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +163 -60
  106. package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +145 -82
  107. package/src/themes/five/src/components/LoginForm/index.js +30 -4
  108. package/src/themes/five/src/components/LoginForm/styles.js +8 -0
  109. package/src/themes/five/src/components/Messages/index.js +8 -2
  110. package/src/themes/five/src/components/MultiOrdersDetails/styles.js +34 -1
  111. package/src/themes/five/src/components/MyOrders/index.js +4 -4
  112. package/src/themes/five/src/components/NavigationBar/index.js +153 -39
  113. package/src/themes/five/src/components/NavigationBar/styles.js +2 -2
  114. package/src/themes/five/src/components/PaymentOptionStripe/index.js +2 -14
  115. package/src/themes/five/src/components/PaymentOptions/index.js +13 -7
  116. package/src/themes/five/src/components/PaymentOptions/styles.js +5 -0
  117. package/src/themes/five/src/components/ProductForm/index.js +9 -7
  118. package/src/themes/five/src/components/ProductItemAccordion/index.js +67 -53
  119. package/src/themes/five/src/components/ProductItemAccordion/styles.js +26 -0
  120. package/src/themes/five/src/components/ProductShare/ProductCopyURL.js +53 -0
  121. package/src/themes/five/src/components/ProductShare/index.js +104 -0
  122. package/src/themes/five/src/components/ProductShare/styles.js +165 -0
  123. package/src/themes/five/src/components/RenderProductsLayout/index.js +2 -8
  124. package/src/themes/five/src/components/RenderProductsLayout/styles.js +5 -0
  125. package/src/themes/five/src/components/ReviewProduct/index.js +10 -3
  126. package/src/themes/five/src/components/ReviewProduct/styles.js +43 -0
  127. package/src/themes/five/src/components/SearchProducts/index.js +16 -3
  128. package/src/themes/five/src/components/SignUpApproval/index.js +8 -7
  129. package/src/themes/five/src/components/SignUpBusiness/layouts/NewSignUpBusiness/index.js +26 -2
  130. package/src/themes/five/src/components/SignUpBusiness/layouts/OldSignUpBusiness/index.js +26 -2
  131. package/src/themes/five/src/components/SignUpDriver/layouts/NewSignUpDriver/index.js +26 -2
  132. package/src/themes/five/src/components/SignUpDriver/layouts/OldSignUpDriver/index.js +26 -2
  133. package/src/themes/five/src/components/SignUpForm/index.js +26 -1
  134. package/src/themes/five/src/components/SignUpForm/styles.js +9 -2
  135. package/src/themes/five/src/components/SingleProductCard/index.js +26 -1
  136. package/src/themes/five/src/components/UserPopover/index.js +1 -1
  137. package/src/themes/five/src/components/UserProfileForm/index.js +83 -5
  138. package/src/themes/five/src/components/UserProfileForm/styles.js +49 -0
  139. package/src/utils/index.js +36 -9
  140. package/template/app.js +12 -11
  141. package/template/assets/images/amex.svg +30 -0
  142. package/template/assets/images/diners.svg +16 -0
  143. package/template/assets/images/discover.svg +17 -0
  144. package/template/assets/images/jcb.svg +33 -0
  145. package/template/assets/images/unionpay.svg +25 -0
  146. package/template/components/HelmetTags/index.js +1 -1
  147. package/template/components/ScrollToTop/index.js +7 -5
  148. package/template/pages/BusinessProductsList/index.js +8 -4
  149. package/template/pages/MyOrders/index.js +4 -1
  150. package/template/pages/OrderDetails/index.js +11 -2
  151. package/template/pages/Profile/index.js +8 -2
@@ -8,23 +8,33 @@ import {
8
8
  Title,
9
9
  Slogan,
10
10
  WrapInput,
11
- Overlay
11
+ LogoWrapper,
12
+ UseAccount,
13
+ HeroContent,
14
+ SectionHeader
12
15
  } from './styles'
13
16
 
14
17
  import { Modal } from '../../../Modal'
15
18
  import { Button } from '../../../../styles/Buttons'
16
19
  import { AddressForm } from '../../../AddressForm'
20
+ import { LoginForm } from '../../../LoginForm'
21
+ import { SignUpForm } from '../../../SignUpForm'
22
+ import { ForgotPasswordForm } from '../../../ForgotPasswordForm'
17
23
  import { AddressList } from '../../../AddressList'
24
+ import { useWindowSize } from '../../../../../../../hooks/useWindowSize'
18
25
 
19
26
  export const OriginalHomeHero = (props) => {
20
- const { onFindBusiness, contentPosition } = props
27
+ const { onFindBusiness } = props
21
28
 
22
- const [{ auth }] = useSession()
29
+ const [{ auth }, { login }] = useSession()
23
30
  const [orderState] = useOrder()
24
31
  const [, t] = useLanguage()
25
32
  const [modals, setModals] = useState({ listOpen: false, formOpen: false })
26
33
  const theme = useTheme()
27
34
  const userCustomer = parseInt(window.localStorage.getItem('user-customer'))
35
+ const windowSize = useWindowSize()
36
+ const [authModalOpen, setAuthModalOpen] = useState(false)
37
+ const [modalPageToShow, setModalPageToShow] = useState(null)
28
38
 
29
39
  const handleFindBusinesses = () => {
30
40
  if (!orderState?.options?.address?.location) {
@@ -43,71 +53,164 @@ export const OriginalHomeHero = (props) => {
43
53
  }
44
54
  }
45
55
 
56
+ const handleOpenLoginSignUp = (index) => {
57
+ setModalPageToShow(index)
58
+ setAuthModalOpen(true)
59
+ }
60
+
61
+ const handleCustomModalClick = (e, { page }) => {
62
+ e.preventDefault()
63
+ setModalPageToShow(page)
64
+ }
65
+
66
+ const closeAuthModal = () => {
67
+ setAuthModalOpen(false)
68
+ setModalPageToShow(null)
69
+ }
70
+
71
+ const handleSuccessLogin = (user) => {
72
+ if (user) {
73
+ closeAuthModal()
74
+ }
75
+ }
76
+
77
+ const handleSuccessSignup = (user) => {
78
+ login({
79
+ user,
80
+ token: user?.session?.access_token
81
+ })
82
+ }
83
+
46
84
  useEffect(() => {
47
85
  return () => setModals({ listOpen: false, formOpen: false })
48
86
  }, [])
49
87
 
50
88
  return (
51
- <>
52
- {props.beforeElements?.map((BeforeElement, i) => (
53
- <React.Fragment key={i}>
54
- {BeforeElement}
55
- </React.Fragment>))}
56
- {props.beforeComponents?.map((BeforeComponent, i) => (
57
- <BeforeComponent key={i} {...props} />))}
58
- <HeroContainer bgimage={theme.images?.general?.homeHero}>
59
- <ContentWrapper contentPosition={contentPosition}>
60
- <div>
61
- <Title>{t('TITLE_HOME', theme?.defaultLanguages?.TITLE_HOME || 'All We need is Food.')}</Title>
62
- <Slogan>{t('SUBTITLE_HOME', theme?.defaultLanguages?.SUBTITLE_HOME || 'Let\'s start to order food now')}</Slogan>
63
- <WrapInput onClick={handleAddressInput} withIcon>
64
- <HiOutlineLocationMarker />
65
- <p>
66
- {orderState?.options?.address?.address || t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')}
67
- </p>
68
- </WrapInput>
69
- <Button
70
- color='primary'
71
- name='find-business'
72
- onClick={handleFindBusinesses}
73
- >
74
- {t('FIND_BUSINESSES', theme?.defaultLanguages?.FIND_BUSINESSES || 'Find businesses')}
75
- </Button>
76
- </div>
77
- </ContentWrapper>
78
- <Modal
79
- title={t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')}
80
- open={modals.formOpen}
89
+ <HeroContainer bgimage={theme.images?.general?.homeHero} mb={!auth && '30vh'}>
90
+ <ContentWrapper>
91
+ {windowSize.width < 576 && (
92
+ <LogoWrapper>
93
+ <img alt='Logotype' src={theme?.images?.logos?.logotypeInvert} loading='lazy' />
94
+ </LogoWrapper>
95
+ )}
96
+ <HeroContent>
97
+ <Title>{t('TITLE_HOME', theme?.defaultLanguages?.TITLE_HOME || 'All We need is Food.')}</Title>
98
+ <Slogan>{t('SUBTITLE_HOME', theme?.defaultLanguages?.SUBTITLE_HOME || 'Let\'s start to order food now')}</Slogan>
99
+ <WrapInput onClick={handleAddressInput} withIcon>
100
+ <HiOutlineLocationMarker />
101
+ <p>
102
+ {orderState?.options?.address?.address || t('WHERE_DO_WE_DELIVERY', theme?.defaultLanguages?.WHERE_DO_WE_DELIVERY || 'Where do we delivery?')}
103
+ </p>
104
+ </WrapInput>
105
+
106
+ <Button
107
+ color='primary'
108
+ name='find-business'
109
+ onClick={handleFindBusinesses}
110
+ >
111
+ {t('FIND_BUSINESSES', theme?.defaultLanguages?.FIND_BUSINESSES || 'Find businesses')}
112
+ </Button>
113
+ </HeroContent>
114
+ </ContentWrapper>
115
+
116
+ {windowSize.width < 576 && !auth && (
117
+ <UseAccount>
118
+ <SectionHeader>
119
+ {t('YOUR_ACCOUNT', 'Use your account')}
120
+ </SectionHeader>
121
+ <Button color='primary' onClick={() => handleOpenLoginSignUp('login')}>login</Button>
122
+ <Button color='primary' onClick={() => handleOpenLoginSignUp('signup')}>signUp</Button>
123
+ </UseAccount>
124
+ )}
125
+
126
+ <Modal
127
+ title={t('WHERE_DO_WE_DELIVERY', theme?.defaultLanguages?.WHERE_DO_WE_DELIVERY || 'Where do we delivery?')}
128
+ open={modals.formOpen}
129
+ onClose={() => setModals({ ...modals, formOpen: false })}
130
+ >
131
+ <AddressForm
132
+ useValidationFileds
133
+ address={orderState?.options?.address || {}}
81
134
  onClose={() => setModals({ ...modals, formOpen: false })}
82
- >
83
- <AddressForm
84
- useValidationFileds
85
- address={orderState?.options?.address || {}}
86
- onClose={() => setModals({ ...modals, formOpen: false })}
87
- onSaveAddress={() => setModals({ ...modals, formOpen: false })}
88
- onCancel={() => setModals({ ...modals, formOpen: false })}
89
- />
90
- </Modal>
135
+ onSaveAddress={() => setModals({ ...modals, formOpen: false })}
136
+ onCancel={() => setModals({ ...modals, formOpen: false })}
137
+ />
138
+ </Modal>
139
+ <Modal
140
+ title={t('WHERE_DO_WE_DELIVERY', theme?.defaultLanguages?.WHERE_DO_WE_DELIVERY || 'Where do we delivery?')}
141
+ open={modals.listOpen}
142
+ width='70%'
143
+ onClose={() => setModals({ ...modals, listOpen: false })}
144
+ >
145
+ <AddressList
146
+ isModal
147
+ changeOrderAddressWithDefault
148
+ userId={isNaN(userCustomer) ? null : userCustomer}
149
+ onCancel={() => setModals({ ...modals, listOpen: false })}
150
+ onAccept={() => handleFindBusinesses()}
151
+ />
152
+ </Modal>
153
+ {authModalOpen && !auth && (
91
154
  <Modal
92
- open={modals.listOpen}
93
- width='70%'
94
- onClose={() => setModals({ ...modals, listOpen: false })}
155
+ open={authModalOpen}
156
+ onRemove={() => closeAuthModal()}
157
+ width='50%'
158
+ authModal
95
159
  >
96
- <AddressList
97
- isModal
98
- changeOrderAddressWithDefault
99
- userId={isNaN(userCustomer) ? null : userCustomer}
100
- onCancel={() => setModals({ ...modals, listOpen: false })}
101
- onAccept={() => handleFindBusinesses()}
102
- />
160
+ {modalPageToShow === 'login' && (
161
+ <LoginForm
162
+ handleSuccessLogin={handleSuccessLogin}
163
+ elementLinkToSignup={
164
+ <a
165
+ onClick={
166
+ (e) => handleCustomModalClick(e, { page: 'signup' })
167
+ } href='#'
168
+ >{t('CREATE_ACCOUNT', theme?.defaultLanguages?.CREATE_ACCOUNT || 'Create account')}
169
+ </a>
170
+ }
171
+ elementLinkToForgotPassword={
172
+ <a
173
+ onClick={
174
+ (e) => handleCustomModalClick(e, { page: 'forgotpassword' })
175
+ } href='#'
176
+ >{t('RESET_PASSWORD', theme?.defaultLanguages?.RESET_PASSWORD || 'Reset password')}
177
+ </a>
178
+ }
179
+ useLoginByCellphone
180
+ isPopup
181
+ />
182
+ )}
183
+ {modalPageToShow === 'signup' && (
184
+ <SignUpForm
185
+ elementLinkToLogin={
186
+ <a
187
+ onClick={
188
+ (e) => handleCustomModalClick(e, { page: 'login' })
189
+ } href='#'
190
+ >{t('LOGIN', theme?.defaultLanguages?.LOGIN || 'Login')}
191
+ </a>
192
+ }
193
+ useLoginByCellphone
194
+ useChekoutFileds
195
+ handleSuccessSignup={handleSuccessSignup}
196
+ isPopup
197
+ />
198
+ )}
199
+ {modalPageToShow === 'forgotpassword' && (
200
+ <ForgotPasswordForm
201
+ elementLinkToLogin={
202
+ <a
203
+ onClick={
204
+ (e) => handleCustomModalClick(e, { page: 'login' })
205
+ } href='#'
206
+ >{t('LOGIN', theme?.defaultLanguages?.LOGIN || 'Login')}
207
+ </a>
208
+ }
209
+ isPopup
210
+ />
211
+ )}
103
212
  </Modal>
104
- </HeroContainer>
105
- {props.afterComponents?.map((AfterComponent, i) => (
106
- <AfterComponent key={i} {...props} />))}
107
- {props.afterElements?.map((AfterElement, i) => (
108
- <React.Fragment key={i}>
109
- {AfterElement}
110
- </React.Fragment>))}
111
- </>
213
+ )}
214
+ </HeroContainer>
112
215
  )
113
216
  }
@@ -3,9 +3,13 @@ import styled, { css } from 'styled-components'
3
3
 
4
4
  export const HeroContainerStyled = styled.div`
5
5
  width: 100%;
6
- height: calc(100vh - 97px);
7
- padding-top: 0px;
8
- position: relative;
6
+ height: fit-content;
7
+ height: 374px;
8
+ position:relative;
9
+ ${({ mb }) => mb && css`
10
+ margin-bottom: ${mb};
11
+ `}
12
+
9
13
 
10
14
  ${({ bgimage }) => bgimage && css`
11
15
  background-repeat: no-repeat, repeat;
@@ -14,13 +18,13 @@ export const HeroContainerStyled = styled.div`
14
18
  background-position: center;
15
19
  `}
16
20
 
17
- @media (min-width: 576px) {
18
- height: calc(100vh - 65px);
21
+ @media (min-width: 375px) {
22
+ height: 374px;
19
23
  }
20
24
 
21
- @media (min-width: 993px) {
22
- height: auto;
23
- padding-top: 53%;
25
+ @media (min-width: 567px) {
26
+ height: calc(100vh - 65px);
27
+ margin-bottom: 0;
24
28
  }
25
29
  `
26
30
 
@@ -39,24 +43,60 @@ export const HeroContainer = (props) => {
39
43
  )
40
44
  }
41
45
 
46
+ export const ContentWrapper = styled.div`
47
+ display: flex;
48
+ flex-direction: column;
49
+ justify-content: space-around;
50
+ height: 100%;
51
+ padding: 0px 10vw 0px;
52
+ background-color: #0000004D;
53
+
54
+ input {
55
+ width: 90%;
56
+ margin-bottom: 15px;
57
+ }
58
+
59
+ @media (min-width: 576px) {
60
+ justify-content: center;
61
+ padding: 0px 40px 0px;
62
+ input {
63
+ width: 97%;
64
+ }
65
+ }
66
+
67
+ @media (min-width: 768px) {
68
+ ${props => props.theme?.rtl && css`
69
+ padding: 0px 40px 0px;
70
+ `}
71
+ }
72
+ `
73
+
42
74
  export const Title = styled.h1`
43
75
  margin: 0px;
44
76
  text-align: left;
45
- font-weight: 500;
46
- font-size: 50px;
77
+ font-weight: 600;
78
+ font-size: 30px;
79
+ line-height: 36px;
47
80
  letter-spacing: 0px;
48
- color: ${props => props.theme.colors.titleHomeColor ?? '#FFFFFF'};
81
+ color: #FFFFFF;
82
+ text-shadow: 0px 3px 6px #2c2e33;
49
83
  opacity: 1;
50
84
 
51
85
  ${props => props.theme?.rtl && css`
52
86
  text-align: right;
53
87
  `}
54
88
 
55
- @media (min-width: 400px) {
56
- font-size: 65px;
89
+ @media (min-width: 381px) {
90
+ font-size: 35px;
57
91
  }
58
92
 
93
+
59
94
  @media (min-width: 576px) {
95
+ font-size: 40px;
96
+ line-height: initial;
97
+ }
98
+
99
+ @media (min-width: 850px) {
60
100
  font-size: 72px;
61
101
  }
62
102
  `
@@ -64,11 +104,13 @@ export const Title = styled.h1`
64
104
  export const Slogan = styled.p`
65
105
  margin: 0px;
66
106
  text-align: left;
67
- font-size: 24px;
107
+ font-size: .96rem;
108
+ line-height: 24px;
68
109
  letter-spacing: 0px;
69
- color: ${props => props.theme.colors.subtitleHomeColor ?? '#FFFFFF'};
110
+ color: #FFFFFF;
70
111
  opacity: 1;
71
- margin-bottom: 37px;
112
+ text-shadow: 0px 3px 6px #2c2e33;
113
+ margin-bottom: 30px;
72
114
 
73
115
  ${props => props.theme?.rtl && css`
74
116
  text-align: right;
@@ -76,21 +118,23 @@ export const Slogan = styled.p`
76
118
 
77
119
  @media (min-width: 480px) {
78
120
  font-size: 24px;
121
+ line-height: initial;
122
+ margin-bottom: 37px;
79
123
  }
80
124
  `
81
125
 
82
126
  export const WrapInput = styled.div`
83
127
  position: relative;
84
128
  cursor: pointer;
85
- padding: 10px 25px;
86
129
  background: #FFFFFF;
130
+ padding: 8px 16px;
87
131
  border: 1px solid #DEE2E6;
88
132
  box-sizing: border-box;
89
133
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.12);
90
134
  border-radius: 50px;
91
135
  display: flex;
92
136
  align-items: center;
93
- margin-bottom: 27px;
137
+ margin-bottom: 22px;
94
138
 
95
139
  ${({ withIcon }) => withIcon && css`
96
140
  width: calc(100% - 20px);
@@ -109,97 +153,116 @@ export const WrapInput = styled.div`
109
153
  right: initial;
110
154
  `}
111
155
  }
156
+
157
+ @media (min-width: 576px) {
158
+ padding: 10px 25px;
159
+ margin-bottom: 27px;
160
+ }
161
+
162
+ @media (min-width: 1024px) {
163
+ width: calc(50% - 20px);
164
+ }
112
165
  `}
113
-
114
- p {
166
+
167
+ p{
115
168
  color: ${props => props.theme.colors.darkTextColor};
116
169
  position: relative;
117
170
  margin: 0;
171
+ overflow: hidden;
172
+ text-overflow: ellipsis;
173
+ white-space: nowrap;
174
+ font-size: 12px;
175
+ line-height: 18px;
176
+ @media (min-width: 576px) {
177
+ font-size: 1rem;
178
+ line-height: initial;
179
+ }
118
180
  }
119
181
 
120
182
  svg {
121
183
  color: ${props => props.theme.colors.primary};
122
- width: 22px;
123
- height: 22px;
124
- min-width: 22px;
125
-
184
+ font-size: 22px;
126
185
  ${props => props.theme?.rtl ? css`
127
- margin-left: 20px;
186
+ margin-left: 12px;
128
187
  ` : css`
129
- margin-right: 20px;
188
+ margin-right: 12px;
130
189
  `}
131
190
 
191
+ @media (min-width: 576px) {
192
+ ${props => props.theme?.rtl ? css`
193
+ margin-left: 20px;
194
+ ` : css`
195
+ margin-right: 20px;
196
+ `}
197
+ }
132
198
  }
133
199
  `
134
200
 
135
- export const ContentWrapper = styled.div`
201
+ export const UseAccount = styled.div`
136
202
  position: absolute;
137
- display: flex;
138
203
  left: 0;
139
- top: 0;
140
204
  width: 100%;
141
- height: 100%;
142
- background-color: #0000004D;
143
- align-items: center;
205
+ min-height: 30vh;
206
+ padding: 10vw;
207
+ box-sizing: border-box;
208
+ display: flex;
209
+ flex-direction: column;
144
210
  justify-content: center;
145
-
146
- ${props => props.contentPosition === 'left' && css`
147
- align-items: center;
148
- justify-content: left;
149
- `}
211
+ align-items: center;
150
212
 
151
- ${props => props.contentPosition === 'right' && css`
152
- align-items: center;
153
- justify-content: right;
154
- `}
213
+ > button {
214
+ width: 100%;
215
+ padding-top: 10px;
216
+ padding-bottom: 10px;
217
+ font-size: 14px;
218
+ line-height: 24px;
219
+ }
155
220
 
156
- ${props => props.contentPosition === 'top' && css`
157
- align-items: start;
158
- justify-content: center;
159
- `}
221
+ > *:last-child {
222
+ margin-top: 14px;
223
+ background-color: #E9F2FE;
224
+ color: ${props => props.theme.colors.primary};
225
+ }
160
226
 
161
- ${props => props.contentPosition === 'bottom' && css`
162
- align-items: end;
163
- justify-content: center;
164
- `}
227
+ @media (min-width: 576px) {
228
+ display: none;
229
+ }
230
+ `
165
231
 
166
- > div {
167
- display: flex;
168
- flex-direction: column;
169
- justify-content: center;
170
- width: calc(100% - 40px);
171
- position: relative;
172
- padding: 20px;
232
+ export const SectionHeader = styled.div`
233
+ font-size: 24px;
234
+ font-weight: 600;
235
+ line-height: 30px;
236
+ color: #344050;
237
+ margin: 0;
238
+ margin-bottom: 27px;
239
+ width: 100%;
240
+ `
173
241
 
174
- ${props => props.theme?.rtl && css`
175
- padding: 20px;
176
- `}
242
+ export const LogoWrapper = styled.div`
243
+ width: 150px;
244
+ margin: 53px auto;
245
+ display: flex;
246
+ justify-content: center;
247
+ img {
248
+ width: 100%;
249
+ object-fit: fill;
250
+ }
251
+ `
252
+ export const HeroContent = styled.div`
253
+ button{
254
+ font-size: 12px;
255
+ line-height: 18px;
256
+ padding: 10px 16px;
257
+ margin-bottom: 45px;
258
+ white-space: nowrap;
177
259
 
178
- button {
179
- width: 180px;
180
- font-size: 18px;
260
+ @media (min-width: 576px) {
181
261
  padding-top: 5px;
182
262
  padding-bottom: 5px;
183
- }
184
-
185
- input {
186
- width: 90%;
187
- margin-bottom: 15px;
188
- }
189
-
190
- @media (min-width: 425px) {
191
- input {
192
- width: 97%;
193
- }
194
- }
195
-
196
- @media (min-width: 768px) {
197
- padding: 40px;
198
- width: 50%;
199
- ${props => props.theme?.rtl && css`
200
- padding: 40px;
201
- `}
263
+ font-size: 18px;
264
+ width: 180px;
265
+ line-height: initial;
202
266
  }
203
267
  }
204
-
205
268
  `
@@ -46,6 +46,8 @@ import { FacebookLoginButton } from '../FacebookLogin'
46
46
  import { AppleLogin } from '../AppleLogin'
47
47
  import { SmsLoginButton } from '../../../../../components/SmsLogin'
48
48
  import { useCountdownTimer } from '../../../../../hooks/useCountdownTimer'
49
+ import { useRecaptcha } from '../../../../../hooks/useRecaptcha'
50
+
49
51
  import { formatSeconds } from '../../../../../utils'
50
52
  import { GoogleLoginButton } from '../GoogleLogin'
51
53
  import {
@@ -92,8 +94,9 @@ const LoginFormUI = (props) => {
92
94
  const theme = useTheme()
93
95
  const [{ configs }] = useConfig()
94
96
  const formMethods = useForm()
95
-
97
+ const [recaptchaConfig] = useRecaptcha(enableReCaptcha)
96
98
  const [alertState, setAlertState] = useState({ open: false, content: [] })
99
+ const [reCaptchaVersion, setRecaptchaVersion] = useState({ version: '', siteKey: '' })
97
100
  const [, { login }] = useSession()
98
101
  const [passwordSee, setPasswordSee] = useState(false)
99
102
  const [loginWithOtpState, setLoginWithOtpState] = useState(false)
@@ -102,7 +105,7 @@ const LoginFormUI = (props) => {
102
105
  const [projectName, setProjectName] = useState(null)
103
106
  const [submitted, setSubmitted] = useState(false)
104
107
 
105
- const [otpLeftTime, _, resetOtpLeftTime] = useCountdownTimer(
108
+ const [otpLeftTime, , resetOtpLeftTime] = useCountdownTimer(
106
109
  600, !checkPhoneCodeState?.loading && willVerifyOtpState)
107
110
  const isOtpEmail = loginTab === 'otp' && otpType === 'email'
108
111
  const isOtpCellphone = loginTab === 'otp' && otpType === 'cellphone'
@@ -241,6 +244,23 @@ const LoginFormUI = (props) => {
241
244
 
242
245
  useEffect(() => {
243
246
  if (!formState.loading && formState.result?.error) {
247
+ if (formState.result?.result?.[0] === 'ERROR_AUTH_VERIFICATION_CODE') {
248
+ if (configs?.security_recaptcha_site_key?.value) {
249
+ setRecaptchaVersion({ version: 'v2', siteKey: configs?.security_recaptcha_site_key?.value })
250
+ setAlertState({
251
+ open: true,
252
+ content: [t('TRY_AGAIN', 'Please try again')]
253
+ })
254
+ setSubmitted(false)
255
+ return
256
+ }
257
+ setAlertState({
258
+ open: true,
259
+ content: [t('CONFIG_DOESNOT_RECAPTCHA_KEY', 'the config doesn\'t have recaptcha site key')]
260
+ })
261
+ setSubmitted(false)
262
+ return
263
+ }
244
264
  setAlertState({
245
265
  open: true,
246
266
  content: formState.result?.result || [t('ERROR', 'Error')]
@@ -325,6 +345,12 @@ const LoginFormUI = (props) => {
325
345
  handleButtonLoginClick()
326
346
  }, [ordering, submitted])
327
347
 
348
+ useEffect(() => {
349
+ if (recaptchaConfig?.siteKey) {
350
+ setRecaptchaVersion({ version: recaptchaConfig?.version, siteKey: recaptchaConfig?.siteKey })
351
+ }
352
+ }, [recaptchaConfig])
353
+
328
354
  return (
329
355
  <>
330
356
  {props.beforeElements?.map((BeforeElement, i) => (
@@ -564,7 +590,7 @@ const LoginFormUI = (props) => {
564
590
  )}
565
591
  {props.isRecaptchaEnable && enableReCaptcha && (
566
592
  <ReCaptchaWrapper>
567
- <ReCaptcha handleReCaptcha={handleReCaptcha} />
593
+ <ReCaptcha handleReCaptcha={handleReCaptcha} reCaptchaVersion={reCaptchaVersion} />
568
594
  </ReCaptchaWrapper>
569
595
  )}
570
596
  {(!willVerifyOtpState &&
@@ -594,7 +620,7 @@ const LoginFormUI = (props) => {
594
620
  )}
595
621
  </FormInput>
596
622
 
597
- {(elementLinkToSignup && !loginWithOtpState) && (
623
+ {(elementLinkToSignup && !loginWithOtpState && loginTab !== 'otp') && (
598
624
  <RedirectLink register isPopup={isPopup} className='new-account'>
599
625
  <span>{t('NEW_ON_PLATFORM', theme?.defaultLanguages?.NEW_ON_PLATFORM || 'New on Ordering?')}</span>
600
626
  {elementLinkToSignup}
@@ -51,6 +51,14 @@ export const LoginWith = styled.div`
51
51
  border-bottom: 1px solid #E9ECEF;
52
52
  font-size: 14px;
53
53
  margin-bottom: 10px;
54
+ overflow-x: auto;
55
+
56
+ -ms-overflow-style: none; /* IE and Edge */
57
+ scrollbar-width: none; /* Firefox */
58
+
59
+ &::-webkit-scrollbar {
60
+ display: none;
61
+ }
54
62
 
55
63
  @media (min-width: 425px) {
56
64
  font-size: 18px;