ordering-ui-external 1.7.2 → 1.8.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 (171) hide show
  1. package/_bundles/{0.ordering-ui.f9c3deec77a8e21645ed.js → 0.ordering-ui.cf9ba81c5417ae8af84a.js} +1 -1
  2. package/_bundles/{1.ordering-ui.f9c3deec77a8e21645ed.js → 1.ordering-ui.cf9ba81c5417ae8af84a.js} +1 -1
  3. package/_bundles/2.ordering-ui.cf9ba81c5417ae8af84a.js +1 -0
  4. package/_bundles/{4.ordering-ui.f9c3deec77a8e21645ed.js → 4.ordering-ui.cf9ba81c5417ae8af84a.js} +1 -1
  5. package/_bundles/{5.ordering-ui.f9c3deec77a8e21645ed.js → 5.ordering-ui.cf9ba81c5417ae8af84a.js} +1 -1
  6. package/_bundles/{6.ordering-ui.f9c3deec77a8e21645ed.js → 6.ordering-ui.cf9ba81c5417ae8af84a.js} +1 -1
  7. package/_bundles/{7.ordering-ui.f9c3deec77a8e21645ed.js → 7.ordering-ui.cf9ba81c5417ae8af84a.js} +2 -2
  8. package/_bundles/{7.ordering-ui.f9c3deec77a8e21645ed.js.LICENSE.txt → 7.ordering-ui.cf9ba81c5417ae8af84a.js.LICENSE.txt} +0 -0
  9. package/_bundles/{8.ordering-ui.f9c3deec77a8e21645ed.js → 8.ordering-ui.cf9ba81c5417ae8af84a.js} +1 -1
  10. package/_bundles/{9.ordering-ui.f9c3deec77a8e21645ed.js → 9.ordering-ui.cf9ba81c5417ae8af84a.js} +1 -1
  11. package/_bundles/ordering-ui.cf9ba81c5417ae8af84a.js +2 -0
  12. package/_bundles/{ordering-ui.f9c3deec77a8e21645ed.js.LICENSE.txt → ordering-ui.cf9ba81c5417ae8af84a.js.LICENSE.txt} +0 -0
  13. package/_modules/components/BusinessInformation/index.js +4 -8
  14. package/_modules/components/OrdersOption/styles.js +4 -2
  15. package/_modules/components/Pagination/index.js +100 -0
  16. package/_modules/components/Pagination/styles.js +56 -0
  17. package/_modules/components/SmartAppBanner/index.js +2 -1
  18. package/_modules/components/VerticalOrdersLayout/SingleOrderCard/index.js +92 -0
  19. package/_modules/components/VerticalOrdersLayout/index.js +115 -41
  20. package/_modules/components/VerticalOrdersLayout/styles.js +25 -11
  21. package/_modules/index.js +7 -0
  22. package/_modules/themes/five/src/components/AccordionDropdown/index.js +15 -4
  23. package/_modules/themes/five/src/components/AccordionDropdown/styles.js +14 -4
  24. package/_modules/themes/five/src/components/AddressList/styles.js +2 -2
  25. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +17 -10
  26. package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +48 -42
  27. package/_modules/themes/five/src/components/BusinessListingSearch/index.js +5 -1
  28. package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +0 -3
  29. package/_modules/themes/five/src/components/BusinessProductsCategories/layouts/groceries/index.js +22 -13
  30. package/_modules/themes/five/src/components/BusinessProductsCategories/layouts/groceries/styles.js +15 -7
  31. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +3 -0
  32. package/_modules/themes/five/src/components/BusinessTypeFilter/index.js +15 -5
  33. package/_modules/themes/five/src/components/BusinessesListing/index.js +6 -13
  34. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +66 -40
  35. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +13 -7
  36. package/_modules/themes/five/src/components/BusinessesListing/layouts/StarbucksBusinessesListing/index.js +16 -7
  37. package/_modules/themes/five/src/components/BusinessesListing/layouts/StarbucksBusinessesListing/styles.js +21 -15
  38. package/_modules/themes/five/src/components/CardForm/index.js +17 -3
  39. package/_modules/themes/five/src/components/CardForm/styles.js +14 -6
  40. package/_modules/themes/five/src/components/CartPopover/index.js +6 -4
  41. package/_modules/themes/five/src/components/CartPopover/styles.js +4 -2
  42. package/_modules/themes/five/src/components/Footer/index.js +16 -6
  43. package/_modules/themes/five/src/components/Footer/styles.js +11 -9
  44. package/_modules/themes/five/src/components/Header/index.js +14 -9
  45. package/_modules/themes/five/src/components/Header/styles.js +64 -44
  46. package/_modules/themes/five/src/components/HeaderOption/index.js +9 -2
  47. package/_modules/themes/five/src/components/HeaderOption/styles.js +8 -2
  48. package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +9 -3
  49. package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +5 -3
  50. package/_modules/themes/five/src/components/HorizontalOrdersLayout/index.js +9 -19
  51. package/_modules/themes/five/src/components/HorizontalOrdersLayout/styles.js +23 -19
  52. package/_modules/themes/five/src/components/InputPhoneNumber/index.js +1 -0
  53. package/_modules/themes/five/src/components/LoginForm/index.js +3 -2
  54. package/_modules/themes/five/src/components/MyOrders/index.js +24 -56
  55. package/_modules/themes/five/src/components/MyOrders/styles.js +1 -1
  56. package/_modules/themes/five/src/components/OrderDetails/index.js +5 -2
  57. package/_modules/themes/five/src/components/OrderDetails/styles.js +24 -24
  58. package/_modules/themes/five/src/components/OrderItAgain/styles.js +6 -2
  59. package/_modules/themes/five/src/components/OrdersOption/index.js +18 -18
  60. package/_modules/themes/five/src/components/OrdersOption/styles.js +2 -2
  61. package/_modules/themes/five/src/components/PageBanner/index.js +50 -0
  62. package/_modules/themes/five/src/components/PageBanner/styles.js +18 -0
  63. package/_modules/themes/five/src/components/Pagination/index.js +99 -0
  64. package/_modules/themes/five/src/components/Pagination/styles.js +56 -0
  65. package/_modules/themes/five/src/components/ProductForm/index.js +39 -23
  66. package/_modules/themes/five/src/components/ProductForm/styles.js +74 -38
  67. package/_modules/themes/five/src/components/Promotions/index.js +7 -2
  68. package/_modules/themes/five/src/components/Promotions/styles.js +16 -14
  69. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +31 -10
  70. package/_modules/themes/five/src/components/RenderProductsLayout/styles.js +19 -11
  71. package/_modules/themes/five/src/components/SidebarMenu/styles.js +1 -1
  72. package/_modules/themes/five/src/components/SignUpForm/index.js +3 -2
  73. package/_modules/themes/five/src/components/SingleOrderCard/index.js +7 -17
  74. package/_modules/themes/five/src/components/SingleProductCard/index.js +7 -298
  75. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/index.js +310 -0
  76. package/_modules/themes/five/src/components/SingleProductCard/{styles.js → layouts/original/styles.js} +37 -33
  77. package/_modules/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +305 -0
  78. package/_modules/themes/five/src/components/SingleProductCard/layouts/starbucks/styles.js +143 -0
  79. package/_modules/themes/five/src/components/StripeElementsForm/index.js +1 -0
  80. package/_modules/themes/five/src/components/UserPopover/index.js +3 -1
  81. package/_modules/themes/five/src/components/UserPopover/styles.js +4 -3
  82. package/_modules/themes/five/src/components/UserProfileForm/styles.js +5 -8
  83. package/_modules/themes/six/src/components/BusinessController/index.js +81 -15
  84. package/_modules/themes/six/src/components/BusinessController/styles.js +58 -30
  85. package/_modules/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +5 -3
  86. package/_modules/themes/six/src/components/BusinessesMap/styles.js +1 -1
  87. package/_modules/themes/six/src/components/SearchBar/index.js +19 -10
  88. package/_modules/themes/six/src/components/SearchBar/styles.js +44 -16
  89. package/index-template.js +3 -1
  90. package/package.json +2 -2
  91. package/src/components/BusinessInformation/index.js +3 -8
  92. package/src/components/OrdersOption/styles.js +5 -5
  93. package/src/components/Pagination/index.js +107 -0
  94. package/src/components/Pagination/styles.js +106 -0
  95. package/src/components/SmartAppBanner/index.js +1 -0
  96. package/src/components/VerticalOrdersLayout/SingleOrderCard/index.js +89 -0
  97. package/src/components/VerticalOrdersLayout/index.js +86 -48
  98. package/src/components/VerticalOrdersLayout/styles.js +66 -22
  99. package/src/index.js +2 -0
  100. package/src/themes/five/src/components/AccordionDropdown/index.js +19 -6
  101. package/src/themes/five/src/components/AccordionDropdown/styles.js +25 -1
  102. package/src/themes/five/src/components/AddressList/styles.js +2 -0
  103. package/src/themes/five/src/components/BusinessBasicInformation/index.js +21 -11
  104. package/src/themes/five/src/components/BusinessBasicInformation/styles.js +9 -3
  105. package/src/themes/five/src/components/BusinessListingSearch/index.js +1 -0
  106. package/src/themes/five/src/components/BusinessProductsCategories/index.js +0 -2
  107. package/src/themes/five/src/components/BusinessProductsCategories/layouts/groceries/index.js +23 -12
  108. package/src/themes/five/src/components/BusinessProductsCategories/layouts/groceries/styles.js +12 -4
  109. package/src/themes/five/src/components/BusinessProductsListing/index.js +3 -0
  110. package/src/themes/five/src/components/BusinessTypeFilter/index.js +15 -5
  111. package/src/themes/five/src/components/BusinessesListing/index.js +5 -5
  112. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +54 -25
  113. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +40 -26
  114. package/src/themes/five/src/components/BusinessesListing/layouts/StarbucksBusinessesListing/index.js +19 -6
  115. package/src/themes/five/src/components/BusinessesListing/layouts/StarbucksBusinessesListing/styles.js +38 -3
  116. package/src/themes/five/src/components/CardForm/index.js +49 -8
  117. package/src/themes/five/src/components/CardForm/styles.js +20 -2
  118. package/src/themes/five/src/components/CartPopover/index.js +2 -1
  119. package/src/themes/five/src/components/CartPopover/styles.js +3 -3
  120. package/src/themes/five/src/components/Footer/index.js +15 -6
  121. package/src/themes/five/src/components/Footer/styles.js +15 -14
  122. package/src/themes/five/src/components/Header/index.js +6 -4
  123. package/src/themes/five/src/components/Header/styles.js +14 -11
  124. package/src/themes/five/src/components/HeaderOption/index.js +13 -10
  125. package/src/themes/five/src/components/HeaderOption/styles.js +2 -2
  126. package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +22 -10
  127. package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/styles.js +8 -0
  128. package/src/themes/five/src/components/HorizontalOrdersLayout/index.js +24 -36
  129. package/src/themes/five/src/components/HorizontalOrdersLayout/styles.js +12 -1
  130. package/src/themes/five/src/components/InputPhoneNumber/index.js +1 -0
  131. package/src/themes/five/src/components/LoginForm/index.js +2 -1
  132. package/src/themes/five/src/components/MyOrders/index.js +20 -62
  133. package/src/themes/five/src/components/MyOrders/styles.js +1 -2
  134. package/src/themes/five/src/components/OrderDetails/index.js +9 -0
  135. package/src/themes/five/src/components/OrderDetails/styles.js +0 -55
  136. package/src/themes/five/src/components/OrderItAgain/styles.js +18 -0
  137. package/src/themes/five/src/components/OrdersOption/index.js +10 -16
  138. package/src/themes/five/src/components/OrdersOption/styles.js +1 -3
  139. package/src/themes/five/src/components/PageBanner/index.js +58 -0
  140. package/src/themes/five/src/components/PageBanner/styles.js +58 -0
  141. package/src/themes/five/src/components/Pagination/index.js +106 -0
  142. package/src/themes/five/src/components/Pagination/styles.js +106 -0
  143. package/src/themes/five/src/components/ProductForm/index.js +108 -84
  144. package/src/themes/five/src/components/ProductForm/styles.js +94 -12
  145. package/src/themes/five/src/components/Promotions/index.js +22 -16
  146. package/src/themes/five/src/components/Promotions/styles.js +10 -4
  147. package/src/themes/five/src/components/RenderProductsLayout/index.js +94 -66
  148. package/src/themes/five/src/components/RenderProductsLayout/styles.js +23 -22
  149. package/src/themes/five/src/components/SidebarMenu/styles.js +1 -1
  150. package/src/themes/five/src/components/SignUpForm/index.js +2 -1
  151. package/src/themes/five/src/components/SingleOrderCard/index.js +0 -21
  152. package/src/themes/five/src/components/SingleProductCard/index.js +7 -300
  153. package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +312 -0
  154. package/src/themes/five/src/components/SingleProductCard/{styles.js → layouts/original/styles.js} +9 -6
  155. package/src/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +313 -0
  156. package/src/themes/five/src/components/SingleProductCard/layouts/starbucks/styles.js +353 -0
  157. package/src/themes/five/src/components/StripeElementsForm/index.js +1 -0
  158. package/src/themes/five/src/components/UserPopover/index.js +2 -0
  159. package/src/themes/five/src/components/UserPopover/styles.js +2 -2
  160. package/src/themes/five/src/components/UserProfileForm/styles.js +3 -11
  161. package/src/themes/six/src/components/BusinessController/index.js +163 -62
  162. package/src/themes/six/src/components/BusinessController/styles.js +53 -14
  163. package/src/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +3 -1
  164. package/src/themes/six/src/components/BusinessesMap/styles.js +1 -1
  165. package/src/themes/six/src/components/SearchBar/index.js +27 -8
  166. package/src/themes/six/src/components/SearchBar/styles.js +33 -2
  167. package/template/app.js +364 -364
  168. package/template/assets/images/chew_logo.png +0 -0
  169. package/template/components/HelmetTags/index.js +5 -4
  170. package/_bundles/2.ordering-ui.f9c3deec77a8e21645ed.js +0 -1
  171. package/_bundles/ordering-ui.f9c3deec77a8e21645ed.js +0 -2
@@ -0,0 +1,313 @@
1
+ import React, { useRef, useState } from 'react'
2
+ import Skeleton from 'react-loading-skeleton'
3
+ import { useLanguage, useConfig, useOrder, useUtils, useSession, useOrderingTheme, SingleProductCard as SingleProductCardController } from 'ordering-components-external'
4
+ import { shape } from '../../../../../../../utils'
5
+ import { useIntersectionObserver } from '../../../../../../../hooks/useIntersectionObserver'
6
+ import { Heart as DisLike, HeartFill as Like } from 'react-bootstrap-icons'
7
+ import { useTheme } from 'styled-components'
8
+ import { Modal } from '../../../Modal'
9
+ import { LoginForm } from '../../../LoginForm'
10
+ import { SignUpForm } from '../../../SignUpForm'
11
+ import { ForgotPasswordForm } from '../../../ForgotPasswordForm'
12
+ import { Alert } from '../../../Confirm'
13
+ import MdAddCircleOutline from '@meronex/icons/ios/MdAddCircleOutline'
14
+ import {
15
+ CardContainer,
16
+ CardInfo,
17
+ WrapLogo,
18
+ CardLogo,
19
+ SoldOut,
20
+ PriceWrapper,
21
+ QuantityContainer,
22
+ RibbonBox,
23
+ TitleWrapper,
24
+ LastOrder,
25
+ SkeletonCardInfo,
26
+ SkeletonCardLogo,
27
+ AddButton,
28
+ SkeletonWrapper
29
+ } from './styles'
30
+
31
+ const SingleProductCardUI = (props) => {
32
+ const {
33
+ product,
34
+ isSoldOut,
35
+ isSkeleton,
36
+ onProductClick,
37
+ isCartOnProductsList,
38
+ useCustomFunctionality,
39
+ onCustomClick,
40
+ customText,
41
+ customStyle,
42
+ useKioskApp,
43
+ productAddedToCartLength,
44
+ handleFavoriteProduct,
45
+ isFavorite,
46
+ isPreviously
47
+ } = props
48
+
49
+ const [, t] = useLanguage()
50
+ const [$element, isObserved] = useIntersectionObserver()
51
+ const [stateConfig] = useConfig()
52
+ const [{ parsePrice, optimizeImage, parseDate }] = useUtils()
53
+ const [orderState] = useOrder()
54
+ const [{ auth }, { login }] = useSession()
55
+ const [orderingTheme] = useOrderingTheme()
56
+ const theme = useTheme()
57
+ const favoriteRef = useRef(null)
58
+
59
+ const [isModalOpen, setIsModalOpen] = useState(false)
60
+ const [modalPageToShow, setModalPageToShow] = useState(null)
61
+ const [alertState, setAlertState] = useState({ open: false, content: [] })
62
+
63
+ const editMode = typeof product?.code !== 'undefined'
64
+ const isObservedValidation = isObserved || useKioskApp
65
+
66
+ const removeToBalance = editMode ? product?.quantity : 0
67
+
68
+ const cartProducts = Object.values(orderState.carts).reduce((products, _cart) => [...products, ..._cart?.products], [])
69
+ const productBalance = cartProducts.reduce((sum, _product) => sum + (_product.id === product?.id ? _product.quantity : 0), 0)
70
+
71
+ const totalBalance = (productBalance || 0) - removeToBalance
72
+
73
+ const maxCartProductConfig = (stateConfig.configs.max_product_amount ? parseInt(stateConfig.configs.max_product_amount) : 100) - totalBalance
74
+
75
+ const hideAddButton = theme?.business_view?.components?.products?.components?.add_to_cart_button?.hidden ?? true
76
+ // const productsRows = theme?.layouts?.business_view?.components?.products?.components?.layout?.rows
77
+
78
+ let maxCartProductInventory = (product?.inventoried ? product?.quantity : undefined) - totalBalance
79
+ maxCartProductInventory = !isNaN(maxCartProductInventory) ? maxCartProductInventory : maxCartProductConfig
80
+
81
+ const maxProductQuantity = Math.min(maxCartProductConfig, maxCartProductInventory)
82
+
83
+ const handleClickProduct = (e) => {
84
+ if (favoriteRef?.current?.contains(e.target)) return
85
+ if (productAddedToCartLength && product?.maximum_per_order && productAddedToCartLength >= product?.maximum_per_order) {
86
+ setAlertState({
87
+ open: true,
88
+ content: [t('PRODUCT_ON_MAXIMUM_ORDER', 'The product is on maximum order')]
89
+ })
90
+ return
91
+ }
92
+
93
+ if (isFavorite) {
94
+ onProductClick && onProductClick()
95
+ return
96
+ }
97
+ (!isSkeleton && !useCustomFunctionality && onProductClick && onProductClick(product, product?.business?.slug)) ||
98
+ (useCustomFunctionality && onCustomClick && onCustomClick())
99
+ }
100
+
101
+ const closeAlert = () => {
102
+ setAlertState({
103
+ open: false,
104
+ content: []
105
+ })
106
+ }
107
+
108
+ const handleChangeFavorite = () => {
109
+ if (auth) {
110
+ handleFavoriteProduct && handleFavoriteProduct(!product?.favorite)
111
+ } else {
112
+ setModalPageToShow('login')
113
+ setIsModalOpen(true)
114
+ }
115
+ }
116
+
117
+ const closeAuthModal = () => {
118
+ setIsModalOpen(false)
119
+ setModalPageToShow(null)
120
+ }
121
+
122
+ const handleSuccessLogin = (user) => {
123
+ if (user) {
124
+ closeAuthModal()
125
+ }
126
+ }
127
+
128
+ const handleCustomModalClick = (e, { page }) => {
129
+ e.preventDefault()
130
+ setModalPageToShow(page)
131
+ }
132
+
133
+ const handleSuccessSignup = (user) => {
134
+ login({
135
+ user,
136
+ token: user?.session?.access_token
137
+ })
138
+ }
139
+
140
+ return (
141
+ <>
142
+ <CardContainer
143
+ ref={$element}
144
+ soldOut={isSoldOut || maxProductQuantity <= 0}
145
+ onClick={handleClickProduct}
146
+ isCartOnProductsList={isCartOnProductsList}
147
+ style={useCustomFunctionality && customStyle}
148
+ className='product-card'
149
+ isShowAddButt={!useCustomFunctionality && !hideAddButton && !isSkeleton}
150
+ // productsRows={productsRows}
151
+ >
152
+ {isObservedValidation ? (
153
+ <>
154
+ <div>
155
+ {!useCustomFunctionality && (
156
+ <>
157
+ <CardInfo soldOut={isSoldOut || maxProductQuantity <= 0} isBgimage={optimizeImage(product?.images || theme?.images?.dummies?.product, 'h_86,c_limit')} oneLine={isPreviously}>
158
+ <>
159
+ {!isSkeleton ? (
160
+ <WrapLogo isBgimage={optimizeImage(product?.images || theme?.images?.dummies?.product, 'h_86,c_limit')}>
161
+ {!isSkeleton && productAddedToCartLength > 0 && (
162
+ <QuantityContainer>
163
+ <span>{productAddedToCartLength}</span>
164
+ </QuantityContainer>
165
+ )}
166
+ {product?.ribbon?.enabled && (
167
+ <RibbonBox
168
+ bgColor={product?.ribbon?.color}
169
+ isRoundRect={product?.ribbon?.shape === shape?.rectangleRound}
170
+ isCapsule={product?.ribbon?.shape === shape?.capsuleShape}
171
+ >
172
+ {product?.ribbon?.text}
173
+ </RibbonBox>
174
+ )}
175
+ <CardLogo
176
+ className='image'
177
+ soldOut={isSoldOut || maxProductQuantity <= 0}
178
+ bgimage={optimizeImage(product?.images || theme?.images?.dummies?.product, 'h_86,c_limit')}
179
+ />
180
+ </WrapLogo>
181
+ ) : (
182
+ <Skeleton height={75} width={75} />
183
+ )}
184
+ {!isSkeleton ? (
185
+ <PriceWrapper>
186
+ <span>{product?.price ? parsePrice(product?.price) : ''}</span>
187
+ {!(isSoldOut || maxProductQuantity <= 0) && (
188
+ <span className='off-price'>{product?.offer_price && product?.in_offer ? parsePrice(product?.offer_price) : ''}</span>
189
+ )}
190
+ </PriceWrapper>
191
+ ) : (
192
+ <Skeleton width={100} />
193
+ )}
194
+ {!isSkeleton ? (<h1>{product?.name}</h1>) : (<Skeleton width={100} />)}
195
+ {!useKioskApp && !isPreviously && (
196
+ !isSkeleton ? (
197
+ <span onClick={() => handleChangeFavorite()} ref={favoriteRef}>
198
+ {product?.favorite ? <Like /> : <DisLike />}
199
+ </span>
200
+ ) : (<Skeleton width={16} height={16} />)
201
+ )}
202
+ </>
203
+ {/* {!isSkeleton ? (<p>{product?.description}</p>) : (<Skeleton width={100} />)} */}
204
+ {isPreviously && (!isSkeleton ? (<LastOrder>{t('LAST_ORDERED_ON', 'Last ordered on')} {parseDate(product?.last_ordered_date, { outputFormat: 'MMM DD, YYYY' })}</LastOrder>) : (<Skeleton width={80} />))}
205
+ </CardInfo>
206
+
207
+ {(isSoldOut || maxProductQuantity <= 0) && <SoldOut isBottom={product?.ribbon?.enabled}>{t('SOLD_OUT', 'SOLD OUT')}</SoldOut>}
208
+ </>
209
+ )}
210
+ {useCustomFunctionality && customText && (
211
+ <span style={{ fontSize: 16, fontWeight: 500 }}>{customText}</span>
212
+ )}
213
+ </div>
214
+ {!useCustomFunctionality && !hideAddButton && !isSkeleton && (
215
+ <AddButton>
216
+ <MdAddCircleOutline disabled={productAddedToCartLength && product?.maximum_per_order && productAddedToCartLength >= product?.maximum_per_order} />
217
+ </AddButton>
218
+ )}
219
+ </>
220
+ ) : (
221
+ <SkeletonWrapper>
222
+ <SkeletonCardLogo>
223
+ <Skeleton height={75} width={75} />
224
+ </SkeletonCardLogo>
225
+ <SkeletonCardInfo>
226
+ <Skeleton width={100} />
227
+ <Skeleton width={100} />
228
+ <Skeleton width={100} />
229
+ </SkeletonCardInfo>
230
+ </SkeletonWrapper>
231
+ )}
232
+ </CardContainer>
233
+ <Modal
234
+ open={isModalOpen}
235
+ onRemove={() => closeAuthModal()}
236
+ onClose={() => closeAuthModal()}
237
+ width='50%'
238
+ authModal
239
+ >
240
+ {modalPageToShow === 'login' && (
241
+ <LoginForm
242
+ handleSuccessLogin={handleSuccessLogin}
243
+ elementLinkToSignup={
244
+ <a
245
+ onClick={
246
+ (e) => handleCustomModalClick(e, { page: 'signup' })
247
+ } href='#'
248
+ >{t('CREATE_ACCOUNT', theme?.defaultLanguages?.CREATE_ACCOUNT || 'Create account')}
249
+ </a>
250
+ }
251
+ elementLinkToForgotPassword={
252
+ <a
253
+ onClick={
254
+ (e) => handleCustomModalClick(e, { page: 'forgotpassword' })
255
+ } href='#'
256
+ >{t('RESET_PASSWORD', theme?.defaultLanguages?.RESET_PASSWORD || 'Reset password')}
257
+ </a>
258
+ }
259
+ useLoginByCellphone
260
+ isPopup
261
+ />
262
+ )}
263
+ {modalPageToShow === 'signup' && (
264
+ <SignUpForm
265
+ elementLinkToLogin={
266
+ <a
267
+ onClick={
268
+ (e) => handleCustomModalClick(e, { page: 'login' })
269
+ } href='#'
270
+ >{t('LOGIN', theme?.defaultLanguages?.LOGIN || 'Login')}
271
+ </a>
272
+ }
273
+ useLoginByCellphone
274
+ useChekoutFileds
275
+ handleSuccessSignup={handleSuccessSignup}
276
+ isPopup
277
+ closeModal={() => closeAuthModal()}
278
+ />
279
+ )}
280
+ {modalPageToShow === 'forgotpassword' && (
281
+ <ForgotPasswordForm
282
+ elementLinkToLogin={
283
+ <a
284
+ onClick={
285
+ (e) => handleCustomModalClick(e, { page: 'login' })
286
+ } href='#'
287
+ >{t('LOGIN', theme?.defaultLanguages?.LOGIN || 'Login')}
288
+ </a>
289
+ }
290
+ isPopup
291
+ />
292
+ )}
293
+ </Modal>
294
+ <Alert
295
+ title={t('PRODUCT', 'Product')}
296
+ content={alertState.content}
297
+ acceptText={t('ACCEPT', 'Accept')}
298
+ open={alertState.open}
299
+ onClose={() => closeAlert()}
300
+ onAccept={() => closeAlert()}
301
+ closeOnBackdrop={false}
302
+ />
303
+ </>
304
+ )
305
+ }
306
+
307
+ export const SingleProductCard = (props) => {
308
+ const singleProductCardProps = {
309
+ ...props,
310
+ UIComponent: SingleProductCardUI
311
+ }
312
+ return <SingleProductCardController {...singleProductCardProps} />
313
+ }
@@ -0,0 +1,353 @@
1
+ import React from 'react'
2
+ import styled, { css } from 'styled-components'
3
+
4
+ export const CardContainer = styled.div`
5
+ ${({ isShowAddButt }) => css`
6
+ min-height: ${isShowAddButt ? '230px' : '200px'};
7
+ max-height: ${isShowAddButt ? '230px' : '200px'};
8
+ `}
9
+ background: ${({ soldOut }) => soldOut ? '#6c757d33' : '#FFF'};
10
+ padding: 10px;
11
+ border-radius: 7.6px;
12
+ box-sizing: border-box;
13
+ cursor: pointer;
14
+ position: relative;
15
+ display: flex;
16
+ flex-direction: column;
17
+ justify-content: space-between;
18
+ > div {
19
+ display: flex;
20
+ justify-content: space-between;
21
+ flex-direction: column;
22
+ align-items: center;
23
+ }
24
+
25
+ ${({ productsRows }) => productsRows ? css`
26
+ width: ${() => productsRows === 3 ? 'calc(33% - 20px)' : 'calc(50% - 20px)'};
27
+ margin: 10px;
28
+ ` : css`
29
+ width: 100%;
30
+ margin: 10px 0px;
31
+
32
+ @media (min-width: 380px) {
33
+ margin: 10px;
34
+ width: calc(100% - 20px);
35
+ }
36
+ @media (min-width: 480px) {
37
+ margin: 10px;
38
+ width: calc(50% - 20px);
39
+ }
40
+ ${({ isCartOnProductsList }) => isCartOnProductsList ? css`
41
+ @media (min-width: 993px) {
42
+ width: calc(25% - 20px); // 4 per row
43
+ margin: 10px 20px 10px 0px;
44
+ ${props => props.theme?.rtl && css`
45
+ margin: 10px 0px 10px 20px;
46
+ `}
47
+ }
48
+ ` : css`
49
+ @media (min-width: 681px) {
50
+ width: calc(33% - 20px);
51
+ }
52
+
53
+ @media (min-width: 993px) {
54
+ width: calc(25% - 20px);
55
+ }
56
+
57
+ @media (min-width: 1440px) {
58
+ width: calc(20% - 20px);
59
+ margin: 10px 20px 10px 0px;
60
+ ${props => props.theme?.rtl && css`
61
+ margin: 10px 0px 10px 20px;
62
+ `}
63
+ }
64
+ `}
65
+
66
+ `}
67
+ `
68
+
69
+ export const SoldOut = styled.span`
70
+ font-weight: bold;
71
+ position: absolute;
72
+ background: #495057 0% 0% no-repeat padding-box;
73
+ padding: 5px 10px;
74
+ top: 7px;
75
+ border-radius: 2px 0px 0px 2px;
76
+ right: 0px;
77
+ color: white;
78
+ font-size: 12px;
79
+ ${props => props.theme?.rtl && css`
80
+ left: 0px;
81
+ right: initial;
82
+ `}
83
+ &:first-letter {
84
+ text-transform: uppercase;
85
+ }
86
+
87
+ ${({ isBottom }) => isBottom && css`
88
+ bottom: 7px;
89
+ top: initial;
90
+ `}
91
+ `
92
+
93
+ export const CardInfo = styled.div`
94
+ display: flex;
95
+ flex-direction: column;
96
+ width: 100%;
97
+ > * {
98
+ margin: 3px;
99
+ }
100
+ ${({ theme }) => theme?.business_view?.components?.products?.components?.layout?.type === 'pfchangs' && css`
101
+
102
+ `}
103
+ p {
104
+ color: #909BA9;
105
+ text-align: left;
106
+ font-size: 10px;
107
+ ${props => props.theme?.rtl && css`
108
+ text-align: right;
109
+ `}
110
+
111
+ display: -webkit-box;
112
+ -webkit-box-orient: vertical;
113
+ -webkit-line-clamp: 2;
114
+ overflow: hidden;
115
+ white-space: pre-wrap;
116
+ text-align: center;
117
+ }
118
+
119
+ span {
120
+ color: ${props => props.theme.colors.darkTextColor};
121
+ font-size: 14px;
122
+ }
123
+
124
+ ${({ oneLine }) => oneLine && css`
125
+ p {
126
+ -webkit-line-clamp: 1;
127
+ }
128
+ `}
129
+
130
+ h1 {
131
+ font-size: 14px;
132
+ font-weight: 500;
133
+ text-align: center;
134
+ color: ${props => props.theme.colors.headingColor};
135
+ overflow: hidden;
136
+ text-overflow: ellipsis;
137
+ white-space: nowrap;
138
+ margin: 0px;
139
+ }
140
+
141
+ > span {
142
+ display: flex;
143
+ align-items: center;
144
+ justify-content: center;
145
+ cursor: pointer;
146
+ text-align: center;
147
+ svg {
148
+ color: ${props => props.theme.colors.danger500};
149
+ font-size: 16px;
150
+ }
151
+ }
152
+
153
+ @media (min-width: 1024px) {
154
+ p {
155
+ font-size: 12px;
156
+ }
157
+
158
+ span {
159
+ font-size: 14px;
160
+ }
161
+ }
162
+ `
163
+
164
+ export const WrapLogo = styled.div`
165
+ position: relative;
166
+ max-width: 100px;
167
+ max-height: 100px;
168
+ height: 100px;
169
+ align-self: center;
170
+ ${({ isBgimage }) => isBgimage && css`
171
+ width: 100px;
172
+ `}
173
+ ${props => props.theme?.rtl && css`
174
+ margin-right: 5px;
175
+ margin-left: 0px;
176
+ `}
177
+ `
178
+
179
+ const CardLogoStyled = styled.div`
180
+ box-sizing: border-box;
181
+ position: relative;
182
+ background-repeat: no-repeat, repeat;
183
+ background-size: cover;
184
+ background-position: center;
185
+ object-fit: cover;
186
+ min-height: 100px;
187
+ border-radius: ${({ theme }) => theme?.business_view?.components?.products?.components?.photo?.components?.style?.borderRadius || '10px'};
188
+ `
189
+ export const CardLogo = (props) => {
190
+ const style = {}
191
+ if (props.bgimage) {
192
+ style.backgroundImage = `url(${props.bgimage})`
193
+ }
194
+ if (props.soldOut) {
195
+ style.filter = 'brightness(70%)'
196
+ }
197
+ return (
198
+ <CardLogoStyled {...props} style={style}>
199
+ {props.children}
200
+ </CardLogoStyled>
201
+ )
202
+ }
203
+
204
+ export const PriceWrapper = styled.div`
205
+ display: flex;
206
+ align-items: center;
207
+ justify-content: center;
208
+ .off-price {
209
+ ${({ hasOffer }) => !hasOffer && css`
210
+ display: none;
211
+ `}
212
+ font-size: 10px;
213
+ color: #909BA9;
214
+ text-decoration: line-through;
215
+ text-align: center;
216
+ ${props => props.theme.rtl && css`
217
+ margin-right: 5px;
218
+ margin-left: 0;
219
+ `}
220
+
221
+ @media (min-width: 1024px) {
222
+ font-size: 13px;
223
+ }
224
+ }
225
+ `
226
+
227
+ export const QuantityContainer = styled.div`
228
+ background: ${({ theme }) => theme.colors.primary};
229
+ color: #fff;
230
+ position: absolute;
231
+ left: 100%;
232
+ bottom: 100%;
233
+ width: 25px;
234
+ height: 25px;
235
+ text-align: center;
236
+ border-radius: 50%;
237
+ transform: translate(-20px, 80%);
238
+ z-index: 100;
239
+ span{
240
+ color: #fff
241
+ }
242
+ @media (min-width: 768px) {
243
+ transform: translate(-50%, 80%);
244
+ }
245
+ `
246
+
247
+ export const RibbonBox = styled.div`
248
+ position: absolute;
249
+ padding: 2px 8px;
250
+ box-sizing: border-box;
251
+ z-index: 10;
252
+ color: ${props => props.theme.colors.colorTextSignForm};
253
+ font-weight: 400;
254
+ font-size: 10px;
255
+ line-height: 13px;
256
+ top: -4px;
257
+ background-color: ${props => props.theme.colors.primary};
258
+ display: -webkit-box;
259
+ -webkit-box-orient: vertical;
260
+ -webkit-line-clamp: 2;
261
+ overflow: hidden;
262
+ max-width: 70px;
263
+ word-break: break-all;
264
+
265
+ ${props => props.theme.rtl && css`
266
+ left: -3px;
267
+ right: initial;
268
+ `}
269
+
270
+ ${({ bgColor }) => bgColor && css`
271
+ background-color: ${bgColor};
272
+ `}
273
+
274
+ ${({ isRoundRect }) => isRoundRect && css`
275
+ border-radius: 7.6px;
276
+ `}
277
+
278
+ ${({ isCapsule }) => isCapsule && css`
279
+ border-radius: 50px;
280
+ `}
281
+ `
282
+
283
+ export const LastOrder = styled.span`
284
+ color: ${props => props.theme.colors.primary};
285
+ font-weight: 400;
286
+ font-size: 10px !important;
287
+ margin: 0px 3px;
288
+ `
289
+
290
+ export const TitleWrapper = styled.div`
291
+ display: flex;
292
+ align-items: center;
293
+ justify-content: space-between;
294
+
295
+ h1 {
296
+ font-size: 14px;
297
+ font-weight: 500;
298
+ text-align: left;
299
+ color: ${props => props.theme.colors.headingColor};
300
+ overflow: hidden;
301
+ text-overflow: ellipsis;
302
+ white-space: nowrap;
303
+ margin: 0px;
304
+ }
305
+
306
+ > span {
307
+ display: flex;
308
+ align-items: center;
309
+ justify-content: center;
310
+ cursor: pointer;
311
+ svg {
312
+ color: ${props => props.theme.colors.danger500};
313
+ font-size: 16px;
314
+ }
315
+ }
316
+ `
317
+ export const SkeletonCardInfo = styled.div`
318
+ display: flex;
319
+ flex-direction: column;
320
+ width: calc(100% - 10px);
321
+ > * {
322
+ margin: 3px;
323
+ }
324
+ `
325
+ export const SkeletonCardLogo = styled.div`
326
+ max-width: 100px;
327
+ max-height: 100px;
328
+ width: 100px;
329
+ height: 100px;
330
+ margin-left: 5px;
331
+ span{
332
+ border-radius: ${({ theme }) => theme?.business_view?.components?.products?.components?.photo?.components?.style?.borderRadius || '10px'};
333
+ }
334
+ ${props => props.theme?.rtl && css`
335
+ margin-right: 5px;
336
+ margin-left: 0px;
337
+ `}
338
+ `
339
+
340
+ export const AddButton = styled.div`
341
+ display: flex;
342
+ width: 100%;
343
+
344
+ svg {
345
+ width: 30px;
346
+ height: 30px;
347
+ color: #016341;
348
+ }
349
+ `
350
+
351
+ export const SkeletonWrapper = styled.div`
352
+ text-align: center;
353
+ `
@@ -52,6 +52,7 @@ const StripeElementsFormUI = (props) => {
52
52
  handleSource={handleSource}
53
53
  onNewCard={onNewCard}
54
54
  toSave={toSave}
55
+ isSplitForm
55
56
  requirements={requirements}
56
57
  businessId={businessId}
57
58
  handleCancel={onCancel}
@@ -43,6 +43,7 @@ export const UserPopover = (props) => {
43
43
  const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
44
44
  const isPromotionsEnabled = configs?.advanced_offers_module?.value === '1' || configs?.advanced_offers_module?.value === true
45
45
  const isAddressListNewPage = orderingTheme?.theme?.profile?.components?.address_list?.components?.layout?.position === 'new_page'
46
+ const isChew = orderingTheme?.theme?.header?.components?.layout?.type === 'Chew'
46
47
 
47
48
  const extraOptions = [
48
49
  { name: 'profile', pathname: '/profile', displayName: 'view account', key: 'view_account', isActive: true },
@@ -121,6 +122,7 @@ export const UserPopover = (props) => {
121
122
  <HeaderItem
122
123
  isPhoto={sessionState?.user?.photo}
123
124
  isHome={isHome}
125
+ isChew={isChew}
124
126
  ref={referenceElement}
125
127
  isOpen={open}
126
128
  onClick={props.onClick}
@@ -8,7 +8,7 @@ export const HeaderItem = styled.div`
8
8
  padding: 7px 13px;
9
9
  margin: 0px;
10
10
 
11
- ${({ isOpen }) => isOpen && css`
11
+ ${({ isOpen, isChew }) => (isOpen && !isChew) && css`
12
12
  background: #F8F9FA;
13
13
  `}
14
14
 
@@ -27,7 +27,7 @@ export const HeaderItem = styled.div`
27
27
  margin-left: 20px;
28
28
  margin-right: 0;
29
29
  `}
30
- color: ${props => props.theme.colors.darkTextColor};
30
+ color: ${props => props.isChew ? props.theme.colors.backgroundPage : props.theme.colors.darkTextColor};
31
31
  }
32
32
 
33
33
  img {