ordering-ui-external 2.4.6 → 2.5.1

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 (147) hide show
  1. package/_bundles/{0.ordering-ui.038c4b4d536032472bc7.js → 0.ordering-ui.5488030edb520175432d.js} +1 -1
  2. package/_bundles/{1.ordering-ui.038c4b4d536032472bc7.js → 1.ordering-ui.5488030edb520175432d.js} +1 -1
  3. package/_bundles/{2.ordering-ui.038c4b4d536032472bc7.js → 2.ordering-ui.5488030edb520175432d.js} +1 -1
  4. package/_bundles/{4.ordering-ui.038c4b4d536032472bc7.js → 4.ordering-ui.5488030edb520175432d.js} +1 -1
  5. package/_bundles/{5.ordering-ui.038c4b4d536032472bc7.js → 5.ordering-ui.5488030edb520175432d.js} +1 -1
  6. package/_bundles/{6.ordering-ui.038c4b4d536032472bc7.js → 6.ordering-ui.5488030edb520175432d.js} +1 -1
  7. package/_bundles/{7.ordering-ui.038c4b4d536032472bc7.js → 7.ordering-ui.5488030edb520175432d.js} +2 -2
  8. package/_bundles/{8.ordering-ui.038c4b4d536032472bc7.js → 8.ordering-ui.5488030edb520175432d.js} +1 -1
  9. package/_bundles/{9.ordering-ui.038c4b4d536032472bc7.js → 9.ordering-ui.5488030edb520175432d.js} +1 -1
  10. package/_bundles/ordering-ui.5488030edb520175432d.js +2 -0
  11. package/_modules/components/OrdersOption/styles.js +1 -1
  12. package/_modules/components/StripeMethodForm/index.js +26 -11
  13. package/_modules/components/VerticalOrdersLayout/SingleOrderCard/index.js +15 -8
  14. package/_modules/components/VerticalOrdersLayout/styles.js +2 -2
  15. package/_modules/contexts/ThemeContext/index.js +1 -0
  16. package/_modules/themes/five/src/components/AddressList/index.js +8 -7
  17. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +28 -22
  18. package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +22 -21
  19. package/_modules/themes/five/src/components/BusinessController/index.js +5 -3
  20. package/_modules/themes/five/src/components/BusinessInformation/index.js +16 -10
  21. package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +5 -8
  22. package/_modules/themes/five/src/components/BusinessListingSearch/index.js +93 -74
  23. package/_modules/themes/five/src/components/BusinessListingSearch/styles.js +10 -4
  24. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +7 -2
  25. package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
  26. package/_modules/themes/five/src/components/BusinessProductsList/index.js +1 -1
  27. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +38 -13
  28. package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +20 -9
  29. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +35 -23
  30. package/_modules/themes/five/src/components/Cart/index.js +7 -3
  31. package/_modules/themes/five/src/components/Checkout/index.js +12 -11
  32. package/_modules/themes/five/src/components/Checkout/styles.js +8 -4
  33. package/_modules/themes/five/src/components/CitiesControl/index.js +1 -1
  34. package/_modules/themes/five/src/components/GiftCard/GiftCardUI/index.js +1 -0
  35. package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +4 -3
  36. package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +14 -8
  37. package/_modules/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +1 -1
  38. package/_modules/themes/five/src/components/Header/index.js +29 -21
  39. package/_modules/themes/five/src/components/Header/styles.js +44 -40
  40. package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +1 -1
  41. package/_modules/themes/five/src/components/MultiCartsPaymethodsAndWallets/index.js +36 -5
  42. package/_modules/themes/five/src/components/MultiCheckout/index.js +35 -6
  43. package/_modules/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +6 -4
  44. package/_modules/themes/five/src/components/MyOrders/index.js +16 -10
  45. package/_modules/themes/five/src/components/MyOrders/styles.js +15 -12
  46. package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +4 -3
  47. package/_modules/themes/five/src/components/OrderDetails/OrderHistory.js +2 -2
  48. package/_modules/themes/five/src/components/OrderDetails/index.js +2 -2
  49. package/_modules/themes/five/src/components/OrderItAgain/styles.js +1 -1
  50. package/_modules/themes/five/src/components/OrderProgress/index.js +15 -4
  51. package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +16 -4
  52. package/_modules/themes/five/src/components/PageBanner/styles.js +1 -1
  53. package/_modules/themes/five/src/components/PaymentOptions/index.js +8 -5
  54. package/_modules/themes/five/src/components/ProductForm/index.js +27 -7
  55. package/_modules/themes/five/src/components/ProductForm/styles.js +40 -31
  56. package/_modules/themes/five/src/components/ProductItemAccordion/index.js +6 -6
  57. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -3
  58. package/_modules/themes/five/src/components/ReviewProduct/index.js +9 -4
  59. package/_modules/themes/five/src/components/ServiceForm/index.js +22 -3
  60. package/_modules/themes/five/src/components/ServiceForm/styles.js +9 -3
  61. package/_modules/themes/five/src/components/SidebarMenu/index.js +19 -10
  62. package/_modules/themes/five/src/components/SignUpForm/index.js +56 -29
  63. package/_modules/themes/five/src/components/SingleOrderCard/index.js +1 -1
  64. package/_modules/themes/five/src/components/SingleOrderCard/styles.js +26 -24
  65. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/index.js +9 -5
  66. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +2 -2
  67. package/_modules/themes/five/src/components/StripeElementsForm/index.js +3 -1
  68. package/_modules/themes/five/src/components/UpsellingPage/index.js +2 -1
  69. package/_modules/themes/five/src/components/UserFormDetails/index.js +58 -18
  70. package/_modules/themes/five/src/components/UserFormDetails/styles.js +7 -3
  71. package/_modules/themes/five/src/components/UserPopover/index.js +41 -25
  72. package/_modules/themes/five/src/components/UserProfileForm/index.js +19 -11
  73. package/_modules/themes/five/src/styles/Buttons/index.js +68 -58
  74. package/_modules/themes/five/src/styles/Inputs/index.js +40 -16
  75. package/_modules/utils/index.js +8 -2
  76. package/index.html +1 -1
  77. package/package.json +3 -2
  78. package/src/components/OrdersOption/styles.js +1 -0
  79. package/src/components/StripeMethodForm/index.js +22 -10
  80. package/src/components/VerticalOrdersLayout/SingleOrderCard/index.js +35 -17
  81. package/src/components/VerticalOrdersLayout/styles.js +9 -0
  82. package/src/contexts/ThemeContext/index.js +1 -0
  83. package/src/themes/five/src/components/AddressList/index.js +6 -6
  84. package/src/themes/five/src/components/BusinessBasicInformation/index.js +24 -22
  85. package/src/themes/five/src/components/BusinessBasicInformation/styles.js +24 -3
  86. package/src/themes/five/src/components/BusinessController/index.js +4 -2
  87. package/src/themes/five/src/components/BusinessInformation/index.js +24 -12
  88. package/src/themes/five/src/components/BusinessItemAccordion/index.js +5 -6
  89. package/src/themes/five/src/components/BusinessListingSearch/index.js +127 -101
  90. package/src/themes/five/src/components/BusinessListingSearch/styles.js +15 -0
  91. package/src/themes/five/src/components/BusinessProductsCategories/index.js +7 -2
  92. package/src/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
  93. package/src/themes/five/src/components/BusinessProductsList/index.js +1 -1
  94. package/src/themes/five/src/components/BusinessProductsListing/index.js +34 -9
  95. package/src/themes/five/src/components/BusinessProductsListing/styles.js +26 -0
  96. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +9 -2
  97. package/src/themes/five/src/components/Cart/index.js +3 -4
  98. package/src/themes/five/src/components/Checkout/index.js +18 -4
  99. package/src/themes/five/src/components/Checkout/styles.js +22 -0
  100. package/src/themes/five/src/components/CitiesControl/index.js +1 -1
  101. package/src/themes/five/src/components/GiftCard/GiftCardUI/index.js +1 -0
  102. package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +41 -31
  103. package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +15 -4
  104. package/src/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +2 -2
  105. package/src/themes/five/src/components/Header/index.js +17 -5
  106. package/src/themes/five/src/components/Header/styles.js +9 -6
  107. package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +1 -1
  108. package/src/themes/five/src/components/MultiCartsPaymethodsAndWallets/index.js +83 -51
  109. package/src/themes/five/src/components/MultiCheckout/index.js +21 -6
  110. package/src/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +8 -5
  111. package/src/themes/five/src/components/MyOrders/index.js +13 -9
  112. package/src/themes/five/src/components/MyOrders/styles.js +3 -1
  113. package/src/themes/five/src/components/OrderDetails/OrderEta.js +6 -3
  114. package/src/themes/five/src/components/OrderDetails/OrderHistory.js +8 -2
  115. package/src/themes/five/src/components/OrderDetails/index.js +2 -2
  116. package/src/themes/five/src/components/OrderItAgain/styles.js +1 -1
  117. package/src/themes/five/src/components/OrderProgress/index.js +16 -5
  118. package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +7 -4
  119. package/src/themes/five/src/components/PageBanner/styles.js +1 -4
  120. package/src/themes/five/src/components/PaymentOptions/index.js +7 -4
  121. package/src/themes/five/src/components/ProductForm/index.js +23 -5
  122. package/src/themes/five/src/components/ProductForm/styles.js +36 -1
  123. package/src/themes/five/src/components/ProductItemAccordion/index.js +37 -29
  124. package/src/themes/five/src/components/RenderProductsLayout/index.js +3 -3
  125. package/src/themes/five/src/components/ReviewProduct/index.js +14 -6
  126. package/src/themes/five/src/components/ServiceForm/index.js +22 -4
  127. package/src/themes/five/src/components/ServiceForm/styles.js +16 -0
  128. package/src/themes/five/src/components/SidebarMenu/index.js +162 -144
  129. package/src/themes/five/src/components/SignUpForm/index.js +4 -3
  130. package/src/themes/five/src/components/SingleOrderCard/index.js +1 -1
  131. package/src/themes/five/src/components/SingleOrderCard/styles.js +9 -1
  132. package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +13 -3
  133. package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +2 -2
  134. package/src/themes/five/src/components/StripeElementsForm/index.js +3 -1
  135. package/src/themes/five/src/components/UpsellingPage/index.js +1 -1
  136. package/src/themes/five/src/components/UserFormDetails/index.js +58 -14
  137. package/src/themes/five/src/components/UserFormDetails/styles.js +16 -0
  138. package/src/themes/five/src/components/UserPopover/index.js +26 -15
  139. package/src/themes/five/src/components/UserProfileForm/index.js +18 -9
  140. package/src/themes/five/src/styles/Buttons/index.js +11 -0
  141. package/src/themes/five/src/styles/Inputs/index.js +34 -0
  142. package/src/utils/index.js +5 -0
  143. package/template/app.js +5 -3
  144. package/template/theme.json +335 -24
  145. package/_bundles/ordering-ui.038c4b4d536032472bc7.js +0 -2
  146. /package/_bundles/{7.ordering-ui.038c4b4d536032472bc7.js.LICENSE.txt → 7.ordering-ui.5488030edb520175432d.js.LICENSE.txt} +0 -0
  147. /package/_bundles/{ordering-ui.038c4b4d536032472bc7.js.LICENSE.txt → ordering-ui.5488030edb520175432d.js.LICENSE.txt} +0 -0
@@ -4,6 +4,7 @@ import { useSession, useLanguage, useCustomer, useConfig, useOrderingTheme } fro
4
4
  import { useForm } from 'react-hook-form'
5
5
  import parsePhoneNumber from 'libphonenumber-js'
6
6
  import { useTheme } from 'styled-components'
7
+ import { SignUpForm } from '../SignUpForm'
7
8
 
8
9
  import {
9
10
  FormInput,
@@ -14,7 +15,8 @@ import {
14
15
  InputPhoneNumberWrapper,
15
16
  LanguageSelectorWrapper,
16
17
  SwitchWrapper,
17
- NotificationsGroupSwitchWrapper
18
+ NotificationsGroupSwitchWrapper,
19
+ TextLinkWrapper
18
20
  } from './styles'
19
21
 
20
22
  import { Switch } from '../../../../../styles/Switch'
@@ -26,6 +28,7 @@ import { LanguageSelector } from '../../../../../components/LanguageSelector'
26
28
  import { Alert } from '../Confirm'
27
29
  import { sortInputFields } from '../../../../../utils'
28
30
  import { Checkbox } from '../../../../../styles/Checkbox'
31
+ import Modal from '../Modal'
29
32
 
30
33
  export const UserFormDetailsUI = (props) => {
31
34
  const {
@@ -46,24 +49,26 @@ export const UserFormDetailsUI = (props) => {
46
49
  handleChangePromotions,
47
50
  isOldLayout,
48
51
  requiredFields,
49
- handleChangeNotifications
52
+ handleChangeNotifications,
53
+ handlePlaceOrderAsGuest
50
54
  } = props
51
55
 
52
56
  const formMethods = useForm()
53
57
  const [, t] = useLanguage()
54
58
  const [{ configs }] = useConfig()
55
59
  const theme = useTheme()
56
- const [{ user: userSession }] = useSession()
60
+ const [{ user: userSession }, { login }] = useSession()
57
61
  const [orderingTheme] = useOrderingTheme()
58
62
  const [isValidPhoneNumber, setIsValidPhoneNumber] = useState(null)
59
63
  const [userPhoneNumber, setUserPhoneNumber] = useState(null)
60
64
  const [alertState, setAlertState] = useState({ open: false, content: [] })
61
65
  const [, { setUserCustomer }] = useCustomer()
62
66
  const [isChanged, setIsChanged] = useState(false)
67
+ const [modalIsOpen, setModalIsOpen] = useState(false)
63
68
  const emailInput = useRef(null)
64
-
69
+
65
70
  const user = userData || userSession
66
-
71
+
67
72
  const [notificationList, setNotificationList] = useState({
68
73
  email: formState?.result?.result
69
74
  ? !!formState?.result?.result?.settings?.email?.newsletter
@@ -75,12 +80,12 @@ export const UserFormDetailsUI = (props) => {
75
80
  ? !!formState?.result?.result?.settings?.notification?.newsletter
76
81
  : !!(formState?.changes?.settings?.notification?.newsletter ?? (user && user?.settings?.notification?.newsletter))
77
82
  })
78
-
79
- const showCustomerCellphone = !orderingTheme?.theme?.profile?.components?.cellphone?.hidden
80
- const showCustomerPassword = !orderingTheme?.theme?.profile?.components?.password?.hidden
81
- const showCustomerPromotions = !orderingTheme?.theme?.profile?.components?.promotions?.hidden
82
- const showLangauges = !orderingTheme?.theme?.profile?.components?.languages?.hidden
83
- const showNotifications = !orderingTheme?.theme?.profile?.components?.notification_settings?.hidden
83
+
84
+ const showCustomerCellphone = !theme?.profile?.components?.cellphone?.hidden
85
+ const showCustomerPassword = !theme?.profile?.components?.password?.hidden
86
+ const showCustomerPromotions = !theme?.profile?.components?.promotions?.hidden
87
+ const showLangauges = !theme?.profile?.components?.languages?.hidden
88
+ const showNotifications = !theme?.profile?.components?.notification_settings?.hidden
84
89
 
85
90
  const closeAlert = () => {
86
91
  setAlertState({
@@ -90,6 +95,14 @@ export const UserFormDetailsUI = (props) => {
90
95
  cleanFormState && cleanFormState({ result: { error: false } })
91
96
  }
92
97
 
98
+ const handleSuccessSignup = (user) => {
99
+ login({
100
+ user,
101
+ token: user?.session?.access_token
102
+ })
103
+ handlePlaceOrderAsGuest && handlePlaceOrderAsGuest()
104
+ }
105
+
93
106
  const showInputPhoneNumber = validationFields?.fields?.checkout?.cellphone?.enabled ?? false
94
107
 
95
108
  const setUserCellPhone = (isEdit = false) => {
@@ -275,9 +288,9 @@ export const UserFormDetailsUI = (props) => {
275
288
  })
276
289
  }
277
290
 
278
- useEffect(()=> {
291
+ useEffect(() => {
279
292
  isEdit && handleChangeNotifications(notificationList)
280
- },[notificationList])
293
+ }, [notificationList])
281
294
 
282
295
  return (
283
296
  <>
@@ -453,7 +466,7 @@ export const UserFormDetailsUI = (props) => {
453
466
  {formState.loading ? t('UPDATING', 'Updating...') : t('UPDATE', 'Update')}
454
467
  </Button>
455
468
  )}
456
- {requiredFields && (
469
+ {requiredFields && !userSession?.guest_id && (
457
470
  <Button
458
471
  id='form-btn'
459
472
  color='primary'
@@ -464,6 +477,24 @@ export const UserFormDetailsUI = (props) => {
464
477
  </Button>
465
478
  )}
466
479
  </ActionsForm>
480
+ {requiredFields && isCheckout && userSession?.guest_id && (
481
+ <>
482
+ <Button
483
+ id='form-btn'
484
+ color='primary'
485
+ type='button'
486
+ onClick={() => setModalIsOpen(true)}
487
+ disabled={formState.loading}
488
+ >
489
+ {formState.loading ? t('UPDATING', 'Updating...') : t('SIGN_UP_AND_PLACE_ORDER', 'Sign up and place order')}
490
+ </Button>
491
+ <TextLinkWrapper>
492
+ <span onClick={() => handlePlaceOrderAsGuest()}>
493
+ {t('PLACE_ORDER_AS_GUEST', 'Place order as guest')}
494
+ </span>
495
+ </TextLinkWrapper>
496
+ </>
497
+ )}
467
498
  </>
468
499
  ) : (
469
500
  <SkeletonForm>
@@ -482,6 +513,19 @@ export const UserFormDetailsUI = (props) => {
482
513
  onAccept={() => closeAlert()}
483
514
  closeOnBackdrop={false}
484
515
  />
516
+ <Modal
517
+ open={modalIsOpen}
518
+ onClose={() => setModalIsOpen(false)}
519
+ width='760px'
520
+ >
521
+ <SignUpForm
522
+ useLoginByCellphone
523
+ useChekoutFileds
524
+ handleSuccessSignup={handleSuccessSignup}
525
+ isPopup
526
+ isGuest
527
+ />
528
+ </Modal>
485
529
  {props.afterComponents?.map((AfterComponent, i) => (
486
530
  <AfterComponent key={i} {...props} />))}
487
531
  {props.afterElements?.map((AfterElement, i) => (
@@ -208,3 +208,19 @@ export const SwitchWrapper = styled.div`
208
208
  justify-content: space-between;
209
209
  width: 100%;
210
210
  `
211
+
212
+ export const TextLinkWrapper = styled.span`
213
+ width: 100%;
214
+ display: flex;
215
+ justify-content: center;
216
+ margin-top: 15px;
217
+ span {
218
+ font-size: 14px;
219
+ text-align: center;
220
+ cursor: pointer;
221
+ color: ${props => props.theme.colors.primary};
222
+ &:hover {
223
+ text-decoration: underline;
224
+ }
225
+ }
226
+ `
@@ -16,12 +16,7 @@ import { DropDownCircleImage } from '../../../../../components/Dropdown/style'
16
16
  import FaUserAlt from '@meronex/icons/fa/FaUserAlt'
17
17
  import { capitalize } from '../../../../../utils'
18
18
  import AiOutlineMenu from '@meronex/icons/ai/AiOutlineMenu'
19
-
20
- const optionsDefault = [
21
- { name: 'search', pathname: '/explore', displayName: 'My home', key: 'my_home' },
22
- { name: 'business_search', pathname: '/business_search', displayName: 'Browse & Search', key: 'browse_search' },
23
- { name: 'orders', pathname: '/profile/orders', displayName: 'orders', key: 'orders' }
24
- ]
19
+ import { useTheme } from 'styled-components'
25
20
 
26
21
  export const UserPopover = (props) => {
27
22
  const {
@@ -38,7 +33,7 @@ export const UserPopover = (props) => {
38
33
  const [{ configs }] = useConfig()
39
34
  const [orderingTheme] = useOrderingTheme()
40
35
  const [orderStatus] = useOrder()
41
-
36
+ const theme = useTheme()
42
37
  const referenceElement = useRef()
43
38
  const popperElement = useRef()
44
39
  const arrowElement = useRef()
@@ -48,14 +43,30 @@ export const UserPopover = (props) => {
48
43
  const isAddressListNewPage = orderingTheme?.theme?.profile?.components?.address_list?.components?.layout?.position === 'new_page'
49
44
  const isChew = orderingTheme?.theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
50
45
 
46
+ const hideBrowse = theme?.bar_menu?.components?.browse?.hidden
47
+ const hideOrders = theme?.bar_menu?.components?.orders?.hidden
48
+ const hideProfile = theme?.bar_menu?.components?.profile?.hidden
49
+ const hideWallet = theme?.bar_menu?.components?.wallet?.hidden
50
+ const hideMessages = theme?.bar_menu?.components?.messages?.hidden
51
+ const hideHelp = theme?.bar_menu?.components?.help?.hidden
52
+ const hideFavorites = theme?.bar_menu?.components?.favortes?.hidden
53
+ const hideSession = theme?.bar_menu?.components?.sessions?.hidden
54
+ const hidePromotions = theme?.bar_menu?.components?.promotions?.hidden
55
+
56
+ const optionsDefault = [
57
+ { name: 'search', pathname: '/explore', displayName: 'My home', key: 'my_home', isActive: true },
58
+ { name: 'business_search', pathname: '/business_search', displayName: 'Browse & Search', key: 'browse_search', isActive: !hideBrowse },
59
+ { name: 'orders', pathname: '/profile/orders', displayName: 'orders', key: 'orders', isActive: !hideOrders }
60
+ ]
61
+
51
62
  const extraOptions = [
52
- { name: 'profile', pathname: '/profile', displayName: 'view account', key: 'view_account', isActive: true },
53
- { name: 'wallets', pathname: '/wallets', displayName: 'wallets', key: 'wallets', isActive: isWalletEnabled && !isCustomerMode },
54
- { name: 'promotions', pathname: '/promotions', displayName: 'promotions', key: 'promotions', isActive: isPromotionsEnabled },
55
- { name: 'messages', pathname: '/messages', displayName: 'messages', key: 'messages', isActive: !isCustomerMode },
56
- { name: 'help', pathname: '/help', displayName: 'help', key: 'help', isActive: true },
57
- { name: 'sessions', pathname: '/sessions', displayName: 'sessions', key: 'sessions', isActive: true },
58
- { name: 'favorite', pathname: '/favorite', displayName: 'favorites', key: 'favorites', isActive: true },
63
+ { name: 'profile', pathname: '/profile', displayName: 'view account', key: 'view_account', isActive: !hideProfile },
64
+ { name: 'wallets', pathname: '/wallets', displayName: 'wallets', key: 'wallets', isActive: !hideWallet && isWalletEnabled && !isCustomerMode },
65
+ { name: 'promotions', pathname: '/promotions', displayName: 'promotions', key: 'promotions', isActive: !hidePromotions && isPromotionsEnabled },
66
+ { name: 'messages', pathname: '/messages', displayName: 'messages', key: 'messages', isActive: !hideMessages && !isCustomerMode },
67
+ { name: 'help', pathname: '/help', displayName: 'help', key: 'help', isActive: !hideHelp },
68
+ { name: 'sessions', pathname: '/sessions', displayName: 'sessions', key: 'sessions', isActive: !hideSession },
69
+ { name: 'favorite', pathname: '/favorite', displayName: 'favorites', key: 'favorites', isActive: !hideFavorites },
59
70
  { name: 'addresses', pathname: '/profile/addresses', displayName: 'places', key: 'places', isActive: isAddressListNewPage }
60
71
  ]
61
72
 
@@ -149,7 +160,7 @@ export const UserPopover = (props) => {
149
160
  <PopoverBody ref={popperElement} style={popStyle} {...attributes.popper}>
150
161
  <PopoverList>
151
162
  {options && options.length > 0 && (
152
- options.map((option, i) => (
163
+ options.filter(option => option.isActive).map((option, i) => (
153
164
  <PopoverListLink
154
165
  key={i}
155
166
  active={window.location.pathname === option.pathname}
@@ -41,6 +41,7 @@ import {
41
41
  ListLink,
42
42
  ListItem
43
43
  } from './styles'
44
+ import { useTheme } from 'styled-components'
44
45
 
45
46
  const LogoutActionUI = (props) => {
46
47
  const [, t] = useLanguage()
@@ -95,6 +96,7 @@ const UserProfileFormUI = (props) => {
95
96
  const [events] = useEvent()
96
97
  const [{ user }] = useSession()
97
98
  const [{ configs }] = useConfig()
99
+ const theme = useTheme()
98
100
  const [orderingTheme] = useOrderingTheme()
99
101
  const [willVerifyOtpState, setWillVerifyOtpState] = useState(false)
100
102
  const [otpLeftTime, , resetOtpLeftTime] = useCountdownTimer(
@@ -103,9 +105,9 @@ const UserProfileFormUI = (props) => {
103
105
  const inputRef = useRef(null)
104
106
  const windowSize = useWindowSize()
105
107
 
106
- const showCustomerPicture = !orderingTheme?.theme?.profile?.components?.picture?.hidden
107
- const showAddressList = !orderingTheme?.theme?.profile?.components?.address_list?.hidden
108
- const userFormLayoutRow = orderingTheme?.theme?.profile?.components?.layout?.position === 'row'
108
+ const showCustomerPicture = !theme?.profile?.components?.picture?.hidden
109
+ const showAddressList = !theme?.profile?.components?.address_list?.hidden
110
+ const userFormLayoutRow = theme?.profile?.components?.layout?.position === 'row'
109
111
 
110
112
  const isPromotionsEnabled = configs?.advanced_offers_module?.value === '1' || configs?.advanced_offers_module?.value === true
111
113
  const isAddressListNewPage = orderingTheme?.theme?.profile?.components?.address_list?.components?.layout?.position === 'new_page'
@@ -113,13 +115,20 @@ const UserProfileFormUI = (props) => {
113
115
  configs?.wallet_enabled?.value === '1' &&
114
116
  (configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
115
117
 
118
+ const hideWallet = theme?.bar_menu?.components?.wallet?.hidden
119
+ const hideMessages = theme?.bar_menu?.components?.messages?.hidden
120
+ const hideHelp = theme?.bar_menu?.components?.help?.hidden
121
+ const hideFavorites = theme?.bar_menu?.components?.favortes?.hidden
122
+ const hideSession = theme?.bar_menu?.components?.sessions?.hidden
123
+ const hidePromotions = theme?.bar_menu?.components?.promotions?.hidden
124
+
116
125
  const profileOptions = [
117
- { name: 'wallets', pathname: '/wallets', displayName: 'wallets', key: 'wallets', isActive: isWalletEnabled && !isCustomerMode },
118
- { name: 'promotions', pathname: '/promotions', displayName: 'promotions', key: 'promotions', isActive: isPromotionsEnabled },
119
- { name: 'messages', pathname: '/messages', displayName: 'messages', key: 'messages', isActive: !isCustomerMode },
120
- { name: 'help', pathname: '/help', displayName: 'help', key: 'help', isActive: true },
121
- { name: 'sessions', pathname: '/sessions', displayName: 'sessions', key: 'sessions', isActive: true },
122
- { name: 'favorite', pathname: '/favorite', displayName: 'favorites', key: 'favorites', isActive: true },
126
+ { name: 'wallets', pathname: '/wallets', displayName: 'wallets', key: 'wallets', isActive: !hideWallet && isWalletEnabled && !isCustomerMode },
127
+ { name: 'promotions', pathname: '/promotions', displayName: 'promotions', key: 'promotions', isActive: !hidePromotions && isPromotionsEnabled },
128
+ { name: 'messages', pathname: '/messages', displayName: 'messages', key: 'messages', isActive: !hideMessages && !isCustomerMode },
129
+ { name: 'help', pathname: '/help', displayName: 'help', key: 'help', isActive: !hideHelp },
130
+ { name: 'sessions', pathname: '/sessions', displayName: 'sessions', key: 'sessions', isActive: !hideSession },
131
+ { name: 'favorite', pathname: '/favorite', displayName: 'favorites', key: 'favorites', isActive: !hideFavorites },
123
132
  { name: 'addresses', pathname: '/profile/addresses', displayName: 'places', key: 'places', isActive: isAddressListNewPage }
124
133
  ]
125
134
 
@@ -44,6 +44,17 @@ export const Button = styled.button`
44
44
  `}
45
45
  }
46
46
  `}
47
+ ${({ theme }) => theme?.general?.components?.buttons?.borderRadius && css`
48
+ border-radius: ${theme?.general?.components?.buttons?.borderRadius};
49
+ `}
50
+ ${({ theme }) => Object.values(theme?.general?.components?.buttons?.shadow?.components || {}).some(val => !!val) && css`
51
+ box-shadow:
52
+ ${theme?.general?.components?.buttons?.shadow?.components?.x || '0px'}
53
+ ${theme?.general?.components?.buttons?.shadow?.components?.y || '0px'}
54
+ ${theme?.general?.components?.buttons?.shadow?.components?.blur || '0px'}
55
+ ${theme?.general?.components?.buttons?.shadow?.components?.spread || '0px'}
56
+ ${theme?.general?.components?.buttons?.shadow?.components?.color || '#000'};
57
+ `}
47
58
  ${({ outline }) => outline && css`
48
59
  background: #FFF;
49
60
  color: #CCC;
@@ -31,6 +31,23 @@ export const Input = styled.input`
31
31
  ${({ isError }) => isError && css`
32
32
  border-color: ${props => props.theme.colors?.danger500} !important;
33
33
  `}
34
+
35
+ ${({ theme }) => theme?.general?.components?.inputs?.borderRadius && css`
36
+ border-radius: ${theme?.general?.components?.inputs?.borderRadius};
37
+ `}
38
+
39
+ ${({ theme }) => theme?.general?.components?.inputs?.color && css`
40
+ color: ${theme?.general?.components?.inputs?.color};
41
+ `}
42
+
43
+ ${({ theme }) => theme?.general?.components?.inputs?.borderColor && css`
44
+ border: 1px solid ${theme?.general?.components?.inputs?.borderColor};
45
+ &::placeholder,
46
+ &::-webkit-input-placeholder,
47
+ &:-ms-input-placeholder {
48
+ color: ${theme?.general?.components?.inputs?.borderColor};
49
+ }
50
+ `}
34
51
  `
35
52
 
36
53
  export const InputGroup = styled.div`
@@ -95,6 +112,23 @@ export const TextArea = styled.textarea`
95
112
  &:-ms-input-placeholder {
96
113
  color: #DBDCDB;
97
114
  }
115
+
116
+ ${({ theme }) => theme?.general?.components?.inputs?.borderRadius && css`
117
+ border-radius: ${theme?.general?.components?.inputs?.borderRadius};
118
+ `}
119
+
120
+ ${({ theme }) => theme?.general?.components?.inputs?.color && css`
121
+ color: ${theme?.general?.components?.inputs?.color};
122
+ `}
123
+
124
+ ${({ theme }) => theme?.general?.components?.inputs?.borderColor && css`
125
+ border: 1px solid ${theme?.general?.components?.inputs?.borderColor};
126
+ &::placeholder,
127
+ &::-webkit-input-placeholder,
128
+ &:-ms-input-placeholder {
129
+ color: ${theme?.general?.components?.inputs?.borderColor};
130
+ }
131
+ `}
98
132
  `
99
133
 
100
134
  export const InputGroupRight = styled(InputGroupLeft)`
@@ -357,6 +357,11 @@ export const priceList = [
357
357
  { level: '5', content: '$$$$$' }
358
358
  ]
359
359
 
360
+ /**
361
+ * List of order type
362
+ */
363
+ export const orderTypeList = ['delivery', 'pickup', 'eatin', 'curbside', 'drivethru', 'seatdelivery']
364
+
360
365
  /**
361
366
  * function to manage review comment list
362
367
  * @param {number} param0 type of reviews to return
package/template/app.js CHANGED
@@ -346,7 +346,7 @@ export const App = () => {
346
346
  const oldLink = document.getElementById('favicon')
347
347
  link.id = 'favicon'
348
348
  link.rel = 'icon'
349
- link.href = themeUpdated?.general?.components?.favicon
349
+ link.href = themeUpdated?.general?.components?.favicon?.components?.image || themeUpdated?.general?.components?.favicon
350
350
  if (oldLink) {
351
351
  document.head.removeChild(oldLink)
352
352
  }
@@ -356,7 +356,8 @@ export const App = () => {
356
356
  const fontElement = window.document.getElementById(`${name}-font-styles`)
357
357
  if (
358
358
  (fontElement?.name !== fontFamily.name && fontFamily.name) ||
359
- (fontElement?.href !== fontFamily?.href && fontFamily?.href)
359
+ (fontElement?.href !== fontFamily?.href && fontFamily?.href) ||
360
+ (JSON.stringify(fontElement?.weights) !== JSON.stringify(fontFamily?.weights) && fontFamily?.weights)
360
361
  ) {
361
362
  window.document.body.removeChild(window.document.getElementById(`${name}-font-styles`))
362
363
  const font = window.document.createElement('link')
@@ -365,7 +366,8 @@ export const App = () => {
365
366
  font.async = true
366
367
  font.defer = true
367
368
  font.name = fontFamily.name
368
- font.href = fontFamily.href || `https://fonts.googleapis.com/css2?family=${fontFamily.name}:wght@${fontFamily.weights.join(';')}&display=swap`
369
+ const weights = typeof fontFamily?.weights === 'number' ? fontFamily?.weights : JSON.parse(fontFamily?.weights)?.join?.(';')
370
+ font.href = fontFamily.href || `https://fonts.googleapis.com/css2?family=${fontFamily?.name}:wght@${weights || [400]}&display=swap`
369
371
 
370
372
  window.document.body.appendChild(font)
371
373
  if (name === 'primary') {