ordering-ui-external 2.2.2 → 2.3.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 (43) hide show
  1. package/_bundles/{0.ordering-ui.da916a51373ae7f6cfcc.js → 0.ordering-ui.c46aca08b04b2755b967.js} +1 -1
  2. package/_bundles/{1.ordering-ui.da916a51373ae7f6cfcc.js → 1.ordering-ui.c46aca08b04b2755b967.js} +1 -1
  3. package/_bundles/{2.ordering-ui.da916a51373ae7f6cfcc.js → 2.ordering-ui.c46aca08b04b2755b967.js} +1 -1
  4. package/_bundles/{4.ordering-ui.da916a51373ae7f6cfcc.js → 4.ordering-ui.c46aca08b04b2755b967.js} +1 -1
  5. package/_bundles/{5.ordering-ui.da916a51373ae7f6cfcc.js → 5.ordering-ui.c46aca08b04b2755b967.js} +1 -1
  6. package/_bundles/{6.ordering-ui.da916a51373ae7f6cfcc.js → 6.ordering-ui.c46aca08b04b2755b967.js} +1 -1
  7. package/_bundles/{7.ordering-ui.da916a51373ae7f6cfcc.js → 7.ordering-ui.c46aca08b04b2755b967.js} +2 -2
  8. package/_bundles/{7.ordering-ui.da916a51373ae7f6cfcc.js.LICENSE.txt → 7.ordering-ui.c46aca08b04b2755b967.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.da916a51373ae7f6cfcc.js → 8.ordering-ui.c46aca08b04b2755b967.js} +1 -1
  10. package/_bundles/{9.ordering-ui.da916a51373ae7f6cfcc.js → 9.ordering-ui.c46aca08b04b2755b967.js} +1 -1
  11. package/_bundles/ordering-ui.c46aca08b04b2755b967.js +2 -0
  12. package/_bundles/{ordering-ui.da916a51373ae7f6cfcc.js.LICENSE.txt → ordering-ui.c46aca08b04b2755b967.js.LICENSE.txt} +0 -0
  13. package/_modules/components/PaymentOptions/index.js +42 -2
  14. package/_modules/index.js +7 -0
  15. package/_modules/themes/five/index.js +7 -0
  16. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +1 -4
  17. package/_modules/themes/five/src/components/Cart/index.js +6 -2
  18. package/_modules/themes/five/src/components/Cart/styles.js +1 -1
  19. package/_modules/themes/five/src/components/Checkout/index.js +142 -42
  20. package/_modules/themes/five/src/components/Checkout/styles.js +5 -3
  21. package/_modules/themes/five/src/components/InputPhoneNumber/index.js +10 -21
  22. package/_modules/themes/five/src/components/LoginForm/index.js +29 -13
  23. package/_modules/themes/five/src/components/MultiCheckout/index.js +5 -1
  24. package/_modules/themes/five/src/components/QueryLoginSpoonity/index.js +37 -0
  25. package/_modules/themes/five/src/components/SignUpForm/index.js +15 -7
  26. package/_modules/themes/five/src/styles/Buttons/index.js +32 -2
  27. package/package.json +2 -2
  28. package/src/components/PaymentOptions/index.js +35 -2
  29. package/src/index.js +2 -0
  30. package/src/themes/five/index.js +2 -1
  31. package/src/themes/five/src/components/BusinessProductsListing/index.js +3 -2
  32. package/src/themes/five/src/components/Cart/index.js +10 -1
  33. package/src/themes/five/src/components/Cart/styles.js +5 -0
  34. package/src/themes/five/src/components/Checkout/index.js +141 -54
  35. package/src/themes/five/src/components/Checkout/styles.js +15 -0
  36. package/src/themes/five/src/components/InputPhoneNumber/index.js +33 -38
  37. package/src/themes/five/src/components/LoginForm/index.js +27 -10
  38. package/src/themes/five/src/components/MultiCheckout/index.js +11 -2
  39. package/src/themes/five/src/components/QueryLoginSpoonity/index.js +19 -0
  40. package/src/themes/five/src/components/SignUpForm/index.js +9 -1
  41. package/src/themes/five/src/styles/Buttons/index.js +24 -0
  42. package/template/app.js +22 -7
  43. package/_bundles/ordering-ui.da916a51373ae7f6cfcc.js +0 -2
@@ -117,6 +117,7 @@ const SignUpFormUI = (props) => {
117
117
  const [isValidPhoneNumber, setIsValidPhoneNumber] = useState(null)
118
118
  const [passwordSee, setPasswordSee] = useState(false)
119
119
  const [fieldNumber, setFieldNumber] = useState(1)
120
+ const [currentPhoneNumber, setCurrentPhoneNumber] = useState(null)
120
121
 
121
122
  const showInputPhoneNumber = (validationFields?.fields?.checkout?.cellphone?.enabled ?? false) || configs?.verification_phone_required?.value === '1'
122
123
 
@@ -205,7 +206,12 @@ const SignUpFormUI = (props) => {
205
206
  generateOtpCode()
206
207
  return
207
208
  }
208
- handleButtonSignupClick && handleButtonSignupClick()
209
+ handleButtonSignupClick &&
210
+ handleButtonSignupClick({
211
+ ...signupData,
212
+ cellphone:
213
+ currentPhoneNumber?.split(' ')[1]?.replace(/-/g, '') ?? signupData?.cellphone
214
+ })
209
215
  if (!formState.loading && formState.result.result && !formState.result.error) {
210
216
  handleSuccessSignup(formState.result.result)
211
217
  }
@@ -481,8 +487,10 @@ const SignUpFormUI = (props) => {
481
487
  )}
482
488
  <InputPhoneNumber
483
489
  value={userPhoneNumber}
490
+ currentCountryCode={signupData?.country_phone_code}
484
491
  setValue={handleChangePhoneNumber}
485
492
  handleIsValid={setIsValidPhoneNumber}
493
+ setCurrentPhoneNumber={setCurrentPhoneNumber}
486
494
  isError={formMethods.errors?.cellphone && !userPhoneNumber}
487
495
  />
488
496
  </>
@@ -262,6 +262,30 @@ export const Button = styled.button`
262
262
  }
263
263
  `}
264
264
  `}
265
+ ${({ color }) => color === 'black' && css`
266
+ background: ${props => props.theme.colors.black};;
267
+ color: ${props => props.theme.colors.backgroundPage};
268
+ border-color: ${props => props.theme.colors.black};
269
+ &:active {
270
+ background: ${props => darken(0.05, props.theme.colors.black)};
271
+ }
272
+ &:hover {
273
+ background: ${props => darken(0.07, props.theme.colors.black)};
274
+ }
275
+ ${({ outline }) => outline && css`
276
+ background: ${props => props.theme.colors.backgroundPage};
277
+ color: ${props => props.theme.colors.black};
278
+ border-color: ${props => props.theme.colors.black};
279
+ &:active {
280
+ color: ${props => props.theme.colors.backgroundPage};
281
+ background: ${props => props.theme.colors.black};
282
+ }
283
+ &:hover {
284
+ background: ${props => darken(0.07, props.theme.colors.black)};
285
+ color: ${props => props.theme.colors.backgroundPage};
286
+ }
287
+ `}
288
+ `}
265
289
  `
266
290
 
267
291
  export default Button
package/template/app.js CHANGED
@@ -32,6 +32,7 @@ import { orderingThemeUpdated } from './components/OrderingThemeUpdated'
32
32
 
33
33
  import { SpinnerLoader } from '../src/components/SpinnerLoader'
34
34
  import { Input } from '../src/themes/five/src/styles/Inputs'
35
+ import { QueryLoginSpoonity } from '../src/themes/five/src/components/QueryLoginSpoonity'
35
36
 
36
37
  const Header = loadable(() => import('../src/themes/five/src/components/Header'))
37
38
  const HeaderKiosk = loadable(() => import('../src/themes/five/src/components/Header/layouts/Kiosk'))
@@ -109,11 +110,21 @@ export const App = () => {
109
110
  reviewStatus: { trigger: false, order: false, product: false, driver: false },
110
111
  reviewed: { isOrderReviewed: false, isProductReviewed: false, isDriverReviewed: false }
111
112
  })
113
+ const unaddressedTypes = configs?.unaddressed_order_types_allowed?.value.split('|').map(value => Number(value)) || []
114
+ const isAllowUnaddressOrderType = unaddressedTypes.includes(orderStatus?.options?.type)
112
115
  const isShowReviewsPopupEnabled = configs?.show_reviews_popups_enabled?.value === '1'
113
116
  const hashKey = new URLSearchParams(useLocation()?.search)?.get('hash') || null
114
117
  const isKioskApp = settings?.use_kiosk
115
118
  const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
116
119
 
120
+ let queryIntegrationToken
121
+ let queryIntegrationCode
122
+ if (location.search) {
123
+ const query = new URLSearchParams(location.search)
124
+ queryIntegrationCode = query.get('integration_code')
125
+ queryIntegrationToken = query.get('integration_token')
126
+ }
127
+
117
128
  const themeUpdated = {
118
129
  ...theme,
119
130
  ...orderingTheme?.theme,
@@ -478,10 +489,10 @@ export const App = () => {
478
489
  ) : (
479
490
  isKioskApp
480
491
  ? <HomePage />
481
- : orderStatus.options?.address?.location
492
+ : (orderStatus.options?.address?.location || isAllowUnaddressOrderType)
482
493
  ? <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/search'} />
483
494
  : singleBusinessConfig.isActive
484
- ? <Redirect to={singleBusinessConfig.isActive ? '' : '/search'} />
495
+ ? <Redirect to={`/${singleBusinessConfig.businessSlug}`} />
485
496
  : <HomePage />
486
497
  )}
487
498
  </Route>
@@ -491,9 +502,13 @@ export const App = () => {
491
502
  ) : (
492
503
  isKioskApp
493
504
  ? <HomePage />
494
- : orderStatus.options?.address?.location
495
- ? <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/search'} />
496
- : <HomePage />
505
+ : queryIntegrationToken && queryIntegrationCode === 'spoonity'
506
+ ? <QueryLoginSpoonity token={queryIntegrationToken} />
507
+ : (orderStatus.options?.address?.location || isAllowUnaddressOrderType)
508
+ ? <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/search'} />
509
+ : singleBusinessConfig.isActive
510
+ ? <Redirect to={`/${singleBusinessConfig.businessSlug}`} />
511
+ : <HomePage />
497
512
  )}
498
513
  </Route>
499
514
  <Route exact path='/wallets'>
@@ -597,7 +612,7 @@ export const App = () => {
597
612
  isUserVerifyRequired ? (
598
613
  <Redirect to='/verify' />
599
614
  ) : (
600
- orderStatus.options?.address?.location
615
+ (orderStatus.options?.address?.location || isAllowUnaddressOrderType)
601
616
  ? <BusinessesList searchValueCustom={searchValue} />
602
617
  : <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
603
618
  )
@@ -609,7 +624,7 @@ export const App = () => {
609
624
  {isUserVerifyRequired ? (
610
625
  <Redirect to='/verify' />
611
626
  ) : (
612
- orderStatus.options?.address?.location && !isKioskApp ? (
627
+ (orderStatus.options?.address?.location || isAllowUnaddressOrderType) && !isKioskApp ? (
613
628
  <BusinessListingSearch />
614
629
  ) : (
615
630
  <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />