ordering-ui-react-native 0.16.28 → 0.16.29

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.16.28",
3
+ "version": "0.16.29",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -55,6 +55,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
55
55
  } = props
56
56
 
57
57
  const screenHeight = Dimensions.get('window').height;
58
+ const screenWidth = Dimensions.get('window').width;
58
59
  const theme = useTheme()
59
60
  const [orderState] = useOrder()
60
61
  const { top } = useSafeAreaInsets();
@@ -339,7 +340,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
339
340
  handleCustomClick={() => onBusinessClick(business)}
340
341
  handleUpdateBusinessList={handleUpdateBusinessList}
341
342
  orderType={orderState?.options?.type}
342
- style={{ width: 320, marginRight: (businessesSearchList.loading || i !== businessesSearchList.businesses?.length - 1) ? 20 : 0 }}
343
+ style={{ width: screenWidth - 80, marginRight: (businessesSearchList.loading || i !== businessesSearchList.businesses?.length - 1) ? 20 : 0 }}
343
344
  />
344
345
  ))}
345
346
  {!businessesSearchList.loading && paginationProps?.totalPages && paginationProps?.currentPage < paginationProps?.totalPages && (
@@ -411,7 +412,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
411
412
  onProductClick={() => { }}
412
413
  productAddedToCartLength={0}
413
414
  handleUpdateProducts={(productId: number, changes: any) => handleUpdateProducts(productId, category?.id, business?.id, changes)}
414
- style={{ width: 320, marginRight: i === category?.products?.length - 1 ? 0 : 20 }}
415
+ style={{ width: screenWidth - 80, marginRight: i === category?.products?.length - 1 ? 0 : 20 }}
415
416
  />
416
417
  )))}
417
418
 
@@ -7,11 +7,12 @@ import { ListWrapper } from './styles'
7
7
  import {
8
8
  View,
9
9
  StyleSheet,
10
- ScrollView
10
+ ScrollView,
11
+ Dimensions
11
12
  } from 'react-native';
12
13
  import { PreviousBusinessOrderedParams } from '../../../types';
13
14
 
14
- export const PreviousBusinessOrderedUI = (props : PreviousBusinessOrderedParams) => {
15
+ export const PreviousBusinessOrderedUI = (props: PreviousBusinessOrderedParams) => {
15
16
  const {
16
17
  navigation,
17
18
  businessesList,
@@ -23,6 +24,8 @@ export const PreviousBusinessOrderedUI = (props : PreviousBusinessOrderedParams)
23
24
  } = props
24
25
 
25
26
  const [orderState] = useOrder()
27
+ const windowWidth = Dimensions.get('window').width;
28
+
26
29
  const onBusinessClick = (business: any) => {
27
30
  onNavigationRedirect('Business', { store: business.slug })
28
31
  }
@@ -120,7 +123,7 @@ export const PreviousBusinessOrderedUI = (props : PreviousBusinessOrderedParams)
120
123
  <>
121
124
  {!businessLoading && (
122
125
  <BusinessControllerList
123
- style={{ width: 320, marginRight: 20 }}
126
+ style={{ width: windowWidth - 80, marginRight: 20 }}
124
127
  />
125
128
  )}
126
129
  </>
@@ -137,7 +140,7 @@ export const PreviousBusinessOrderedUI = (props : PreviousBusinessOrderedParams)
137
140
  )
138
141
  }
139
142
 
140
- export const PreviousBusinessOrdered = (props) => {
143
+ export const PreviousBusinessOrdered = (props: PreviousBusinessOrderedParams) => {
141
144
  const previousBusinessOrderedController = {
142
145
  ...props,
143
146
  UIComponent: PreviousBusinessOrderedUI,
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { ScrollView, StyleSheet } from 'react-native'
2
+ import { ScrollView, StyleSheet, Dimensions } from 'react-native'
3
3
  import {
4
4
  ListWrapper
5
5
  } from './styles'
@@ -7,13 +7,15 @@ import {
7
7
  import { SingleProductCard } from '../../SingleProductCard'
8
8
  import { PreviousProductsOrderedParams } from '../../../types'
9
9
 
10
- export const PreviousProductsOrdered = (props : PreviousProductsOrderedParams) => {
10
+ export const PreviousProductsOrdered = (props: PreviousProductsOrderedParams) => {
11
11
  const {
12
12
  products,
13
13
  onProductClick,
14
14
  isBusinessesSearchList
15
15
  } = props
16
16
 
17
+ const windowWidth = Dimensions.get('window').width;
18
+
17
19
  const styles = StyleSheet.create({
18
20
  container: {
19
21
  marginBottom: 0,
@@ -24,15 +26,15 @@ export const PreviousProductsOrdered = (props : PreviousProductsOrderedParams) =
24
26
  return (
25
27
  <>
26
28
  {products?.map((product: any) => (
27
- <SingleProductCard
28
- key={product?.id}
29
- isSoldOut={(product.inventoried && !product.quantity)}
30
- product={product}
31
- businessId={product?.business?.id}
32
- onProductClick={onProductClick}
33
- style={style}
34
- productAddedToCartLength={0}
35
- />
29
+ <SingleProductCard
30
+ key={product?.id}
31
+ isSoldOut={(product.inventoried && !product.quantity)}
32
+ product={product}
33
+ businessId={product?.business?.id}
34
+ onProductClick={onProductClick}
35
+ style={style}
36
+ productAddedToCartLength={0}
37
+ />
36
38
  ))}
37
39
  </>
38
40
  )
@@ -40,7 +42,7 @@ export const PreviousProductsOrdered = (props : PreviousProductsOrderedParams) =
40
42
  return (
41
43
  <ScrollView horizontal={isBusinessesSearchList} style={styles.container} showsVerticalScrollIndicator={false}>
42
44
  {isBusinessesSearchList ? (
43
- <ProductList style={{ width: 320, marginRight: 20 }} />
45
+ <ProductList style={{ width: windowWidth - 80, marginRight: 20 }} />
44
46
  ) : (
45
47
  <ListWrapper isBusinessesSearchList={isBusinessesSearchList}>
46
48
  <ProductList />