ordering-ui-react-native 0.15.72-release → 0.15.73-release

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.15.72-release",
3
+ "version": "0.15.73-release",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -370,7 +370,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
370
370
  handleCustomClick={() => onBusinessClick(business)}
371
371
  handleUpdateBusinessList={handleUpdateBusinessList}
372
372
  orderType={orderState?.options?.type}
373
- style={{ width: screenWidth - 80, marginRight: (businessesSearchList.loading || i !== businessesSearchList.businesses?.length - 1) ? 20 : 0 }}
373
+ style={{ width: screenWidth - 120, marginRight: (businessesSearchList.loading || i !== businessesSearchList.businesses?.length - 1) ? 20 : 0 }}
374
374
  />
375
375
  ))}
376
376
  {!businessesSearchList.loading && paginationProps?.totalPages && paginationProps?.currentPage < paginationProps?.totalPages && (
@@ -432,7 +432,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
432
432
  style={{ borderRadius: 50, paddingLeft: 5, paddingRight: 5, height: 20 }}
433
433
  />
434
434
  </SingleBusinessContainer>
435
- <ScrollView horizontal style={styles.productsContainer}>
435
+ <ScrollView horizontal style={styles.productsContainer} contentContainerStyle={{ flexGrow: 1 }}>
436
436
  {business?.categories?.map((category: any) => category?.products?.map((product: any, i: number) => (
437
437
  <SingleProductCard
438
438
  key={product?.id}
@@ -442,7 +442,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
442
442
  onProductClick={(product: any) => onProductClick(business, category?.id, product?.id)}
443
443
  productAddedToCartLength={0}
444
444
  handleUpdateProducts={(productId: number, changes: any) => handleUpdateProducts(productId, category?.id, business?.id, changes)}
445
- style={{ width: screenWidth - 80, marginRight: i === category?.products?.length - 1 ? 0 : 20 }}
445
+ style={{ width: screenWidth - 120, marginRight: i === category?.products?.length - 1 ? 0 : 20 }}
446
446
  />
447
447
  )))}
448
448
 
@@ -279,19 +279,24 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
279
279
  <>
280
280
  {[...Array(categoryState?.pagination?.nextPageItems).keys()].map(
281
281
  (item, i) => (
282
- <Placeholder key={i} style={{ padding: 5 }} Animation={Fade}>
283
- <View style={{ flexDirection: 'row' }}>
282
+ <View style={{ minHeight: 165, marginBottom: 28, padding: 12 }}>
283
+ <Placeholder style={{ padding: 5 }} Animation={Fade}>
284
+ <View style={{ flexDirection: 'row' }}>
285
+ <Placeholder style={{ paddingVertical: 10, flex: 1 }}>
286
+ <PlaceholderLine width={60} style={{ marginBottom: 15 }} />
287
+ <PlaceholderLine width={20} />
288
+ </Placeholder>
289
+ <PlaceholderLine
290
+ width={24}
291
+ height={70}
292
+ style={{ marginLeft: 10, marginBottom: 10 }}
293
+ />
294
+ </View>
284
295
  <PlaceholderLine
285
- width={24}
286
- height={70}
287
- style={{ marginRight: 10, marginBottom: 10 }}
296
+ height={52}
288
297
  />
289
- <Placeholder style={{ paddingVertical: 10 }}>
290
- <PlaceholderLine width={60} style={{ marginBottom: 25 }} />
291
- <PlaceholderLine width={20} />
292
- </Placeholder>
293
- </View>
294
- </Placeholder>
298
+ </Placeholder>
299
+ </View>
295
300
  ),
296
301
  )}
297
302
  </>
@@ -314,6 +314,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
314
314
  style={{
315
315
  height: Dimensions.get('window').height - filtProductsHeight
316
316
  }}
317
+ contentContainerStyle={{ flexGrow: 1 }}
317
318
  >
318
319
  <View style={{ padding: 20, backgroundColor: theme.colors.white }}>
319
320
  <BusinessProductsList
@@ -464,19 +464,9 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
464
464
  />
465
465
  </OrderTypesContainer>
466
466
  )}
467
- {!businessId && (
468
- <View style={{ marginTop: 20 }}>
469
- <OButton
470
- onClick={() => navigation.navigate('BusinessSearch', { businessTypes })}
471
- text={t('SEARCH', 'Search')}
472
- style={styles?.buttonCityStyle}
473
- textStyle={{ color: theme.colors.textSecondary, fontSize: 16 }}
474
- />
475
- </View>
476
- )}
477
467
 
478
468
  {!hideCities && (
479
- <View style={{ marginTop: 10 }}>
469
+ <View style={{ marginTop: 20 }}>
480
470
  <TouchableOpacity
481
471
  style={styles.buttonCityStyle}
482
472
  onPress={() => setIsOpenCities(true)}
@@ -119,14 +119,31 @@ export const MyOrders = (props: any) => {
119
119
  </View>
120
120
  </>
121
121
  )}
122
- {notOrderOptions.includes(selectedOption) && (
122
+ {selectedOption === 'business' && (
123
123
  <OrdersOption
124
124
  {...props}
125
+ isBusiness
126
+ titleContent={t('PREVIOUSLY_ORDERED', 'Previously ordered')}
127
+ hideOrders
128
+ horizontal
129
+ activeOrders
130
+ pastOrders
131
+ preOrders
132
+ businessesSearchList={businessesSearchList}
133
+ setIsEmptyBusinesses={setIsEmptyBusinesses}
134
+ businessOrderIds={businessOrderIds}
135
+ setBusinessOrderIds={setBusinessOrderIds}
136
+ ordersLength={ordersLength}
137
+ setOrdersLength={setOrdersLength}
138
+ />
139
+ )}
140
+ {selectedOption === 'products' && (
141
+ <OrdersOption
142
+ {...props}
143
+ isProducts
125
144
  titleContent={t('PREVIOUSLY_ORDERED', 'Previously ordered')}
126
145
  hideOrders
127
146
  horizontal
128
- isBusiness={selectedOption === 'business'}
129
- isProducts={selectedOption === 'products'}
130
147
  activeOrders
131
148
  pastOrders
132
149
  preOrders
@@ -123,7 +123,7 @@ export const PreviousBusinessOrderedUI = (props: PreviousBusinessOrderedParams)
123
123
  <>
124
124
  {!businessLoading && (
125
125
  <BusinessControllerList
126
- style={{ width: windowWidth - 80, marginRight: 20 }}
126
+ style={{ width: windowWidth - 120, marginRight: 20 }}
127
127
  />
128
128
  )}
129
129
  </>
@@ -189,15 +189,18 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
189
189
  )}
190
190
  {(ordersLength?.activeOrdersLength > 0 || ordersLength?.previousOrdersLength > 0) && (
191
191
  <>
192
- <OptionTitle titleContent={!!titleContent} isBusinessesSearchList={!!businessesSearchList}>
193
- <OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={10} >
194
- {titleContent || (activeOrders
195
- ? t('ACTIVE', 'Active')
196
- : preOrders
197
- ? t('PREORDERS', 'Preorders')
198
- : t('PAST', 'Past'))}
199
- </OText>
200
- </OptionTitle>
192
+ {((titleContent && ((isBusiness && businessOrderIds?.length > 0) || isProducts)) || !titleContent) && (
193
+ <OptionTitle titleContent={!!titleContent} isBusinessesSearchList={!!businessesSearchList}>
194
+ <OText size={16} lineHeight={24} weight={'500'} color={theme.colors.textNormal} mBottom={10} >
195
+ {titleContent || (activeOrders
196
+ ? t('ACTIVE', 'Active')
197
+ : preOrders
198
+ ? t('PREORDERS', 'Preorders')
199
+ : t('PAST', 'Past'))}
200
+ </OText>
201
+ </OptionTitle>
202
+ )}
203
+
201
204
  {!(ordersLength?.activeOrdersLength === 0 && ordersLength?.previousOrdersLength === 0) &&
202
205
  !loading &&
203
206
  orders.filter((order: any) => orderStatus.includes(order.status)).length === 0 &&
@@ -210,7 +213,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
210
213
  )}
211
214
  </>
212
215
  )}
213
- {isBusiness && !!businessesSearchList && businessLoading && (
216
+ {isBusiness && !!businessesSearchList && businessLoading && businessOrderIds?.length > 0 && (
214
217
  <ScrollView horizontal>
215
218
  <BusinessControllerSkeletons />
216
219
  </ScrollView>
@@ -281,19 +281,24 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
281
281
  )}
282
282
  </CardContainer>
283
283
  ) : (
284
- <Placeholder style={{ padding: 5 }} Animation={Fade}>
285
- <View style={{ flexDirection: 'row' }}>
284
+ <View style={{ minHeight: 165, marginBottom: 28, padding: 12 }}>
285
+ <Placeholder style={{ padding: 5 }} Animation={Fade}>
286
+ <View style={{ flexDirection: 'row' }}>
287
+ <Placeholder style={{ paddingVertical: 10, flex: 1 }}>
288
+ <PlaceholderLine width={60} style={{ marginBottom: 15 }} />
289
+ <PlaceholderLine width={20} />
290
+ </Placeholder>
291
+ <PlaceholderLine
292
+ width={24}
293
+ height={70}
294
+ style={{ marginLeft: 10, marginBottom: 10 }}
295
+ />
296
+ </View>
286
297
  <PlaceholderLine
287
- width={24}
288
- height={70}
289
- style={{ marginRight: 10, marginBottom: 10 }}
298
+ height={52}
290
299
  />
291
- <Placeholder style={{ paddingVertical: 10 }}>
292
- <PlaceholderLine width={60} style={{ marginBottom: 25 }} />
293
- <PlaceholderLine width={20} />
294
- </Placeholder>
295
- </View>
296
- </Placeholder>
300
+ </Placeholder>
301
+ </View>
297
302
  )}
298
303
  </InView>
299
304
  );