ordering-ui-react-native 0.17.61 → 0.17.63

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.
Files changed (28) hide show
  1. package/package.json +1 -1
  2. package/themes/original/src/components/AddressDetails/index.tsx +9 -7
  3. package/themes/original/src/components/AddressForm/index.tsx +7 -1
  4. package/themes/original/src/components/BusinessController/index.tsx +66 -40
  5. package/themes/original/src/components/BusinessController/styles.tsx +1 -1
  6. package/themes/original/src/components/BusinessListingSearch/index.tsx +27 -11
  7. package/themes/original/src/components/BusinessProductsList/index.tsx +10 -8
  8. package/themes/original/src/components/BusinessProductsListing/index.tsx +1 -1
  9. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +17 -44
  10. package/themes/original/src/components/Checkout/index.tsx +36 -53
  11. package/themes/original/src/components/Checkout/styles.tsx +4 -2
  12. package/themes/original/src/components/CitiesControl/index.tsx +89 -0
  13. package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
  14. package/themes/original/src/components/GPSButton/styles.ts +3 -3
  15. package/themes/original/src/components/MyOrders/index.tsx +42 -42
  16. package/themes/original/src/components/ProductForm/index.tsx +9 -5
  17. package/themes/original/src/components/ProductForm/styles.tsx +2 -4
  18. package/themes/original/src/components/ProductItemAccordion/index.tsx +8 -8
  19. package/themes/original/src/components/ProductOptionSubOption/index.tsx +16 -8
  20. package/themes/original/src/components/ProductOptionSubOption/styles.tsx +0 -1
  21. package/themes/original/src/components/Promotions/index.tsx +232 -219
  22. package/themes/original/src/components/Promotions/styles.tsx +7 -2
  23. package/themes/original/src/components/SingleProductCard/index.tsx +17 -21
  24. package/themes/original/src/components/SingleProductCard/styles.tsx +1 -0
  25. package/themes/original/src/components/UserDetails/index.tsx +5 -3
  26. package/themes/original/src/components/shared/HeaderTitle.tsx +1 -1
  27. package/themes/original/src/layouts/Container.tsx +1 -1
  28. package/themes/original/src/types/index.tsx +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.17.61",
3
+ "version": "0.17.63",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -24,13 +24,15 @@ const AddressDetailsUI = (props: any) => {
24
24
  return (
25
25
  <ADContainer>
26
26
  <ADHeader>
27
- <OText
28
- size={16}
29
- lineHeight={24}
30
- color={theme.colors.textNormal}
31
- >
32
- {t('DELIVERY_ADDRESS', 'Delivery address')}
33
- </OText>
27
+ {props.HeaderTitle ?? (
28
+ <OText
29
+ size={16}
30
+ lineHeight={24}
31
+ color={theme.colors.textNormal}
32
+ >
33
+ {t('DELIVERY_ADDRESS', 'Delivery address')}
34
+ </OText>
35
+ )}
34
36
  </ADHeader>
35
37
  {!!apiKey && (
36
38
  <ADMap
@@ -65,6 +65,7 @@ const AddressFormUI = (props: AddressFormParams) => {
65
65
  } = props;
66
66
 
67
67
  const theme = useTheme();
68
+ const [autoCompleteInputFocused, setAutoCompleteInputFocused] = useState(false)
68
69
 
69
70
  const tagsName = [
70
71
  { icon: theme.images.general.tag_home, value: 'home' },
@@ -104,6 +105,12 @@ const AddressFormUI = (props: AddressFormParams) => {
104
105
  end: 0,
105
106
  top: 12,
106
107
  zIndex: 1002,
108
+ right: autoCompleteInputFocused && (
109
+ !!address?.address ||
110
+ !!formState.changes?.address ||
111
+ !!addressState.address.address
112
+ ) ? 30 : 15,
113
+ width: 16
107
114
  },
108
115
  wrapperNavbar: Platform.OS === 'ios'
109
116
  ? { paddingVertical: 0, paddingHorizontal: 40 }
@@ -138,7 +145,6 @@ const AddressFormUI = (props: AddressFormParams) => {
138
145
  const [isKeyboardShow, setIsKeyboardShow] = useState(false);
139
146
  const [isSignUpEffect, setIsSignUpEffect] = useState(false);
140
147
  const [hasEditing, setAddressEditing] = useState(false);
141
- const [autoCompleteInputFocused, setAutoCompleteInputFocused] = useState(false)
142
148
 
143
149
  const googleInput: any = useRef(null);
144
150
  const internalNumberRef: any = useRef(null);
@@ -11,7 +11,7 @@ import {
11
11
  ToastType
12
12
  } from 'ordering-components/native';
13
13
  import { OIcon, OText } from '../shared';
14
- import { StyleSheet, View } from 'react-native';
14
+ import { Dimensions, StyleSheet, View } from 'react-native';
15
15
  import { InView } from 'react-native-intersection-observer'
16
16
  import { BusinessControllerParams } from '../../types';
17
17
  import { convertHoursToMinutes, shape } from '../../utils';
@@ -40,6 +40,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
40
40
  navigation,
41
41
  isBusinessOpen,
42
42
  style,
43
+ isCustomLayout,
43
44
  businessHeader,
44
45
  businessFeatured,
45
46
  businessLogo,
@@ -51,6 +52,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
51
52
  handleFavoriteBusiness,
52
53
  enableIntersection
53
54
  } = props;
55
+
54
56
  const [{ parsePrice, parseDistance, parseNumber, optimizeImage }] = useUtils();
55
57
  const [, { showToast }] = useToast()
56
58
  const [orderState] = useOrder();
@@ -58,14 +60,19 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
58
60
  const [configState] = useConfig();
59
61
  const [, t] = useLanguage();
60
62
  const theme = useTheme()
63
+ const windowHeight = Dimensions.get('window').height
61
64
  const [isIntersectionObserver, setIsIntersectionObserver] = useState(!enableIntersection)
62
65
 
66
+ const textSize = isCustomLayout ? 12 : 10
67
+ const cardHeight = windowHeight * 0.3
68
+
63
69
  const styles = StyleSheet.create({
64
70
  container: {
65
71
  marginVertical: 20,
66
72
  borderRadius: 7.6,
67
73
  width: '100%',
68
- position: 'relative'
74
+ position: 'relative',
75
+ height: cardHeight
69
76
  },
70
77
  headerStyle: {
71
78
  borderTopLeftRadius: 7.6,
@@ -159,11 +166,8 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
159
166
  <InView style={{ minHeight: 200 }} triggerOnce={true} onChange={(inView: boolean) => handleChangeInterSection(inView)}>
160
167
  {isIntersectionObserver ? (
161
168
  <CardAnimation
169
+ style={[style, styles.container]}
162
170
  onClick={() => handleBusinessClick(business)}
163
- style={[
164
- style,
165
- styles.container
166
- ]}
167
171
  >
168
172
  {business?.ribbon?.enabled && (
169
173
  <RibbonBox
@@ -185,7 +189,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
185
189
  )}
186
190
  <BusinessHero>
187
191
  <FastImage
188
- style={{ height: 120 }}
192
+ style={{ height: isCustomLayout ? cardHeight * 0.66 : 120 }}
189
193
  source={(businessHeader || business?.header) ? {
190
194
  uri: optimizeImage(businessHeader || business?.header, 'h_500,c_limit'),
191
195
  priority: FastImage.priority.normal,
@@ -211,7 +215,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
211
215
  </BusinessState>
212
216
  </BusinessHero>
213
217
  <BusinessContent>
214
- <BusinessInfo>
218
+ <BusinessInfo style={isCustomLayout && { position: 'absolute', bottom: 85, left: 15 }}>
215
219
  <BusinessLogo style={styles.businessLogo}>
216
220
  <FastImage
217
221
  style={{ width: 56, height: 56 }}
@@ -222,38 +226,60 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
222
226
  resizeMode={FastImage.resizeMode.cover}
223
227
  />
224
228
  </BusinessLogo>
225
- <ReviewAndFavorite>
226
- {(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && (
227
- <Reviews>
228
- <OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
229
- <OText size={10} style={{ lineHeight: 15 }}>
230
- {parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
231
- </OText>
232
- </Reviews>
233
- )}
234
- <LottieAnimation
235
- type='favorite'
236
- onClick={handleChangeFavorite}
237
- initialValue={business?.favorite ? 0.75 : 0}
238
- toValue={business?.favorite ? 0 : 0.75}
239
- disableAnimation={!auth}
240
- iconProps={{ color: theme.colors.danger5, size: 18 }}
241
- isActive={business?.favorite}
242
- />
243
- </ReviewAndFavorite>
229
+ {!isCustomLayout && (
230
+ <ReviewAndFavorite>
231
+ {(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && (
232
+ <Reviews>
233
+ <OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
234
+ <OText size={10} style={{ lineHeight: 15 }}>
235
+ {parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
236
+ </OText>
237
+ </Reviews>
238
+ )}
239
+ <LottieAnimation
240
+ type='favorite'
241
+ onClick={handleChangeFavorite}
242
+ initialValue={business?.favorite ? 0.75 : 0}
243
+ toValue={business?.favorite ? 0 : 0.75}
244
+ disableAnimation={!auth}
245
+ iconProps={{ color: theme.colors.danger5, size: 18 }}
246
+ isActive={business?.favorite}
247
+ />
248
+ </ReviewAndFavorite>
249
+ )}
244
250
  </BusinessInfo>
245
- <OText
246
- size={12}
247
- style={{ lineHeight: 18, marginBottom: 6 }}
248
- weight={'500'}>
249
- {business?.name}
250
- </OText>
251
- <OText size={10} style={{ lineHeight: 15, marginBottom: 3 }}>
251
+ <View style={isCustomLayout && { width: '100%', flexDirection: 'row', justifyContent: 'space-between', marginTop: 5 }}>
252
+ <OText
253
+ size={textSize + 2}
254
+ style={{ lineHeight: 18, marginBottom: 6 }}
255
+ weight={'500'}>
256
+ {business?.name}
257
+ </OText>
258
+ {isCustomLayout && (
259
+ <ReviewAndFavorite>
260
+ {(businessReviews?.reviews?.total > 0 ?? business?.reviews?.total > 0) && (
261
+ <Reviews>
262
+ <OIcon src={theme.images.general.star} width={12} style={styles.starIcon} />
263
+ <OText size={10} style={{ lineHeight: 15 }}>
264
+ {parseNumber(businessReviews?.reviews?.total ?? business?.reviews?.total, { separator: '.' })}
265
+ </OText>
266
+ </Reviews>
267
+ )}
268
+ <LottieAnimation
269
+ type='favorite'
270
+ onClick={handleChangeFavorite}
271
+ initialValue={business?.favorite ? 0.75 : 0}
272
+ toValue={business?.favorite ? 0 : 0.75}
273
+ disableAnimation={!auth}
274
+ iconProps={{ color: theme.colors.danger5, size: 18 }}
275
+ isActive={business?.favorite}
276
+ />
277
+ </ReviewAndFavorite>
278
+ )}
279
+ </View>
280
+ <OText size={textSize} style={{ lineHeight: 15, marginBottom: 3 }} numberOfLines={isCustomLayout ? 1 : 2}>
252
281
  {business?.address}
253
282
  </OText>
254
- {/* <BusinessCategory>
255
- <OText>{getBusinessType()}</OText>
256
- </BusinessCategory> */}
257
283
  <Metadata>
258
284
  {!isBusinessOpen ? (
259
285
  <View style={styles.closed}>
@@ -264,16 +290,16 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
264
290
  ) : (
265
291
  <View style={styles.bullet}>
266
292
  {orderState?.options?.type === 1 && (
267
- <OText size={10} color={theme.colors.textSecondary}>
293
+ <OText size={textSize} color={theme.colors.textSecondary}>
268
294
  {`${t('DELIVERY_FEE', 'Delivery fee')} ${parsePrice(businessDeliveryPrice ?? business?.delivery_price) + ' \u2022 '}`}
269
295
  </OText>
270
296
  )}
271
- <OText size={10} color={theme.colors.textSecondary}>{`${convertHoursToMinutes(
297
+ <OText size={textSize} color={theme.colors.textSecondary}>{`${convertHoursToMinutes(
272
298
  orderState?.options?.type === 1
273
299
  ? (businessDeliveryTime ?? business?.delivery_time)
274
300
  : (businessPickupTime ?? business?.pickup_time),
275
301
  )} \u2022 `}</OText>
276
- <OText size={10} color={theme.colors.textSecondary}>{parseDistance(businessDistance ?? business?.distance)}</OText>
302
+ <OText size={textSize} color={theme.colors.textSecondary}>{parseDistance(businessDistance ?? business?.distance)}</OText>
277
303
  </View>
278
304
  )}
279
305
  </Metadata>
@@ -9,7 +9,7 @@ export const BusinessHero = styled.View`
9
9
 
10
10
  export const BusinessContent = styled.View`
11
11
  padding-horizontal: 18px;
12
- padding-bottom: 18px;
12
+ padding-bottom: 10px;
13
13
  border-bottom-left-radius: 7.6px;
14
14
  border-bottom-right-radius: 7.6px;
15
15
  border-width: 1px;
@@ -76,6 +76,8 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
76
76
  { text: t('PICKUP_TIME', 'Pickup time'), value: 'pickup_time' }
77
77
  ]
78
78
 
79
+ const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
80
+
79
81
  const priceList = [
80
82
  { level: '1', content: '$' },
81
83
  { level: '2', content: '$$' },
@@ -97,7 +99,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
97
99
  width: '100%'
98
100
  },
99
101
  searchInput: {
100
- fontSize: 10,
102
+ fontSize: 12,
101
103
  },
102
104
  productsContainer: {
103
105
  marginTop: 20
@@ -231,6 +233,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
231
233
  <SearchWrapper>
232
234
  <SearchBar
233
235
  lazyLoad
236
+ {...(isChewLayout && { height: 55 })}
234
237
  inputStyle={{ ...styles.searchInput, ...Platform.OS === 'ios' ? {} : { paddingBottom: 4 } }}
235
238
  placeholder={`${t('SEARCH_BUSINESSES', 'Search Businesses')} / ${t('TYPE_AT_LEAST_3_CHARACTERS', 'type at least 3 characters')}`}
236
239
  onSearch={(val: string) => handleChangeTermValue(val)}
@@ -255,6 +258,12 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
255
258
  BusinessControllerSkeletons={BusinessControllerSkeletons}
256
259
  businessPaginationProps={paginationProps}
257
260
  franchiseId={brandId}
261
+ hideBackBtn
262
+ titleStyle={{
263
+ paddingHorizontal: 0,
264
+ marginTop: 0,
265
+ marginLeft: 0
266
+ }}
258
267
  />
259
268
  )}
260
269
 
@@ -263,19 +272,26 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
263
272
  {t('BUSINESSES', 'Businesses')}
264
273
  </OText>
265
274
  </OptionTitle>
266
- <ScrollView horizontal>
275
+ <ScrollView horizontal showsHorizontalScrollIndicator={false}>
267
276
  {businessesSearchList.businesses?.length > 0 && businessesSearchList.businesses.map((business: any, i: number) => (
268
- <BusinessController
277
+ <View
269
278
  key={business.id}
270
- business={business}
271
- isBusinessOpen={business.open}
272
- enableIntersection={false}
273
- handleCustomClick={() => onBusinessClick(business)}
274
- handleUpdateBusinessList={handleUpdateBusinessList}
275
- orderType={orderState?.options?.type}
276
- style={{ width: screenWidth - 120, marginRight: (businessesSearchList.loading || i !== businessesSearchList.businesses?.length - 1) ? 20 : 0 }}
277
- />
279
+ style={{
280
+ width: screenWidth - 120,
281
+ marginRight: (businessesSearchList.loading || i !== businessesSearchList.businesses?.length - 1) ? 20 : 0
282
+ }}
283
+ >
284
+ <BusinessController
285
+ business={business}
286
+ isBusinessOpen={business.open}
287
+ enableIntersection={false}
288
+ handleCustomClick={() => onBusinessClick(business)}
289
+ handleUpdateBusinessList={handleUpdateBusinessList}
290
+ orderType={orderState?.options?.type}
291
+ />
292
+ </View>
278
293
  ))}
294
+ {console.log(screenWidth)}
279
295
  {!businessesSearchList.loading && paginationProps?.totalPages && paginationProps?.currentPage < paginationProps?.totalPages && (
280
296
  <LoadMoreBusinessContainer>
281
297
  <OButton
@@ -166,14 +166,16 @@ const BusinessProductsListUI = (props: BusinessProductsListParams) => {
166
166
  style={bpStyles.catWrap}
167
167
  onLayout={(event: any) => handleOnLayout(event, category.id)}
168
168
  >
169
- <View style={bpStyles.catIcon}>
170
- <OIcon
171
- url={optimizeImage(category.image, 'h_250,c_limit')}
172
- width={41}
173
- height={41}
174
- style={{ borderRadius: 7.6 }}
175
- />
176
- </View>
169
+ {!!category.image && (
170
+ <View style={bpStyles.catIcon}>
171
+ <OIcon
172
+ url={optimizeImage(category.image, 'h_250,c_limit')}
173
+ width={41}
174
+ height={41}
175
+ style={{ borderRadius: 7.6 }}
176
+ />
177
+ </View>
178
+ )}
177
179
  <OText size={16} weight="600">
178
180
  {category.name}
179
181
  </OText>
@@ -394,7 +394,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
394
394
  <BackgroundGray isIos={Platform.OS === 'ios'} />
395
395
  )}
396
396
  <IOScrollView
397
- stickyHeaderIndices={[business?.professionals?.length > 0 ? 3 : 2]}
397
+ stickyHeaderIndices={[business?.professionals?.length > 0 ? 4 : 3]}
398
398
  style={{
399
399
  ...styles.mainContainer,
400
400
  marginBottom: currentCart?.products?.length > 0 && categoryState.products.length !== 0 ?
@@ -39,8 +39,7 @@ import {
39
39
  BusinessLogosContainer
40
40
  } from './styles';
41
41
 
42
- import { SearchBar } from '../../../SearchBar';
43
- import { OButton, OIcon, OText, OBottomPopup, OModal } from '../../../shared';
42
+ import { OIcon, OText, OModal } from '../../../shared';
44
43
  import { BusinessesListingParams } from '../../../../types';
45
44
  import { NotFoundSource } from '../../../NotFoundSource';
46
45
  import { BusinessTypeFilter } from '../../../BusinessTypeFilter';
@@ -55,6 +54,7 @@ import { useFocusEffect, useIsFocused } from '@react-navigation/native';
55
54
  import FastImage from 'react-native-fast-image';
56
55
  import IconAntDesign from 'react-native-vector-icons/AntDesign';
57
56
  import { PageBanner } from '../../../PageBanner'
57
+ import { CitiesControl } from '../../../CitiesControl'
58
58
 
59
59
  const PIXELS_TO_SCROLL = 2000;
60
60
 
@@ -62,12 +62,10 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
62
62
  const {
63
63
  navigation,
64
64
  businessesList,
65
- searchValue,
66
65
  getBusinesses,
67
66
  handleChangeBusinessType,
68
67
  handleBusinessClick,
69
68
  paginationProps,
70
- handleChangeSearch,
71
69
  businessId,
72
70
  isGuestUser,
73
71
  handleUpdateBusinessList,
@@ -79,8 +77,6 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
79
77
  const [orderingTheme] = useOrderingTheme()
80
78
  const isFocused = useIsFocused();
81
79
  const appState = useRef(AppState.currentState)
82
- const searchBarRef = useRef<any>()
83
- const [appStateVisible, setAppStateVisible] = useState(appState.current);
84
80
  const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
85
81
  const hideCities = theme?.business_listing_view?.components?.cities?.hidden ?? true
86
82
  const [refreshing] = useState(false);
@@ -314,10 +310,9 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
314
310
  key={business?.id}
315
311
  onPress={() => handleBusinessClick && handleBusinessClick(business)}
316
312
  style={{
317
- width: 57,
318
- height: 58,
319
- borderBottomColor: theme.colors.primary,
320
- borderBottomWidth: business?.slug === actualSlug ? 2 : 0,
313
+ width: 60,
314
+ height: 60,
315
+ borderRadius: 8,
321
316
  marginRight: 5
322
317
  }}
323
318
  >
@@ -326,8 +321,9 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
326
321
  width: 56,
327
322
  height: 56,
328
323
  marginRight: 20,
329
- borderTopLeftRadius: 7.6,
330
- borderTopRightRadius: 7.6
324
+ borderRadius: 8,
325
+ borderColor: theme.colors.primary,
326
+ borderWidth: business?.slug === actualSlug ? 2 : 0
331
327
  }}
332
328
  source={{
333
329
  uri: business?.logo,
@@ -370,8 +366,8 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
370
366
  >
371
367
  {isChewLayout && (
372
368
  <View style={{ marginTop: 30, paddingHorizontal: 30, flexDirection: 'row', justifyContent: 'space-between' }}>
373
- <OText size={18} weight={700} color={theme.colors?.white}>
374
- {t('WELCOME', 'Welcome')} {user?.name}!
369
+ <OText size={24} weight={700} color={theme.colors?.white}>
370
+ {t('WELCOME', 'Welcome')} {user?.name}
375
371
  </OText>
376
372
  </View>
377
373
  )}
@@ -494,6 +490,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
494
490
  <TouchableOpacity
495
491
  style={styles.buttonCityStyle}
496
492
  onPress={() => setIsOpenCities(true)}
493
+ disabled={orderState?.loading}
497
494
  >
498
495
  <OText size={18} color={theme.colors.backgroundGray} weight='bold' style={{ textAlign: 'center' }}>
499
496
  {citiesState?.cities?.find((city: any) => city?.id === orderState?.options?.city_id)?.name || t('FILTER_BY_CITY', 'Filter by city')}
@@ -575,6 +572,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
575
572
  <BusinessController
576
573
  key={`${business.id}_` + i}
577
574
  enableIntersection
575
+ isCustomLayout={isChewLayout}
578
576
  business={business}
579
577
  isBusinessOpen={business.open}
580
578
  handleCustomClick={handleBusinessClick}
@@ -651,36 +649,11 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
651
649
  onClose={() => setIsOpenCities(false)}
652
650
  title={t('SELECT_A_CITY', 'Select a city')}
653
651
  >
654
- <View style={{ padding: 40, width: '100%' }}>
655
- {citiesState?.cities?.map((city: any) => (
656
- <TouchableOpacity
657
- key={city?.id}
658
- style={{
659
- padding: 10,
660
- flexDirection: 'row'
661
- }}
662
- onPress={() => handleChangeCity(city?.id)}
663
- disabled={orderState?.loading}
664
- >
665
- {orderState?.options?.city_id === city?.id ? (
666
- <OIcon
667
- src={theme.images.general.option_checked}
668
- width={16}
669
- style={{ marginEnd: 24 }}
670
- />
671
- ) : (
672
- <OIcon
673
- src={theme.images.general.option_normal}
674
- width={16}
675
- style={{ marginEnd: 24 }}
676
- />
677
- )}
678
- <OText color={theme.colors.black}>
679
- {city?.name}
680
- </OText>
681
- </TouchableOpacity>
682
- ))}
683
- </View>
652
+ <CitiesControl
653
+ cities={citiesState?.cities}
654
+ onClose={() => setIsOpenCities(false)}
655
+ handleChangeCity={handleChangeCity}
656
+ />
684
657
  </OModal>
685
658
  </IOScrollView>
686
659
  );