ordering-ui-react-native 0.17.4 → 0.17.6
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.
- package/package.json +1 -1
- package/themes/original/src/components/FavoriteList/index.tsx +19 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +3 -1
- package/themes/original/src/components/ProductItemAccordion/index.tsx +37 -24
- package/themes/original/src/types/index.tsx +4 -0
package/package.json
CHANGED
|
@@ -14,6 +14,7 @@ import { Container, WrappButton } from './styles'
|
|
|
14
14
|
import { OButton } from '../shared';
|
|
15
15
|
import { BusinessController } from '../BusinessController';
|
|
16
16
|
import { SingleProductCard } from '../SingleProductCard';
|
|
17
|
+
import { NotFoundSource } from '../NotFoundSource';
|
|
17
18
|
import moment from 'moment';
|
|
18
19
|
|
|
19
20
|
|
|
@@ -224,6 +225,12 @@ const FavoriteListUI = (props: FavoriteParams) => {
|
|
|
224
225
|
<BusinessSkeleton key={i} />
|
|
225
226
|
))
|
|
226
227
|
)}
|
|
228
|
+
{!favoriteList?.loading && !favoriteList?.favorites?.length && (
|
|
229
|
+
<NotFoundSource
|
|
230
|
+
content={t('NOT_FOUND_FAVORITES_LIST', 'No favorites to show at this time.')
|
|
231
|
+
}
|
|
232
|
+
/>
|
|
233
|
+
)}
|
|
227
234
|
</>
|
|
228
235
|
)}
|
|
229
236
|
|
|
@@ -250,6 +257,12 @@ const FavoriteListUI = (props: FavoriteParams) => {
|
|
|
250
257
|
<OrderSkeleton key={i} />
|
|
251
258
|
))
|
|
252
259
|
)}
|
|
260
|
+
{!favoriteList?.loading && !favoriteList?.favorites?.length && (
|
|
261
|
+
<NotFoundSource
|
|
262
|
+
content={t('NOT_FOUND_FAVORITES_LIST', 'No favorites to show at this time.')
|
|
263
|
+
}
|
|
264
|
+
/>
|
|
265
|
+
)}
|
|
253
266
|
</>
|
|
254
267
|
)}
|
|
255
268
|
|
|
@@ -271,6 +284,12 @@ const FavoriteListUI = (props: FavoriteParams) => {
|
|
|
271
284
|
<ProductSkeleton key={i} />
|
|
272
285
|
))
|
|
273
286
|
)}
|
|
287
|
+
{!favoriteList?.loading && !favoriteList?.favorites?.length && (
|
|
288
|
+
<NotFoundSource
|
|
289
|
+
content={t('NOT_FOUND_FAVORITES_LIST', 'No favorites to show at this time.')
|
|
290
|
+
}
|
|
291
|
+
/>
|
|
292
|
+
)}
|
|
274
293
|
</>
|
|
275
294
|
)}
|
|
276
295
|
|
|
@@ -11,6 +11,7 @@ export const PreviousProductsOrdered = (props: PreviousProductsOrderedParams) =>
|
|
|
11
11
|
const {
|
|
12
12
|
products,
|
|
13
13
|
onProductClick,
|
|
14
|
+
handleUpdateProducts,
|
|
14
15
|
isBusinessesSearchList
|
|
15
16
|
} = props
|
|
16
17
|
|
|
@@ -28,12 +29,14 @@ export const PreviousProductsOrdered = (props: PreviousProductsOrderedParams) =>
|
|
|
28
29
|
{products?.map((product: any) => (
|
|
29
30
|
<SingleProductCard
|
|
30
31
|
key={product?.id}
|
|
32
|
+
isProductId
|
|
31
33
|
isSoldOut={(product.inventoried && !product.quantity)}
|
|
32
34
|
product={product}
|
|
33
35
|
businessId={product?.business?.id}
|
|
34
36
|
onProductClick={onProductClick}
|
|
35
37
|
style={style}
|
|
36
38
|
productAddedToCartLength={0}
|
|
39
|
+
handleUpdateProducts={handleUpdateProducts}
|
|
37
40
|
/>
|
|
38
41
|
))}
|
|
39
42
|
</>
|
|
@@ -48,7 +48,8 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
48
48
|
hideOrders,
|
|
49
49
|
BusinessControllerSkeletons,
|
|
50
50
|
businesses,
|
|
51
|
-
businessPaginationProps
|
|
51
|
+
businessPaginationProps,
|
|
52
|
+
handleUpdateProducts
|
|
52
53
|
} = props
|
|
53
54
|
|
|
54
55
|
const theme = useTheme();
|
|
@@ -234,6 +235,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
|
|
|
234
235
|
<PreviousProductsOrdered
|
|
235
236
|
products={products}
|
|
236
237
|
onProductClick={onProductClick}
|
|
238
|
+
handleUpdateProducts={handleUpdateProducts}
|
|
237
239
|
isBusinessesSearchList={!!businessesSearchList}
|
|
238
240
|
/>
|
|
239
241
|
)}
|
|
@@ -68,7 +68,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
68
68
|
|
|
69
69
|
const [, t] = useLanguage()
|
|
70
70
|
const [orderState] = useOrder()
|
|
71
|
-
const [{ parsePrice, optimizeImage }] = useUtils()
|
|
71
|
+
const [{ parsePrice, optimizeImage, parseDate }] = useUtils()
|
|
72
72
|
|
|
73
73
|
const [isActive, setActiveState] = useState(false)
|
|
74
74
|
// const [setHeight, setHeightState] = useState({ height: new Animated.Value(0) })
|
|
@@ -152,31 +152,44 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
152
152
|
)}
|
|
153
153
|
</ProductImage>
|
|
154
154
|
)}
|
|
155
|
-
{
|
|
156
|
-
<
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
useNativeAndroidPickerStyle={false}
|
|
163
|
-
placeholder={{}}
|
|
164
|
-
Icon={() => <View style={pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} /></View>}
|
|
165
|
-
disabled={orderState.loading}
|
|
166
|
-
/>
|
|
167
|
-
</ProductInfo>
|
|
168
|
-
)}
|
|
169
|
-
{isFromCheckout && (
|
|
170
|
-
<ProductQuantity>
|
|
171
|
-
<OText size={12} lineHeight={18}>
|
|
172
|
-
{product?.quantity}
|
|
155
|
+
{!!product?.calendar_event ? (
|
|
156
|
+
<View style={{ flex: 1, marginLeft: 10, flexDirection: 'column' }}>
|
|
157
|
+
<View>
|
|
158
|
+
<OText size={12} lineHeight={18} weight={'400'} numberOfLines={1}>{product?.name}</OText>
|
|
159
|
+
</View>
|
|
160
|
+
<OText size={10} color={theme.colors.textSecondary} style={{ marginTop: 3 }}>
|
|
161
|
+
{parseDate(product?.calendar_event?.start, { outputFormat: 'hh:mm a' })} - {parseDate(product?.calendar_event?.end, { outputFormat: 'hh:mm a' })}
|
|
173
162
|
</OText>
|
|
174
|
-
</
|
|
163
|
+
</View>
|
|
164
|
+
): (
|
|
165
|
+
<>
|
|
166
|
+
{isCartProduct && !isCartPending && getProductMax && (
|
|
167
|
+
<ProductInfo>
|
|
168
|
+
<RNPickerSelect
|
|
169
|
+
items={productOptions}
|
|
170
|
+
onValueChange={handleChangeQuantity}
|
|
171
|
+
value={product.quantity.toString()}
|
|
172
|
+
style={pickerStyle}
|
|
173
|
+
useNativeAndroidPickerStyle={false}
|
|
174
|
+
placeholder={{}}
|
|
175
|
+
Icon={() => <View style={pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} /></View>}
|
|
176
|
+
disabled={orderState.loading}
|
|
177
|
+
/>
|
|
178
|
+
</ProductInfo>
|
|
179
|
+
)}
|
|
180
|
+
{isFromCheckout && (
|
|
181
|
+
<ProductQuantity>
|
|
182
|
+
<OText size={12} lineHeight={18}>
|
|
183
|
+
{product?.quantity}
|
|
184
|
+
</OText>
|
|
185
|
+
</ProductQuantity>
|
|
186
|
+
)}
|
|
187
|
+
<View style={{ flex: 1 }}>
|
|
188
|
+
<OText size={12} lineHeight={18} weight={'400'}>{product.name}</OText>
|
|
189
|
+
</View>
|
|
190
|
+
</>
|
|
175
191
|
)}
|
|
176
|
-
<View style={{ flex: 1 }}>
|
|
177
|
-
<OText size={12} lineHeight={18} weight={'400'}>{product.name}</OText>
|
|
178
|
-
</View>
|
|
179
|
-
<View style={{ display: 'flex', flexDirection: 'column', flex: 1, alignItems: 'flex-end' }}>
|
|
192
|
+
<View style={{ display: 'flex', flexDirection: 'column', flex: 1, alignItems: 'flex-end', maxWidth: 100 }}>
|
|
180
193
|
<View style={{ flexDirection: 'row' }}>
|
|
181
194
|
<OText size={12} lineHeight={18} weight={'400'}>{parsePrice(product.total || product.price)}</OText>
|
|
182
195
|
{(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || product.comment) && (
|
|
@@ -306,6 +306,7 @@ export interface SingleProductCardParams {
|
|
|
306
306
|
enableIntersection?: boolean;
|
|
307
307
|
navigation?: any;
|
|
308
308
|
isPreviously?: any;
|
|
309
|
+
isProductId?: any;
|
|
309
310
|
}
|
|
310
311
|
export interface BusinessInformationParams {
|
|
311
312
|
navigation?: any,
|
|
@@ -360,6 +361,7 @@ export interface OrdersOptionParams {
|
|
|
360
361
|
refreshOrders?: boolean,
|
|
361
362
|
setRefreshOrders?: (value: boolean) => void,
|
|
362
363
|
handleUpdateOrderList?: (orderId: number, changes: any) => {},
|
|
364
|
+
handleUpdateProducts?: (productId: number, changes: any) => {},
|
|
363
365
|
isBusiness?: boolean,
|
|
364
366
|
isProducts?: boolean,
|
|
365
367
|
businessOrderIds?: any,
|
|
@@ -764,6 +766,8 @@ export interface OrderItAgainParams {
|
|
|
764
766
|
|
|
765
767
|
export interface PreviousProductsOrderedParams {
|
|
766
768
|
products?: any,
|
|
769
|
+
isProductId?: boolean
|
|
767
770
|
onProductClick?: any,
|
|
768
771
|
isBusinessesSearchList?: boolean
|
|
772
|
+
handleUpdateProducts?: any
|
|
769
773
|
}
|