ordering-ui-react-native 0.14.56 → 0.14.59

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.56",
3
+ "version": "0.14.59",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -191,7 +191,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
191
191
  {isFarAway && (
192
192
  <FarAwayMessage style={styles.farAwayMsg}>
193
193
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
194
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
194
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
195
195
  </FarAwayMessage>
196
196
  )}
197
197
  </OrderControlContainer>
@@ -205,7 +205,7 @@ const CheckoutUI = (props: any) => {
205
205
  const onMessage = (e: any) => {
206
206
  if (e?.nativeEvent?.data && e?.nativeEvent?.data !== 'undefined') {
207
207
  let payment = JSON.parse(e.nativeEvent.data);
208
-
208
+ setOpenOrderCreating(true)
209
209
  if (payment === 'api error') {
210
210
  setShowGateway({ closedByUser: true, open: false })
211
211
  setProg(true);
@@ -197,7 +197,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
197
197
  {isFarAway && (
198
198
  <FarAwayMessage style={styles.farAwayMsg}>
199
199
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
200
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
200
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
201
201
  </FarAwayMessage>
202
202
  )}
203
203
  {!auth && (
@@ -155,7 +155,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
155
155
  {isFarAway && (
156
156
  <FarAwayMessage style={styles.farAwayMsg}>
157
157
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
158
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
158
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
159
159
  </FarAwayMessage>
160
160
  )}
161
161
  <View style={styles.wrapperOrderOptions}>
@@ -130,8 +130,7 @@ const BusinessPreorderUI = (props: BusinessPreorderParams) => {
130
130
  disabledDateNumber: {
131
131
  color: '#B1BCCC',
132
132
  fontSize: 14,
133
- fontWeight: '500',
134
-
133
+ fontWeight: '500'
135
134
  }
136
135
  })
137
136
 
@@ -155,6 +155,10 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
155
155
  const handleTouchDrag = useCallback(() => {
156
156
  setCategoryClicked(false);
157
157
  }, []);
158
+
159
+ const handleBackNavigation = () => {
160
+ navigation?.canGoBack() ? navigation.goBack() : navigation.navigate('BottomTab')
161
+ }
158
162
 
159
163
  return (
160
164
  <SafeAreaView
@@ -169,7 +173,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
169
173
  imgLeftSrc={theme.images.general.arrow_left}
170
174
  imgRightSrc={null}
171
175
  style={styles.btnBackArrow}
172
- onClick={() => navigation?.canGoBack() && navigation.goBack()}
176
+ onClick={() => handleBackNavigation()}
173
177
  imgLeftStyle={{ tintColor: theme.colors.textNormal, width: 16 }}
174
178
  />
175
179
  </View>
@@ -231,7 +235,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
231
235
  selectedCategoryId={selectedCategoryId}
232
236
  lazyLoadProductsRecommended={business?.lazy_load_products_recommended}
233
237
  setSelectedCategoryId={setSelectedCategoryId}
234
- setCategoryClicked={setCategoryClicked}
238
+ setCategoryClicked={setCategoryClicked}
235
239
  />
236
240
  )}
237
241
  </>
@@ -309,13 +313,13 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
309
313
  business={currentCart?.business}
310
314
  cartProducts={currentCart?.products}
311
315
  cart={currentCart}
312
- setOpenUpselling={setOpenUpselling}
316
+ setOpenUpselling={setOpenUpselling}
313
317
  handleUpsellingPage={handleUpsellingPage}
314
318
  handleCloseUpsellingPage={handleCloseUpsellingPage}
315
319
  openUpselling={openUpselling}
316
320
  canOpenUpselling={canOpenUpselling}
317
321
  setCanOpenUpselling={setCanOpenUpselling}
318
- onRedirect={onRedirect}
322
+ onRedirect={onRedirect}
319
323
  />
320
324
  )}
321
325
  </SafeAreaView>
@@ -1,18 +1,18 @@
1
- import React, { useState, useEffect, useCallback } from 'react';
2
- import moment, { Moment } from 'moment';
1
+ import React, { useState, useEffect } from 'react';
2
+ import moment from 'moment';
3
+ import CalendarStrip from 'react-native-calendar-strip'
3
4
  import {
4
5
  useLanguage,
5
6
  useConfig,
6
- useUtils,
7
7
  useOrder,
8
8
  MomentOption as MomentOptionController,
9
9
  } from 'ordering-components/native';
10
10
  import { useTheme } from 'styled-components/native';
11
+ import IconAntDesign from 'react-native-vector-icons/AntDesign'
11
12
  import {
12
- ImageStore,
13
13
  StyleSheet,
14
- useWindowDimensions,
15
14
  View,
15
+ TouchableOpacity
16
16
  } from 'react-native';
17
17
  import Spinner from 'react-native-loading-spinner-overlay';
18
18
  import { MomentOptionParams } from '../../types';
@@ -21,16 +21,16 @@ import { OButton, OIcon, OText } from '../shared';
21
21
  import { Container } from '../../layouts/Container';
22
22
  import {
23
23
  WrapSelectOption,
24
- WrapDelveryTime,
24
+ OrderTimeWrapper,
25
+ TimeListWrapper,
26
+ TimeContentWrapper,
27
+ TimeItem
25
28
  } from './styles';
26
- import CalendarPicker from 'react-native-calendar-picker';
27
29
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
28
- import SelectDropdown from 'react-native-select-dropdown';
29
30
 
30
31
  const MomentOptionUI = (props: MomentOptionParams) => {
31
32
  const {
32
33
  navigation,
33
- nopadding,
34
34
  datesList,
35
35
  hoursList,
36
36
  dateSelected,
@@ -76,12 +76,62 @@ const MomentOptionUI = (props: MomentOptionParams) => {
76
76
  paddingHorizontal: 16,
77
77
  flexDirection: 'row',
78
78
  alignItems: 'center'
79
+ },
80
+ calendar: {
81
+ paddingBottom: 15,
82
+ borderBottomWidth: 1,
83
+ borderColor: theme.colors.backgroundGray200,
84
+ height: 100
85
+ },
86
+ calendarHeaderContainer: {
87
+ flex: 1,
88
+ justifyContent: 'flex-start',
89
+ textAlign: 'left',
90
+ marginBottom: 17,
91
+ borderBottomWidth: 1,
92
+ borderColor: theme.colors.backgroundGray200
93
+ },
94
+ calendarHeader: {
95
+ color: '#344050',
96
+ alignSelf: 'flex-start',
97
+ fontSize: 14,
98
+ fontWeight: '400'
99
+ },
100
+ dateNumber: {
101
+ color: '#B1BCCC',
102
+ fontSize: 16,
103
+ fontWeight: '500',
104
+ },
105
+ dateName: {
106
+ color: '#B1BCCC',
107
+ fontSize: 12,
108
+ textTransform: 'capitalize',
109
+ },
110
+ highlightDateName: {
111
+ color: '#344050',
112
+ fontSize: 12,
113
+ textTransform: 'capitalize',
114
+ },
115
+ highlightDateNumber: {
116
+ color: '#344050',
117
+ fontSize: 16,
118
+ textTransform: 'capitalize',
119
+ },
120
+ disabledDateName: {
121
+ color: '#B1BCCC',
122
+ fontSize: 10,
123
+ textTransform: 'capitalize',
124
+ opacity: 1,
125
+ },
126
+ disabledDateNumber: {
127
+ color: '#B1BCCC',
128
+ fontSize: 14,
129
+ fontWeight: '500'
79
130
  }
80
131
  });
81
132
 
82
133
  const [, t] = useLanguage();
83
134
  const [{ configs }] = useConfig();
84
- const [{ parseTime }] = useUtils();
85
135
  const [orderState] = useOrder();
86
136
  const [optionSelected, setOptionSelected] = useState({
87
137
  isAsap: false,
@@ -91,14 +141,11 @@ const MomentOptionUI = (props: MomentOptionParams) => {
91
141
  isLoading: 0,
92
142
  isEditing: false,
93
143
  });
94
- const { width } = useWindowDimensions();
95
144
  const { bottom } = useSafeAreaInsets();
96
145
 
97
- const [toggleTime, setToggleTime] = useState(false);
98
- const [selectedTime, setSelectedTime] = useState(timeSelected);
99
- const [minDate, setMinDate] = useState(new Date())
100
- const [maxDate, setMaxDate] = useState(new Date)
101
- const [alert, setAlert] = useState<any>({ show: false })
146
+ const [selectedTime, setSelectedTime] = useState(null);
147
+ const [datesWhitelist, setDateWhitelist] = useState<any>([{ start: null, end: null }])
148
+ const [selectDate, setSelectedDate] = useState<any>(null)
102
149
 
103
150
  const goToBack = () => navigation?.canGoBack() && navigation.goBack();
104
151
 
@@ -126,19 +173,6 @@ const MomentOptionUI = (props: MomentOptionParams) => {
126
173
  .utc()
127
174
  .format('YYYY-MM-DD HH:mm:ss');
128
175
 
129
- const getTwoChar = (ori: string) => {
130
- return ori.substring(0, 2);
131
- };
132
- const weekDays = [
133
- getTwoChar(t('SUNDAY_ABBREVIATION', 'Su')),
134
- getTwoChar(t('MONDAY_ABBREVIATION', 'Mo')),
135
- getTwoChar(t('TUESDAY_ABBREVIATION', 'Tu')),
136
- getTwoChar(t('WEDNESDAY_ABBREVIATION', 'We')),
137
- getTwoChar(t('THURSDAY_ABBREVIATION', 'Th')),
138
- getTwoChar(t('FRIDAY_ABBREVIATION', 'Fr')),
139
- getTwoChar(t('SATURDAY_ABBREVIATION', 'Sa')),
140
- ];
141
-
142
176
  useEffect(() => {
143
177
  if (orderState.options?.moment) {
144
178
  setOptionSelected({ isAsap: false, isSchedule: true });
@@ -160,14 +194,34 @@ const MomentOptionUI = (props: MomentOptionParams) => {
160
194
  }
161
195
  }, [momentState.isLoading]);
162
196
 
163
- const customDayHeaderStylesCallback = () => {
164
- return {
165
- textStyle: {
166
- color: theme.colors.disabled,
167
- fontSize: 12,
168
- },
169
- };
170
- };
197
+ const onSelectDate = (val: any) => {
198
+ setSelectedDate(val)
199
+ if (handleChangeDate) handleChangeDate(moment(val).format('YYYY-MM-DD'))
200
+ }
201
+
202
+ const LeftSelector = () => {
203
+ return (
204
+ <View style={{ height: '100%', justifyContent: 'flex-end' }}>
205
+ <IconAntDesign
206
+ name='caretleft'
207
+ color={theme.colors.textNormal}
208
+ size={16}
209
+ />
210
+ </View>
211
+ )
212
+ }
213
+
214
+ const RightSelector = () => {
215
+ return (
216
+ <View style={{ height: '100%', justifyContent: 'flex-end' }}>
217
+ <IconAntDesign
218
+ name='caretright'
219
+ color={theme.colors.textNormal}
220
+ size={16}
221
+ />
222
+ </View>
223
+ )
224
+ }
171
225
 
172
226
  useEffect(() => {
173
227
  if (datesList?.length > 0) {
@@ -176,11 +230,22 @@ const MomentOptionUI = (props: MomentOptionParams) => {
176
230
  const maxDateParts = _datesList[_datesList.length - 1].split('-')
177
231
  const _minDate = new Date(minDateParts[0], minDateParts[1] - 1, minDateParts[2])
178
232
  const _maxDate = new Date(maxDateParts[0], maxDateParts[1] - 1, maxDateParts[2])
179
- setMinDate(_minDate)
180
- setMaxDate(_maxDate)
233
+ setDateWhitelist([{ start: _minDate, end: _maxDate }])
181
234
  }
182
235
  }, [datesList])
183
236
 
237
+ useEffect(() => {
238
+ if (dateSelected) {
239
+ const dateParts = dateSelected.split('-')
240
+ const _dateSelected = new Date(dateParts[0], dateParts[1] - 1, dateParts[2])
241
+ setSelectedDate(_dateSelected)
242
+ }
243
+ }, [dateSelected])
244
+
245
+ useEffect(() => {
246
+ setSelectedTime(timeSelected)
247
+ }, [timeSelected])
248
+
184
249
  return (
185
250
  <>
186
251
  <Container style={{ paddingLeft: 40, paddingRight: 40 }}>
@@ -212,7 +277,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
212
277
  style={{ marginEnd: 24 }}
213
278
  />
214
279
  )}
215
- <OText color={optionSelected.isAsap ? theme.colors.textNormal : theme.colors.disabled}>{t('ASAP_ABBREVIATION', 'ASAP') + ` (${moment().format('dddd, MMM D, yyyy h:mm A')} + delivery time)`}</OText>
280
+ <OText color={optionSelected.isAsap ? theme.colors.textNormal : theme.colors.disabled}>{t('ASAP_ABBREVIATION', 'ASAP') + ` (${moment().format('dddd, MMM d, yyyy h:mm A')} + delivery time)`}</OText>
216
281
  </WrapSelectOption>
217
282
  <WrapSelectOption
218
283
  onPress={() => setOptionSelected({ isAsap: false, isSchedule: true })}
@@ -234,95 +299,55 @@ const MomentOptionUI = (props: MomentOptionParams) => {
234
299
  </WrapSelectOption>
235
300
 
236
301
  {optionSelected.isSchedule && (
237
- <WrapDelveryTime>
238
- {datesList.length > 0 && (
239
- <View style={styles.dateWrap}>
240
- <View style={styles.dateLabel}>
241
- <OText size={12} color={theme.colors.textNormal}>{dateSelected}</OText>
242
- </View>
243
- <SelectDropdown
244
- defaultButtonText={timeSelected ? timeSelected : t('DELIVERY_TIME', 'Delivery Time')}
245
- defaultValue={74}
246
- data={hoursList}
247
- disabled={orderState.loading}
248
- onSelect={(selectedItem, index) => {
249
- setSelectedTime(selectedItem.startTime)
250
- }}
251
- buttonTextAfterSelection={(selectedItem, index) => {
252
- return `${selectedItem.startTime} - ${selectedItem.endTime}`
253
- }}
254
- rowTextForSelection={(item, index) => {
255
- return `${item.startTime} - ${item.endTime}`
256
- }}
257
- buttonStyle={{
258
- backgroundColor: theme.colors.white,
259
- borderColor: theme.colors.border,
260
- borderWidth: 1,
261
- borderRadius: 8,
262
- height: 40,
263
- width: '100%',
264
- flexDirection: 'column',
265
- alignItems: 'flex-start',
266
- marginBottom: 20
267
- }}
268
- buttonTextStyle={{
269
- color: theme.colors.textNormal,
270
- fontSize: 12,
271
- paddingTop: 10
272
- }}
273
- dropdownStyle={{
274
- borderRadius: 8,
275
- borderColor: theme.colors.lightGray,
276
- }}
277
- rowStyle={{
278
- borderBottomColor: theme.colors.white,
279
- backgroundColor: theme.colors.white,
280
- height: 40,
281
- flexDirection: 'column',
282
- alignItems: 'flex-start',
283
- paddingTop: 8,
284
- paddingLeft: 22
285
- }}
286
- rowTextStyle={{
287
- color: theme.colors.textNormal,
288
- fontSize: 14,
289
- }}
290
- />
291
- <CalendarPicker
292
- nextTitle=">"
293
- width={width - 80}
294
- previousTitle="<"
295
- nextComponent={
296
- <OIcon
297
- src={theme.images.general.chevron_right}
298
- color={theme.colors.disabled}
299
- width={12}
300
- style={{ marginHorizontal: 4 }}
301
- />
302
- }
303
- previousComponent={
304
- <OIcon
305
- src={theme.images.general.chevron_left}
306
- color={theme.colors.disabled}
307
- width={12}
308
- style={{ marginHorizontal: 4 }}
309
- />
310
- }
311
- onDateChange={(date: moment.Moment) =>
312
- handleChangeDate(date.format('YYYY-MM-DD'))
313
- }
314
- selectedDayColor={theme.colors.primaryContrast}
315
- todayBackgroundColor={theme.colors.border}
316
- dayLabelsWrapper={{ borderColor: theme.colors.clear }}
317
- customDayHeaderStyles={customDayHeaderStylesCallback}
318
- weekdays={weekDays}
319
- selectedStartDate={momento}
320
- minDate={minDate}
321
- maxDate={maxDate}
302
+ <OrderTimeWrapper>
303
+ <View style={{ flex: 1 }}>
304
+ {selectDate && datesWhitelist[0]?.start !== null && (
305
+ <CalendarStrip
306
+ scrollable
307
+ style={styles.calendar}
308
+ calendarHeaderContainerStyle={styles.calendarHeaderContainer}
309
+ calendarHeaderStyle={styles.calendarHeader}
310
+ dateNumberStyle={styles.dateNumber}
311
+ dateNameStyle={styles.dateName}
312
+ iconContainer={{ flex: 0.1 }}
313
+ highlightDateNameStyle={styles.highlightDateName}
314
+ highlightDateNumberStyle={styles.highlightDateNumber}
315
+ dayContainerStyle={{ height: '100%' }}
316
+ highlightDateContainerStyle={{ height: '100%' }}
317
+ calendarHeaderFormat='MMMM, YYYY'
318
+ iconStyle={{ borderWidth: 1 }}
319
+ selectedDate={selectDate}
320
+ datesWhitelist={datesWhitelist}
321
+ disabledDateNameStyle={styles.disabledDateName}
322
+ disabledDateNumberStyle={styles.disabledDateNumber}
323
+ disabledDateOpacity={0.6}
324
+ onDateSelected={(date) => onSelectDate(date)}
325
+ leftSelector={<LeftSelector />}
326
+ rightSelector={<RightSelector />}
322
327
  />
323
- </View>
324
- )}
325
- </WrapDelveryTime>
328
+ )}
329
+ </View>
330
+ <TimeListWrapper nestedScrollEnabled={true}>
331
+ <TimeContentWrapper>
332
+ {hoursList.map((time: any, i: number) => (
333
+ <TouchableOpacity key={i} onPress={() => setSelectedTime(time.startTime)}>
334
+ <TimeItem active={selectedTime === time.startTime}>
335
+ <OText
336
+ size={14}
337
+ color={selectedTime === time.startTime ? theme.colors.primary : theme.colors.textNormal}
338
+ style={{
339
+ lineHeight: 24
340
+ }}
341
+ >{time.startTime}</OText>
342
+ </TimeItem>
343
+ </TouchableOpacity>
344
+ ))}
345
+ {hoursList.length % 3 === 2 && (
346
+ <TimeItem style={{ backgroundColor: 'transparent' }} />
347
+ )}
348
+ </TimeContentWrapper>
349
+ </TimeListWrapper>
350
+ </OrderTimeWrapper>
326
351
  )}
327
352
  </View>
328
353
  <Spinner visible={momentState.isLoading === 1} />
@@ -6,61 +6,37 @@ export const Container = styled.ScrollView`
6
6
  padding: 0 20px;
7
7
  padding-bottom: 20px;
8
8
  `
9
- export const HeaderTitle = styled.View`
10
- flex-direction: column;
11
- margin-bottom: 20px;
12
- `
9
+
13
10
  export const WrapSelectOption = styled.TouchableOpacity`
14
11
  flex-direction: row;
15
12
  align-items: center;
16
13
  margin-vertical: 5px;
17
14
  `
18
- export const Days = styled.View`
19
- flex-wrap: wrap;
20
- flex-direction: row;
21
- margin-vertical: 10px;
15
+ export const OrderTimeWrapper = styled.View`
16
+ margin-top: 34px;
22
17
  `
23
- export const Day = styled.TouchableOpacity`
24
- display: flex;
25
- flex-direction: column;
26
- align-items: center;
27
- justify-content: center;
28
- border-right-width: 1px;
29
- width: 25%;
30
- margin-vertical: 10px;
31
- border-color: ${(props: any) => props.theme.colors.textSecondary};
32
18
 
33
- ${(props: any) => props.borderLeftShow && css`
34
- border-left-width: 1px;
35
- `}
36
- `
37
- export const WrapHours = styled.ScrollView`
38
- border-width: 1px;
39
- border-color: ${(props: any) => props.theme.colors.border};
40
- border-radius: 7.6px;
41
- margin-top: 6px;
42
- height: 140px;
43
- max-height: 140px;
19
+ export const TimeListWrapper = styled.ScrollView`
20
+ margin-top: 30px;
21
+ max-height: 160px;
44
22
  `
45
- export const Hours = styled.View`
23
+
24
+ export const TimeContentWrapper = styled.View`
46
25
  flex: 1;
47
26
  flex-wrap: wrap;
48
27
  flex-direction: row;
49
28
  justify-content: space-between;
50
- margin: 0 20px;
51
29
  `
52
- export const Hour = styled.TouchableOpacity`
53
- flex-direction: row;
30
+
31
+ export const TimeItem = styled.View`
32
+ width: 86px;
33
+ height: 34px;
34
+ background: #E9ECEF;
35
+ border-radius: 7.6px;
54
36
  justify-content: center;
55
37
  align-items: center;
56
- padding: 5px;
57
- border-width: 1px;
58
- border-radius: 7.6px;
59
- border-color: ${(props: any) => props.theme.colors.border};
60
- width: 90px;
61
- margin-vertical: 7px;
62
- `
63
-
64
- export const WrapDelveryTime = styled.View`
65
- flex: 1;
38
+ margin: 10px 0px;
39
+ ${({ active }: any) => active && css`
40
+ background: #F5F9FF;
41
+ `}
66
42
  `
@@ -458,7 +458,7 @@ export const ProductOptionsUI = (props: any) => {
458
458
  textDecorationLine: 'line-through',
459
459
  marginLeft: 7,
460
460
  marginRight: 7
461
- }}>{parsePrice(product?.offer_price)}</OText>
461
+ }}>{product?.offer_price ? parsePrice(product?.offer_price) : ''}</OText>
462
462
  )}
463
463
  </View>
464
464
  )}
@@ -121,9 +121,9 @@ export const SingleProductCard = (props: SingleProductCardParams) => {
121
121
  {product?.name}
122
122
  </OText>
123
123
  <PricesContainer>
124
- <OText color={theme.colors.primary}>{parsePrice(product?.price)}</OText>
124
+ <OText color={theme.colors.primary}>{product?.price ? parsePrice(product?.price) : ''}</OText>
125
125
  {product?.offer_price !== null && product?.in_offer && (
126
- <OText style={styles.regularPriceStyle}>{parsePrice(product?.offer_price)}</OText>
126
+ <OText style={styles.regularPriceStyle}>{product?.offer_price ? parsePrice(product?.offer_price) : ''}</OText>
127
127
  )}
128
128
  </PricesContainer>
129
129
  <OText
@@ -159,12 +159,6 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
159
159
  </TopActions>
160
160
  </TopBar>
161
161
  <ScrollView style={{ marginBottom: props.isPage ? 40 : bottom + (Platform.OS == 'ios' ? 96 : 130) }} showsVerticalScrollIndicator={false}>
162
- {productsList.length > 0 &&
163
- <View style={{ paddingHorizontal: 40, overflow: 'visible' }}>
164
- <OText size={16} lineHeight={24} weight={'500'}>{t('WANT_SOMETHING_ELSE', 'Do you want something else?')}</OText>
165
- <UpsellingLayout />
166
- </View>
167
- }
168
162
  <View style={{ paddingHorizontal: 40 }}>
169
163
  <OText size={20} lineHeight={30} weight={600} style={{ marginTop: 10, marginBottom: 17 }}>{t('YOUR_CART', 'Your cart')}</OText>
170
164
  <OrderSummary
@@ -173,6 +167,12 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
173
167
  onNavigationRedirect={onNavigationRedirect}
174
168
  />
175
169
  </View>
170
+ {productsList.length > 0 &&
171
+ <View style={{ paddingHorizontal: 40, overflow: 'visible' }}>
172
+ <OText size={16} lineHeight={24} weight={'500'}>{t('WANT_SOMETHING_ELSE', 'Do you want something else?')}</OText>
173
+ <UpsellingLayout />
174
+ </View>
175
+ }
176
176
  </ScrollView>
177
177
  <View
178
178
  style={{
@@ -144,7 +144,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
144
144
  {isFarAway && (
145
145
  <FarAwayMessage style={styles.farAwayMsg}>
146
146
  <Ionicons name='md-warning-outline' style={styles.iconStyle} />
147
- <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
147
+ <OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address')}</OText>
148
148
  </FarAwayMessage>
149
149
  )}
150
150
  <View style={styles.wrapperOrderOptions}>