ordering-ui-react-native 0.14.22 → 0.14.26

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.14.22",
3
+ "version": "0.14.26",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -45,6 +45,7 @@ const imgOptions = {
45
45
  includeBase64: true,
46
46
  selectionLimit: 0
47
47
  }
48
+ const filterSpecialStatus = ['prepared_in', 'delivered_in']
48
49
 
49
50
  const MessagesUI = (props: MessagesParams) => {
50
51
  const {
@@ -118,7 +119,11 @@ const MessagesUI = (props: MessagesParams) => {
118
119
  const messageConsole = (message: any) => {
119
120
  return message.change?.attribute !== 'driver_id'
120
121
  ?
121
- `${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])} ${t('TO', 'to')} ${t(ORDER_STATUS[parseInt(message.change.new, 10)])}`
122
+ `${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${
123
+ filterSpecialStatus.includes(message.change.attribute) ?
124
+ `${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}` :
125
+ `${message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])} ${t('TO', 'to')} ${t(ORDER_STATUS[parseInt(message.change.new, 10)])}`
126
+ }`
122
127
  : message.change.new
123
128
  ?
124
129
  `${message.driver?.name} ${message.driver?.lastname !== null ? message.driver.lastname : ''} ${t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')} ${message.comment ? message.comment.length : ''}`
@@ -15,5 +15,5 @@ export const WrapperNotFound = styled.View`
15
15
  export const ProductsWrapper = styled.View`
16
16
  flex-direction: row;
17
17
  flex-wrap: wrap;
18
- align-items: flex-start;
18
+ margin-bottom: 20px;
19
19
  `
@@ -6,7 +6,7 @@ import {
6
6
  CardInfo,
7
7
  SoldOut
8
8
  } from './styles'
9
- import { StyleSheet, TouchableOpacity, Dimensions } from 'react-native'
9
+ import { StyleSheet, TouchableOpacity, Dimensions, View } from 'react-native'
10
10
  import { OText, OIcon } from '../shared'
11
11
  import { useTheme } from 'styled-components/native'
12
12
 
@@ -23,11 +23,7 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
23
23
 
24
24
  const styles = StyleSheet.create({
25
25
  container: {
26
- width: (windowWidth - 80) / 2,
27
- height: (windowWidth - 80) / 2 + 40
28
- },
29
- textStyle: {
30
- flex: 1,
26
+ width: (windowWidth - 80) / 2
31
27
  },
32
28
  soldOutTextStyle : {
33
29
  textTransform: 'capitalize',
@@ -35,9 +31,14 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
35
31
  fontSize: 12,
36
32
  lineHeight: 18
37
33
  },
38
- productStyle: {
34
+ imageWrapper: {
39
35
  width: (windowWidth - 160) / 2,
40
36
  height: (windowWidth - 160) / 2,
37
+ position: 'relative'
38
+ },
39
+ productStyle: {
40
+ width: '100%',
41
+ height: '100%',
41
42
  borderRadius: 3,
42
43
  marginTop: 5
43
44
  },
@@ -74,26 +75,30 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
74
75
  onPress={() => onProductClick?.(product)}
75
76
  activeOpacity={0.8}
76
77
  >
77
- <OIcon
78
- url={optimizeImage(product?.images, 'h_200,c_limit')}
79
- src={!product?.images && theme.images.dummies.product}
80
- style={{...styles.productStyle, opacity: (isSoldOut || maxProductQuantity <= 0) ? 0.4 : 1}}
81
- />
78
+ <View
79
+ style={styles.imageWrapper}
80
+ >
81
+ <OIcon
82
+ url={optimizeImage(product?.images, 'h_200,c_limit')}
83
+ src={!product?.images && theme.images.dummies.product}
84
+ style={{...styles.productStyle, opacity: (isSoldOut || maxProductQuantity <= 0) ? 0.4 : 1}}
85
+ />
86
+ {(isSoldOut || maxProductQuantity <= 0) && (
87
+ <SoldOut>
88
+ <OText size={10} style={styles.soldOutTextStyle}>{t('SOLD_OUT', 'SOLD OUT')}</OText>
89
+ </SoldOut>
90
+ )}
91
+ </View>
82
92
  <CardInfo>
83
93
  <OText color={theme.colors.textPrimary} style={{...theme.labels.normal, marginTop: 9}}>{parsePrice(product?.price)}</OText>
84
- <OText numberOfLines={1} ellipsizeMode='tail' style={{...styles.textStyle, ...theme.labels.small}}>{product?.name}</OText>
85
- <OText color={theme.colors.textSecondary} size={9} numberOfLines={2} ellipsizeMode='tail' style={{...styles.textStyle, ...theme.labels.small}}>{product?.description}</OText>
94
+ <OText numberOfLines={1} ellipsizeMode='tail' style={{...theme.labels.small}}>{product?.name}</OText>
95
+ <OText color={theme.colors.textSecondary} size={9} numberOfLines={2} ellipsizeMode='tail' style={{...theme.labels.small}}>{product?.description}</OText>
86
96
  </CardInfo>
87
97
 
88
98
  <TouchableOpacity style={styles.addBtn} onPress={() => onProductClick?.(product)} activeOpacity={0.7}>
89
99
  <OIcon src={theme.images.general.plus_circle} />
90
100
  </TouchableOpacity>
91
101
 
92
- {(isSoldOut || maxProductQuantity <= 0) && (
93
- <SoldOut>
94
- <OText size={10} style={styles.soldOutTextStyle}>{t('SOLD_OUT', 'SOLD OUT')}</OText>
95
- </SoldOut>
96
- )}
97
102
  </CardContainer>
98
103
  )
99
104
  }
@@ -1,12 +1,9 @@
1
1
  import styled from 'styled-components/native'
2
2
 
3
3
  export const CardContainer = styled.TouchableOpacity`
4
- /* flex-grow: 1; */
5
- align-items: flex-start;
4
+ flex-direction: column;
6
5
  padding: 10px;
7
6
  position: relative;
8
- /* margin-end: 10px; */
9
- border-radius: 3px;
10
7
  `
11
8
  export const CardInfo = styled.View`
12
9
  flex: 1;
@@ -16,6 +13,7 @@ export const SoldOut = styled.View`
16
13
  position: absolute;
17
14
  background: ${(props: any) => props.theme.colors.black} 0% 0% no-repeat padding-box;
18
15
  padding: 3px 9px;
19
- top: 91px;
20
- left: 10px;
16
+ left: 0px;
17
+ bottom: -5px;
18
+ border-radius: 3px;
21
19
  `
@@ -17,6 +17,7 @@ export const BusinessItemAccordion = (props: any) => {
17
17
  const {
18
18
  cart,
19
19
  moment,
20
+ singleBusiness,
20
21
  handleClearProducts
21
22
  } = props
22
23
 
@@ -29,7 +30,7 @@ export const BusinessItemAccordion = (props: any) => {
29
30
  const isClosed = !cart?.valid_schedule
30
31
  const isProducts = cart?.products?.length
31
32
 
32
- const [isActive, setActiveState] = useState(false)
33
+ const [isActive, setActiveState] = useState(!!singleBusiness)
33
34
 
34
35
  useEffect(() => {
35
36
  const cartsArray = Object.values(orderState?.carts)
@@ -57,6 +57,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
57
57
  handleBusinessClick,
58
58
  paginationProps,
59
59
  handleChangeSearch,
60
+ businessId
60
61
  } = props;
61
62
 
62
63
  const theme = useTheme();
@@ -256,17 +257,20 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
256
257
  />
257
258
  </WrapMomentOption>
258
259
 
259
- <SearchBar
260
- onSearch={handleChangeSearch}
261
- searchValue={searchValue}
262
- lazyLoad
263
- isCancelXButtonShow={!!searchValue}
264
- borderStyle={styles.borderStyle}
265
- onCancel={() => handleChangeSearch('')}
266
- placeholder={t('SEARCH', 'Search')}
267
- height={26}
268
- inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
269
- />
260
+ {!businessId && (
261
+ <SearchBar
262
+ onSearch={handleChangeSearch}
263
+ searchValue={searchValue}
264
+ lazyLoad
265
+ isCancelXButtonShow={!!searchValue}
266
+ borderStyle={styles.borderStyle}
267
+ onCancel={() => handleChangeSearch('')}
268
+ placeholder={t('SEARCH', 'Search')}
269
+ height={26}
270
+ inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
271
+ />
272
+ )}
273
+
270
274
  </View>
271
275
  </OrderControlContainer>
272
276
  </HeaderWrapper>
@@ -277,7 +281,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
277
281
  />
278
282
  </OrderProgressWrapper>
279
283
  )}
280
- {!props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
284
+ {!businessId && !props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
281
285
  <FeaturedWrapper>
282
286
  <OText size={16} style={{ marginLeft: 40 }} weight={Platform.OS === 'ios' ? '600' : 'bold'}>{t('FEATURED_BUSINESS', 'Featured business')}</OText>
283
287
  <ScrollView
@@ -306,17 +310,19 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
306
310
  </FeaturedWrapper>
307
311
  )}
308
312
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
309
- {!props.franchiseId && (
313
+ {!businessId && !props.franchiseId && (
310
314
  <HighestRatedBusinesses onBusinessClick={handleBusinessClick} navigation={navigation} />
311
315
  )}
312
316
  <View style={{ height: 8, backgroundColor: theme.colors.backgroundGray100 }} />
313
317
  <ListWrapper>
314
- <BusinessTypeFilter
315
- images={props.images}
316
- businessTypes={props.businessTypes}
317
- defaultBusinessType={props.defaultBusinessType}
318
- handleChangeBusinessType={handleChangeBusinessType}
319
- />
318
+ {!businessId && (
319
+ <BusinessTypeFilter
320
+ images={props.images}
321
+ businessTypes={props.businessTypes}
322
+ defaultBusinessType={props.defaultBusinessType}
323
+ handleChangeBusinessType={handleChangeBusinessType}
324
+ />
325
+ )}
320
326
  {!businessesList.loading && businessesList.businesses.length === 0 && (
321
327
  <NotFoundSource
322
328
  content={t(
@@ -113,6 +113,15 @@ const CartUI = (props: any) => {
113
113
  }
114
114
  }
115
115
 
116
+ const walletName: any = {
117
+ cash: {
118
+ name: t('PAY_WITH_CASH_WALLET', 'Pay with Cash Wallet'),
119
+ },
120
+ credit_point: {
121
+ name: t('PAY_WITH_CREDITS_POINTS_WALLET', 'Pay with Credit Points Wallet'),
122
+ }
123
+ }
124
+
116
125
  return (
117
126
  <CContainer>
118
127
  {openUpselling && (
@@ -130,6 +139,7 @@ const CartUI = (props: any) => {
130
139
  )}
131
140
  <BusinessItemAccordion
132
141
  cart={cart}
142
+ singleBusiness={props.singleBusiness}
133
143
  moment={momentFormatted}
134
144
  handleClearProducts={handleClearProducts}
135
145
  handleCartOpen={handleCartOpen}
@@ -191,7 +201,7 @@ const CartUI = (props: any) => {
191
201
  cart?.fees?.length > 0 && cart?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0)).map((fee: any) => (
192
202
  <OSTable key={fee?.id}>
193
203
  <OSRow>
194
- <OText numberOfLines={1}>
204
+ <OText numberOfLines={1} size={12} lineHeight={18}>
195
205
  {fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
196
206
  ({parsePrice(fee?.fixed)} + {fee?.percentage}%){' '}
197
207
  </OText>
@@ -203,6 +213,15 @@ const CartUI = (props: any) => {
203
213
  </OSTable>
204
214
  ))
205
215
  }
216
+ {cart?.service_fee > 0 && !cart?.fees?.length && (
217
+ <OSTable>
218
+ <OText size={12} lineHeight={18}>
219
+ {t('SERVICE_FEE', 'Service Fee')}
220
+ {`(${verifyDecimals(cart?.business?.service_fee, parseNumber)}%)`}
221
+ </OText>
222
+ <OText size={12} lineHeight={18}>{parsePrice(cart?.service_fee)}</OText>
223
+ </OSTable>
224
+ )}
206
225
  {orderState?.options?.type === 1 && cart?.delivery_price > 0 && (
207
226
  <OSTable>
208
227
  <OText size={12} lineHeight={18}>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
@@ -223,15 +242,14 @@ const CartUI = (props: any) => {
223
242
  <OText size={12} lineHeight={18}>{parsePrice(cart?.driver_tip)}</OText>
224
243
  </OSTable>
225
244
  )}
226
- {cart?.service_fee > 0 && (
227
- <OSTable>
228
- <OText size={12} lineHeight={18}>
229
- {t('SERVICE_FEE', 'Service Fee')}
230
- {`(${verifyDecimals(cart?.business?.service_fee, parseNumber)}%)`}
245
+ {cart?.payment_events?.length > 0 && cart?.payment_events?.map((event: any) => (
246
+ <OSTable key={event.id}>
247
+ <OText size={12} numberOfLines={1}>
248
+ {walletName[cart?.wallets?.find((wallet: any) => wallet.id === event.wallet_id)?.type]?.name}
231
249
  </OText>
232
- <OText size={12} lineHeight={18}>{parsePrice(cart?.service_fee)}</OText>
250
+ <OText size={12}>-{parsePrice(event.amount)}</OText>
233
251
  </OSTable>
234
- )}
252
+ ))}
235
253
  {isCouponEnabled && !isCartPending && (
236
254
  <OSTable>
237
255
  <OSCoupon>
@@ -249,7 +267,7 @@ const CartUI = (props: any) => {
249
267
  {t('TOTAL', 'Total')}
250
268
  </OText>
251
269
  <OText size={14} lineHeight={21} weight={'600'}>
252
- {cart?.total >= 1 && parsePrice(cart?.total)}
270
+ {parsePrice(cart?.balance ?? cart?.total)}
253
271
  </OText>
254
272
  </OSTable>
255
273
  </OSTotal>
@@ -30,6 +30,7 @@ export const CartContent = (props: any) => {
30
30
  {cart.products.length > 0 && (
31
31
  <>
32
32
  <Cart
33
+ singleBusiness={props.singleBusiness}
33
34
  isFranchiseApp={props.isFranchiseApp}
34
35
  cart={cart}
35
36
  cartuuid={cart.uuid}
@@ -48,8 +48,8 @@ export const Help = (props: HelpParams) => {
48
48
 
49
49
  <LastOrdersContainer>
50
50
  <OText size={18} weight={600}>{t('LAST_ORDERS', 'Last Orders')}</OText>
51
- <LastOrders onRedirect={onRedirect} />
51
+ <LastOrders businessId={props.businessId} onRedirect={onRedirect} />
52
52
  </LastOrdersContainer>
53
53
  </>
54
54
  )
55
- }
55
+ }
@@ -12,6 +12,34 @@ import { MessagesParams } from '../../types'
12
12
  import { useWindowDimensions } from 'react-native'
13
13
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
14
14
 
15
+ const ORDER_STATUS: any = {
16
+ 0: 'ORDER_STATUS_PENDING',
17
+ 1: 'ORDERS_COMPLETED',
18
+ 2: 'ORDER_REJECTED',
19
+ 3: 'ORDER_STATUS_IN_BUSINESS',
20
+ 4: 'ORDER_READY',
21
+ 5: 'ORDER_REJECTED_RESTAURANT',
22
+ 6: 'ORDER_STATUS_CANCELLEDBYDRIVER',
23
+ 7: 'ORDER_STATUS_ACCEPTEDBYRESTAURANT',
24
+ 8: 'ORDER_CONFIRMED_ACCEPTED_BY_DRIVER',
25
+ 9: 'ORDER_PICKUP_COMPLETED_BY_DRIVER',
26
+ 10: 'ORDER_PICKUP_FAILED_BY_DRIVER',
27
+ 11: 'ORDER_DELIVERY_COMPLETED_BY_DRIVER',
28
+ 12: 'ORDER_DELIVERY_FAILED_BY_DRIVER',
29
+ 13: 'PREORDER',
30
+ 14: 'ORDER_NOT_READY',
31
+ 15: 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER',
32
+ 16: 'ORDER_STATUS_CANCELLED_BY_CUSTOMER',
33
+ 17: 'ORDER_NOT_PICKEDUP_BY_CUSTOMER',
34
+ 18: 'ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS',
35
+ 19: 'ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER',
36
+ 20: 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS',
37
+ 21: 'ORDER_CUSTOMER_ARRIVED_BUSINESS',
38
+ }
39
+
40
+ const filterSpecialStatus = ['prepared_in', 'delivered_in']
41
+
42
+
15
43
  const MessagesUI = (props: MessagesParams) => {
16
44
  const {
17
45
  type,
@@ -94,58 +122,6 @@ const MessagesUI = (props: MessagesParams) => {
94
122
  });
95
123
  };
96
124
 
97
- const getStatus = (status: number) => {
98
-
99
- switch (status) {
100
- case 0:
101
- return 'ORDER_STATUS_PENDING'
102
- case 1:
103
- return 'ORDERS_COMPLETED'
104
- case 2:
105
- return 'ORDER_REJECTED'
106
- case 3:
107
- return 'ORDER_STATUS_IN_BUSINESS'
108
- case 4:
109
- return 'ORDER_READY'
110
- case 5:
111
- return 'ORDER_REJECTED_RESTAURANT'
112
- case 6:
113
- return 'ORDER_STATUS_CANCELLEDBYDRIVER'
114
- case 7:
115
- return 'ORDER_STATUS_ACCEPTEDBYRESTAURANT'
116
- case 8:
117
- return 'ORDER_CONFIRMED_ACCEPTED_BY_DRIVER'
118
- case 9:
119
- return 'ORDER_PICKUP_COMPLETED_BY_DRIVER'
120
- case 10:
121
- return 'ORDER_PICKUP_FAILED_BY_DRIVER'
122
- case 11:
123
- return 'ORDER_DELIVERY_COMPLETED_BY_DRIVER'
124
- case 12:
125
- return 'ORDER_DELIVERY_FAILED_BY_DRIVER'
126
- case 13:
127
- return 'PREORDER'
128
- case 14:
129
- return 'ORDER_NOT_READY'
130
- case 15:
131
- return 'ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER'
132
- case 16:
133
- return 'ORDER_STATUS_CANCELLED_BY_CUSTOMER'
134
- case 17:
135
- return 'ORDER_NOT_PICKEDUP_BY_CUSTOMER'
136
- case 18:
137
- return 'ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS'
138
- case 19:
139
- return 'ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER'
140
- case 20:
141
- return 'ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS'
142
- case 21:
143
- return 'ORDER_CUSTOMER_ARRIVED_BUSINESS'
144
- default:
145
- return status
146
- }
147
- }
148
-
149
125
  const onSubmit = (values: any) => {
150
126
  handleSend && handleSend()
151
127
  setImage && setImage(null)
@@ -154,14 +130,18 @@ const MessagesUI = (props: MessagesParams) => {
154
130
 
155
131
  const messageConsole = (message: any) => {
156
132
  return message.change?.attribute !== 'driver_id'
133
+ ?
134
+ `${t('ORDER', 'Order')} ${t(message.change.attribute.toUpperCase(), message.change.attribute.replace('_', ' '))} ${t('CHANGED_FROM', 'Changed from')} ${
135
+ filterSpecialStatus.includes(message.change.attribute) ?
136
+ `${message.change.old === null ? '0' : message.change.old} ${t('TO', 'to')} ${message.change.new} ${t('MINUTES', 'Minutes')}` :
137
+ `${message.change.old !== null && t(ORDER_STATUS[parseInt(message.change.old, 10)])} ${t('TO', 'to')} ${t(ORDER_STATUS[parseInt(message.change.new, 10)])}`
138
+ }`
139
+ : message.change.new
157
140
  ?
158
- `${t('ORDER', 'Order')} ${message.change.attribute} ${t('CHANGED_FROM', 'Changed from')} ${message.change.old !== null && t(getStatus(parseInt(message.change.old, 10)))} ${t('TO', 'to')} ${t(getStatus(parseInt(message.change.new, 10)))}`
159
- : message.change.new
160
- ?
161
- `${message.driver?.name} ${message.driver?.lastname !== null ? message.driver.lastname : ''} ${t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')} ${message.comment ? message.comment.length : ''}`
162
- :
163
- `${t('DRIVER_UNASSIGNED', 'Driver unassigned')}`
164
- }
141
+ `${message.driver?.name} ${message.driver?.lastname !== null ? message.driver.lastname : ''} ${t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')} ${message.comment ? message.comment.length : ''}`
142
+ :
143
+ `${t('DRIVER_UNASSIGNED', 'Driver unassigned')}`
144
+ }
165
145
 
166
146
  useEffect(() => {
167
147
  let newMessages: Array<any> = []
@@ -894,6 +894,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
894
894
  orderId={order?.id}
895
895
  messages={messages}
896
896
  order={order}
897
+ business={openModalForBusiness}
898
+ driver={openModalForDriver}
897
899
  setMessages={setMessages}
898
900
  onClose={handleCloseModal}
899
901
  />
@@ -193,13 +193,13 @@ const OrderProgressUI = (props: any) => {
193
193
  </View>
194
194
  </View>
195
195
  )}
196
- {!orderList?.loading && orderList?.orders?.length === 0 && (
196
+ {/* {!orderList?.loading && orderList?.orders?.length === 0 && (
197
197
  <NotFoundSource
198
198
  image={imageFails}
199
199
  content={t('NO_RESULTS_FOUND', 'Sorry, no results found')}
200
200
  conditioned
201
201
  />
202
- )}
202
+ )} */}
203
203
  </>
204
204
  )
205
205
  }
@@ -177,6 +177,14 @@ const OrderSummaryUI = (props: any) => {
177
177
  <OText size={12}>{parsePrice(cart?.driver_tip)}</OText>
178
178
  </OSTable>
179
179
  )}
180
+ {cart?.payment_events?.length > 0 && cart?.payment_events?.map((event: any) => (
181
+ <OSTable key={event.id}>
182
+ <OText size={12} numberOfLines={1}>
183
+ {walletName[cart?.wallets?.find((wallet: any) => wallet.id === event.wallet_id)?.type]?.name}
184
+ </OText>
185
+ <OText size={12}>-{parsePrice(event.amount)}</OText>
186
+ </OSTable>
187
+ ))}
180
188
  {isCouponEnabled && !isCartPending && (
181
189
  <View>
182
190
  <View style={{ paddingVertical: 5 }}>
@@ -194,7 +202,7 @@ const OrderSummaryUI = (props: any) => {
194
202
  {t('TOTAL', 'Total')}
195
203
  </OText>
196
204
  <OText size={14} style={{ fontWeight: 'bold' }} >
197
- {parsePrice(cart?.total)}
205
+ {parsePrice(cart?.balance ?? cart?.total)}
198
206
  </OText>
199
207
  </OSTable>
200
208
  </View>
@@ -232,52 +240,6 @@ const OrderSummaryUI = (props: any) => {
232
240
  </View>
233
241
  </OSTable>
234
242
  )}
235
- {cart?.payment_events?.length > 0 && (
236
- <View
237
- style={{
238
- width: '100%',
239
- marginTop: 20
240
- }}
241
- >
242
- {cart?.payment_events?.map((event: any) => (
243
- <View
244
- key={event.id}
245
- style={{
246
- display: 'flex',
247
- flexDirection: 'row',
248
- justifyContent: 'space-between',
249
- marginBottom: 10
250
- }}
251
- >
252
- <OText>
253
- {walletName[cart?.wallets?.find((wallet: any) => wallet.id === event.wallet_id)?.type]?.name}
254
- </OText>
255
- <OText>
256
- -{parsePrice(event.amount)}
257
- </OText>
258
- </View>
259
- ))}
260
- <View
261
- style={{
262
- display: 'flex',
263
- flexDirection: 'row',
264
- justifyContent: 'space-between',
265
- marginBottom: 10
266
- }}
267
- >
268
- <OText
269
- weight={'bold'}
270
- >
271
- {t('TOTAL_TO_PAY', 'Total to pay')}
272
- </OText>
273
- <OText
274
- weight={'bold'}
275
- >
276
- {parsePrice(cart?.balance)}
277
- </OText>
278
- </View>
279
- </View>
280
- )}
281
243
  </OSBill>
282
244
  )}
283
245
  <OModal
@@ -129,6 +129,7 @@ export interface BusinessesListingParams {
129
129
  businessTypes?: any;
130
130
  defaultBusinessType?: any;
131
131
  franchiseId?: any;
132
+ businessId?: any;
132
133
  }
133
134
  export interface HighestRatedBusinessesParams {
134
135
  businessesList: { businesses: Array<any>, loading: boolean, error: null | string };
@@ -455,6 +456,7 @@ export interface GoogleMapsParams {
455
456
 
456
457
  export interface HelpParams {
457
458
  navigation: any;
459
+ businessId?: any;
458
460
  }
459
461
 
460
462
  export interface LastOrdersParams {