ordering-ui-react-native 0.16.91 → 0.16.93

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 (24) hide show
  1. package/package.json +1 -1
  2. package/themes/business/src/components/BusinessController/index.tsx +1 -0
  3. package/themes/business/src/components/ReviewCustomer/index.tsx +13 -3
  4. package/themes/business/src/components/StoresList/index.tsx +2 -2
  5. package/themes/original/src/components/AddressForm/index.tsx +20 -29
  6. package/themes/original/src/components/AddressList/index.tsx +1 -1
  7. package/themes/original/src/components/BusinessBasicInformation/index.tsx +21 -20
  8. package/themes/original/src/components/BusinessController/index.tsx +2 -2
  9. package/themes/original/src/components/BusinessListingSearch/index.tsx +34 -9
  10. package/themes/original/src/components/BusinessListingSearch/styles.tsx +6 -0
  11. package/themes/original/src/components/BusinessProductsListing/index.tsx +1 -1
  12. package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
  13. package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +31 -18
  14. package/themes/original/src/components/GPSButton/index.tsx +20 -19
  15. package/themes/original/src/components/NetworkError/index.tsx +5 -3
  16. package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
  17. package/themes/original/src/components/OrderTypeSelector/index.tsx +6 -1
  18. package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +1 -1
  19. package/themes/original/src/components/ProductForm/index.tsx +18 -3
  20. package/themes/original/src/components/ProductForm/styles.tsx +1 -1
  21. package/themes/original/src/components/ProductItemAccordion/index.tsx +3 -3
  22. package/themes/original/src/components/SingleOrderCard/index.tsx +2 -2
  23. package/themes/original/src/components/SingleProductCard/index.tsx +2 -2
  24. package/themes/original/src/components/Wallets/index.tsx +1 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.16.91",
3
+ "version": "0.16.93",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -97,6 +97,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
97
97
  <Logo style={styles.logo}>
98
98
  <OIcon
99
99
  url={optimizeImage(business?.logo, 'h_300,c_limit')}
100
+ src={!business?.logo && theme?.images?.dummies?.businessLogo}
100
101
  style={styles.icon}
101
102
  />
102
103
  </Logo>
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect } from 'react'
1
+ import React, { useState, useEffect, useRef } from 'react'
2
2
  import {
3
3
  useLanguage,
4
4
  useUtils,
@@ -10,7 +10,8 @@ import {
10
10
  View,
11
11
  StyleSheet,
12
12
  I18nManager,
13
- TouchableOpacity
13
+ TouchableOpacity,
14
+ Keyboard
14
15
  } from 'react-native'
15
16
  import { useTheme } from 'styled-components/native'
16
17
  import { ReviewCustomerParams } from '../../types'
@@ -52,7 +53,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
52
53
  const { top, bottom } = useSafeAreaInsets()
53
54
  const [comments, setComments] = useState<Array<any>>([])
54
55
  const [extraComment, setExtraComment] = useState('')
55
-
56
+ const scrollref = useRef<any>()
56
57
  const styles = StyleSheet.create({
57
58
  photoWrapper: {
58
59
  shadowColor: theme.colors.black,
@@ -142,6 +143,14 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
142
143
 
143
144
  }, [actionState.error])
144
145
 
146
+ useEffect(() => {
147
+ if(scrollref?.current){
148
+ Keyboard.addListener('keyboardDidShow', () => {
149
+ scrollref.current.scrollToEnd()
150
+ })
151
+ }
152
+ }, [scrollref?.current])
153
+
145
154
  return (
146
155
  <KeyboardAvoidingView
147
156
  enabled
@@ -179,6 +188,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
179
188
  <Content
180
189
  showsVerticalScrollIndicator={false}
181
190
  contentContainerStyle={{ paddingBottom: 30 }}
191
+ ref={scrollref}
182
192
  >
183
193
  <CustomerInfoContainer>
184
194
  <View
@@ -149,10 +149,10 @@ const StoresListUI = (props: BusinessesListingParams) => {
149
149
  width={12}
150
150
  height={12}
151
151
  color={theme.colors.skyBlue}
152
- style={{ marginRight: 5 }}
152
+ style={{ marginRight: 5, marginTop: 3 }}
153
153
  />
154
154
  <OText size={12}>
155
- {t('MORE_SETTINGS_GO_TO', 'For more settings go to ')}
155
+ {t('MORE_SETTINGS_GO_TO', 'For more settings go to')}{' '}
156
156
  </OText>
157
157
  <TouchableOpacity onPress={() => { Linking.openURL(t('LINK_MORE_SETTINGS_GO_TO', 'https://app.ordering.co')) }}>
158
158
  <OText size={12} color={theme.colors.skyBlue}>
@@ -5,7 +5,6 @@ import {
5
5
  TouchableOpacity,
6
6
  Keyboard,
7
7
  TouchableWithoutFeedback,
8
- KeyboardAvoidingView,
9
8
  Platform,
10
9
  } from 'react-native';
11
10
  import {
@@ -22,7 +21,7 @@ import Spinner from 'react-native-loading-spinner-overlay';
22
21
  import { useForm, Controller } from 'react-hook-form';
23
22
  import Geocoder from 'react-native-geocoding';
24
23
 
25
- import { OInput, OButton, OText, OModal, OIcon } from '../shared';
24
+ import { OInput, OButton, OModal, OIcon } from '../shared';
26
25
  import { AddressFormParams } from '../../types';
27
26
  import { getTraduction } from '../../utils';
28
27
  import { useTheme } from 'styled-components/native';
@@ -57,7 +56,6 @@ const AddressFormUI = (props: AddressFormParams) => {
57
56
  addressState,
58
57
  addressesList,
59
58
  saveAddress,
60
- userCustomerSetup,
61
59
  isGuestUser,
62
60
  isRequiredField,
63
61
  isFromProductsList,
@@ -599,33 +597,26 @@ const AddressFormUI = (props: AddressFormParams) => {
599
597
  />
600
598
  )}
601
599
  />
602
- {hasEditing ? (
603
- <View style={styles.pinIcon}>
604
- <GPSButton
605
- apiKey={googleMapsApiKey}
606
- handleGPS={(data: any, detail: any) => {
607
- handleChangeAddress(data, detail);
608
- setValue(data.address);
609
- if (googleInput?.current) {
610
- googleInput?.current?.setAddressText(data.address);
611
- }
612
- }}
613
- IconButton={<OIcon src={theme.images.general.pin} width={16} />}
614
- />
615
- </View>
616
- ) : null}
617
- </AutocompleteInput>
618
600
 
619
- {/* {!isKeyboardShow && (addressState?.address?.location || formState?.changes?.location) && (
620
- <TouchableOpacity onPress={handleToggleMap} style={{ marginBottom: 10 }}>
621
- <OText
622
- color={theme.colors.primary}
623
- style={{ textAlign: 'center' }}
624
- >
625
- {t('VIEW_MAP', 'View map to modify the exact location')}
626
- </OText>
627
- </TouchableOpacity>
628
- )} */}
601
+ {(
602
+ (!isEditing && !formState.changes?.address) ||
603
+ (isEditing && !formState.changes?.address && formState.changes?.address !== undefined)) &&
604
+ (
605
+ <View style={styles.pinIcon}>
606
+ <GPSButton
607
+ apiKey={googleMapsApiKey}
608
+ handleGPS={(data: any, detail: any) => {
609
+ handleChangeAddress(data, detail);
610
+ setValue('address', data.address);
611
+ if (googleInput?.current) {
612
+ googleInput?.current?.setAddressText(data.address);
613
+ }
614
+ }}
615
+ IconButton={<OIcon src={theme.images.general.pin} width={16} />}
616
+ />
617
+ </View>
618
+ )}
619
+ </AutocompleteInput>
629
620
 
630
621
  {(locationChange || formState.changes?.location) && (
631
622
  <View
@@ -59,7 +59,7 @@ const AddressListUI = (props: AddressListParams) => {
59
59
  }
60
60
 
61
61
  const uniqueAddressesList = (addressList.addresses && addressList.addresses.filter(
62
- (address: any, i: number, self: any) =>
62
+ (address: any, i: number, self: any) => address.address &&
63
63
  i === self.findIndex((obj: any) => (
64
64
  address.address === obj.address &&
65
65
  address.address_notes === obj.address_notes &&
@@ -1,5 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import { StyleSheet, View, TouchableOpacity, Linking, Pressable } from 'react-native';
3
+ import FastImage from 'react-native-fast-image'
3
4
  import { useUtils, useOrder, useLanguage } from 'ordering-components/native';
4
5
  import { useTheme } from 'styled-components/native';
5
6
  import { OIcon, OText, OModal } from '../shared';
@@ -45,7 +46,7 @@ export const BusinessBasicInformation = (
45
46
  const [openBusinessReviews, setOpenBusinessReviews] = useState(false);
46
47
  const [businessInformationObtained, setBusinessInformationObtained] = useState(false)
47
48
  const [businessReviewsObtained, setBusinessReviewsObtainedbtained] = useState(false)
48
- const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'original'
49
+ const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
49
50
  const showLogo = !theme?.business_view?.components?.header?.components?.business?.components?.logo?.hidden
50
51
 
51
52
  const styles = StyleSheet.create({
@@ -55,13 +56,13 @@ export const BusinessBasicInformation = (
55
56
  headerStyle: {
56
57
  height: isChewLayout ? 170 : 260,
57
58
  },
58
- businessLogo: {
59
- width: 72,
60
- height: 72,
61
- borderRadius: 7.6,
62
- justifyContent: 'flex-start',
63
- alignItems: 'flex-start',
64
- },
59
+ logoStyle: {
60
+ width: 72,
61
+ height: 72,
62
+ borderRadius: 7.6,
63
+ justifyContent: 'flex-start',
64
+ alignItems: 'flex-start'
65
+ },
65
66
  businessInfo: {
66
67
  paddingHorizontal: 40,
67
68
  paddingTop: isChewLayout ? 0 : 56,
@@ -270,11 +271,9 @@ export const BusinessBasicInformation = (
270
271
  ? styles.businesInfoheaderStyle
271
272
  : { ...styles.headerStyle, backgroundColor: theme.colors.backgroundGray }
272
273
  }
273
- source={{
274
- uri:
275
- header ||
276
- optimizeImage(businessState?.business?.header, 'h_250,c_limit'),
277
- }}
274
+ {...(!loading && { source: {
275
+ uri: header || optimizeImage(businessState?.business?.header || theme?.images?.dummies?.businessHeader, 'h_250,c_limit')
276
+ }})}
278
277
  imageStyle={{ opacity: isChewLayout ? 0.5 : 1 }}
279
278
  >
280
279
  {!isBusinessInfoShow && !isChewLayout && (
@@ -282,7 +281,7 @@ export const BusinessBasicInformation = (
282
281
  <OIcon src={theme.images.general.info} width={24} />
283
282
  </WrapBusinessInfo>
284
283
  )}
285
- {isChewLayout && (
284
+ {isChewLayout && !loading && (
286
285
  <View style={styles.headerChewStyle}>
287
286
  <OText size={24} weight={'600'} mBottom={-5}>
288
287
  {business?.name}
@@ -302,12 +301,14 @@ export const BusinessBasicInformation = (
302
301
  {showLogo && (
303
302
  <BusinessLogo isChewLayout={isChewLayout}>
304
303
  {!isBusinessInfoShow && (
305
- <OIcon
306
- url={
307
- logo ||
308
- optimizeImage(businessState?.business?.logo, 'h_70,c_limit')
309
- }
310
- style={styles.businessLogo}
304
+ <FastImage
305
+ style={styles.logoStyle}
306
+ source={{
307
+ uri: logo || optimizeImage(businessState?.business?.logo || theme?.images?.dummies?.businessLogo, 'h_70,c_limit'),
308
+ priority: FastImage.priority.high,
309
+ cache:FastImage.cacheControl.web
310
+ }}
311
+ resizeMode={FastImage.resizeMode.contain}
311
312
  />
312
313
  )}
313
314
  </BusinessLogo>
@@ -175,7 +175,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
175
175
  <FastImage
176
176
  style={{ height: 120 }}
177
177
  source={{
178
- uri: optimizeImage(businessHeader || business?.header, 'h_500,c_limit'),
178
+ uri: optimizeImage(businessHeader || business?.header || theme.images.dummies.businessHeader, 'h_500,c_limit'),
179
179
  priority: FastImage.priority.normal,
180
180
  }}
181
181
  resizeMode={FastImage.resizeMode.cover}
@@ -204,7 +204,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
204
204
  <FastImage
205
205
  style={{ width: 56, height: 56 }}
206
206
  source={{
207
- uri: optimizeImage(businessLogo || business?.logo, 'h_150,c_limit'),
207
+ uri: optimizeImage(businessLogo || business?.logo || theme.images.dummies.businessLogo, 'h_150,c_limit'),
208
208
  priority: FastImage.priority.normal,
209
209
  }}
210
210
  resizeMode={FastImage.resizeMode.cover}
@@ -25,7 +25,8 @@ import {
25
25
  BrandItem,
26
26
  PriceFilterWrapper,
27
27
  OptionTitle,
28
- BContainer
28
+ BContainer,
29
+ WrapperButtons
29
30
  } from './styles'
30
31
  import FastImage from 'react-native-fast-image'
31
32
  import { convertHoursToMinutes } from '../../utils'
@@ -134,7 +135,7 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
134
135
  borderWidth: 0
135
136
  },
136
137
  applyButton: {
137
- paddingHorizontal: 40,
138
+ paddingHorizontal: 10,
138
139
  width: '100%',
139
140
  marginTop: 20
140
141
  }
@@ -145,10 +146,14 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
145
146
  }
146
147
 
147
148
  const handleCloseFilters = () => {
148
- setFilters({ business_types: [], orderBy: 'default', franchise_ids: [], price_level: null })
149
+ clearFilters()
149
150
  setOpenFilters(false)
150
151
  }
151
152
 
153
+ const clearFilters = () => {
154
+ setFilters({ business_types: [], orderBy: 'default', franchise_ids: [], price_level: null })
155
+ }
156
+
152
157
  const handleChangeActiveBusinessType = (type: any) => {
153
158
  if (type?.id === null) {
154
159
  handleChangeFilters('business_types', [])
@@ -482,22 +487,28 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
482
487
  </PriceFilterWrapper>
483
488
  {orderState?.options?.type === 1 && (
484
489
  <MaxSectionItem
490
+ filters={filters}
485
491
  title={t('MAX_DELIVERY_FEE', 'Max delivery fee')}
486
492
  options={maxDeliveryFeeOptions}
487
493
  filter='max_delivery_price'
494
+ handleChangeFilters={handleChangeFilters}
488
495
  />
489
496
  )}
490
497
  {[1, 2].includes(orderState?.options?.type) && (
491
498
  <MaxSectionItem
499
+ filters={filters}
492
500
  title={orderState?.options?.type === 1 ? t('MAX_DELIVERY_TIME', 'Max delivery time') : t('MAX_PICKUP_TIME', 'Max pickup time')}
493
501
  options={maxTimeOptions}
494
502
  filter='max_eta'
503
+ handleChangeFilters={handleChangeFilters}
495
504
  />
496
505
  )}
497
506
  <MaxSectionItem
507
+ filters={filters}
498
508
  title={t('MAX_DISTANCE', 'Max distance')}
499
509
  options={maxDistanceOptions}
500
510
  filter='max_distance'
511
+ handleChangeFilters={handleChangeFilters}
501
512
  />
502
513
  {businessTypes?.length > 0 && (
503
514
  <TagsContainer>
@@ -517,12 +528,26 @@ export const BusinessListingSearchUI = (props: BusinessSearchParams) => {
517
528
  </TagsContainer>
518
529
  )}
519
530
  </ScrollView>
520
- <OButton
521
- text={t('APPLY', 'Apply')}
522
- parentStyle={styles.applyButton}
523
- textStyle={{ color: '#fff' }}
524
- onClick={() => handleApplyFilters()}
525
- />
531
+ <WrapperButtons>
532
+ <View style={{ width: '50%' }}>
533
+ <OButton
534
+ text={t('APPLY', 'Apply')}
535
+ parentStyle={styles.applyButton}
536
+ textStyle={{ color: '#fff' }}
537
+ onClick={() => handleApplyFilters()}
538
+ />
539
+ </View>
540
+ <View style={{ width: '50%' }}>
541
+ <OButton
542
+ text={t('CLEAR_FILTERS', 'Clear')}
543
+ bgColor={theme.colors.white}
544
+ borderColor={theme.colors.primary}
545
+ parentStyle={styles.applyButton}
546
+ textStyle={{ color: theme.colors.primary }}
547
+ onClick={() => clearFilters()}
548
+ />
549
+ </View>
550
+ </WrapperButtons>
526
551
  </OModal>
527
552
  </BContainer>
528
553
  )
@@ -86,3 +86,9 @@ export const OptionTitle = styled.View`
86
86
  margin-left: ${() => props.isBusinessesSearchList ? '0' : '40px'};
87
87
  `}
88
88
  `
89
+
90
+ export const WrapperButtons = styled.View`
91
+ flex-direction: row;
92
+ width: 100%;
93
+ justify-content: space-between;
94
+ `
@@ -293,7 +293,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
293
293
  </Placeholder>
294
294
  </NearBusiness>
295
295
  )}
296
- {!hideBusinessNearCity && businessState?.business?.city_id && (
296
+ {!loading && !hideBusinessNearCity && businessState?.business?.city_id && (
297
297
  <NearBusiness>
298
298
  <BusinessesListing
299
299
  logosLayout
@@ -38,6 +38,7 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
38
38
 
39
39
  const theme = useTheme();
40
40
  const [isOpenAllCategories, setIsOpenAllCategories] = useState(false)
41
+ const defaultImage = (name : string) => theme.images?.categories?.[name.toLowerCase()]
41
42
 
42
43
  useEffect(() => {
43
44
  if(typesState?.types?.length > 0){
@@ -197,9 +198,9 @@ export const BusinessTypeFilterUI = (props: BusinessTypeFilterParams) => {
197
198
  isOpenAllCategories && setIsOpenAllCategories(false)
198
199
  }}
199
200
  >
200
- {item.image ? (
201
+ {(item.image || defaultImage(item.name)) ? (
201
202
  <OIcon
202
- url={item.image}
203
+ url={item.image || defaultImage(item.name)}
203
204
  style={styles.logo}
204
205
  />
205
206
  ) : (
@@ -18,7 +18,8 @@ import {
18
18
  useSession,
19
19
  useOrder,
20
20
  useConfig,
21
- useUtils
21
+ useUtils,
22
+ useOrderingTheme
22
23
  } from 'ordering-components/native';
23
24
  import { useTheme } from 'styled-components/native';
24
25
  import Ionicons from 'react-native-vector-icons/Ionicons'
@@ -75,13 +76,15 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
75
76
  logosLayout
76
77
  } = props;
77
78
  const theme = useTheme();
79
+ const [orderingTheme] = useOrderingTheme()
78
80
  const isFocused = useIsFocused();
79
81
  const appState = useRef(AppState.currentState)
80
82
  const searchBarRef = useRef<any>()
81
83
  const [appStateVisible, setAppStateVisible] = useState(appState.current);
82
- const isChewLayout = theme?.header?.components?.layout?.type === 'original'
84
+ const isChewLayout = theme?.header?.components?.layout?.type === 'chew'
83
85
  const hideCities = theme?.business_listing_view?.components?.cities?.hidden ?? true
84
86
  const [refreshing] = useState(false);
87
+ const bgHeader = orderingTheme?.theme?.business_listing_view?.components?.business_hero?.components?.image
85
88
  const styles = StyleSheet.create({
86
89
  container: {
87
90
  marginBottom: 0,
@@ -165,16 +168,6 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
165
168
  const [favoriteIds, setFavoriteIds] = useState<any>([])
166
169
  const chewOrderTypes = [{ name: t('DELIVERY', 'Delivery').toUpperCase(), value: 1 }, { name: t('PICKUP', 'Pickup').toUpperCase(), value: 2 }]
167
170
 
168
- // const panResponder = useRef(
169
- // PanResponder.create({
170
- // onMoveShouldSetPanResponder: (e, gestureState) => {
171
- // const { dx, dy } = gestureState;
172
- // resetInactivityTimeout()
173
- // return (Math.abs(dx) > 20) || (Math.abs(dy) > 20);
174
- // },
175
- // })
176
- // ).current
177
-
178
171
  const handleMomentClick = () => {
179
172
  if (isPreorderEnabled) {
180
173
  navigation.navigate('MomentOption')
@@ -296,7 +289,10 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
296
289
 
297
290
  if (logosLayout) {
298
291
  return (
299
- <BusinessLogosContainer horizontal>
292
+ <BusinessLogosContainer
293
+ horizontal
294
+ showsHorizontalScrollIndicator={false}
295
+ >
300
296
  {businessesList?.loading ? (
301
297
  <Placeholder Animation={Fade}>
302
298
  <View style={{ flexDirection: 'row' }}>
@@ -310,14 +306,27 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
310
306
  ) : (
311
307
  <>
312
308
  {businessesList.businesses
313
- ?.filter(business => business?.slug !== actualSlug && business?.open)
309
+ ?.filter(business => business?.open)
314
310
  ?.map(business => (
315
311
  <TouchableOpacity
316
312
  key={business?.id}
317
313
  onPress={() => handleBusinessClick && handleBusinessClick(business)}
314
+ style={{
315
+ width: 57,
316
+ height: 58,
317
+ borderBottomColor: theme.colors.primary,
318
+ borderBottomWidth: business?.slug === actualSlug ? 2 : 0,
319
+ marginRight: 5
320
+ }}
318
321
  >
319
322
  <FastImage
320
- style={{ width: 56, height: 56, marginRight: 20, borderRadius: 7.6 }}
323
+ style={{
324
+ width: 56,
325
+ height: 56,
326
+ marginRight: 20,
327
+ borderTopLeftRadius: 7.6,
328
+ borderTopRightRadius: 7.6
329
+ }}
321
330
  source={{
322
331
  uri: business?.logo,
323
332
  priority: FastImage.priority.normal,
@@ -333,7 +342,10 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
333
342
  }
334
343
 
335
344
  return (
336
- <IOScrollView style={styles.container} onScroll={(e) => handleScroll(e)} showsVerticalScrollIndicator={false}
345
+ <IOScrollView
346
+ style={styles.container}
347
+ onScroll={(e) => handleScroll(e)}
348
+ showsVerticalScrollIndicator={false}
337
349
  refreshControl={
338
350
  <RefreshControl
339
351
  refreshing={refreshing}
@@ -446,7 +458,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
446
458
  </View>
447
459
  {!isChewLayout ? (
448
460
  <HeaderWrapper
449
- source={theme.images.backgrounds.business_list_header}
461
+ source={bgHeader ? {uri: bgHeader} : theme.images.backgrounds.business_list_header}
450
462
  style={{ paddingTop: top + 20 }}
451
463
  resizeMode='cover'
452
464
  >
@@ -463,11 +475,12 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
463
475
  handleChangeBusinessType={handleChangeBusinessType}
464
476
  isChewLayout
465
477
  chewOrderTypes={chewOrderTypes}
478
+ handleChangeType={setOrderTypeValue}
466
479
  />
467
480
  </OrderTypesContainer>
468
481
  )}
469
482
 
470
- {!hideCities && (
483
+ {!hideCities && orderTypeValue === 2 && (
471
484
  <View style={{ marginTop: 20 }}>
472
485
  <TouchableOpacity
473
486
  style={styles.buttonCityStyle}
@@ -1,17 +1,16 @@
1
1
  import React, { useEffect, useState } from 'react'
2
- import { getTrackingStatus, requestTrackingPermission } from 'react-native-tracking-transparency'
3
- import Geolocation from '@react-native-community/geolocation'
4
2
  import Geocoder from 'react-native-geocoding'
5
- import { GpsButtonStyle } from './styles'
6
- import { View } from 'react-native'
7
- import { OText } from '../shared'
8
3
  import { ActivityIndicator } from 'react-native-paper'
4
+ import Geolocation from '@react-native-community/geolocation'
5
+ import { getTrackingStatus, requestTrackingPermission } from 'react-native-tracking-transparency'
6
+
7
+ import { OText } from '../shared'
8
+ import { GpsButtonStyle } from './styles'
9
9
 
10
10
  export const GPSButton = (props: any) => {
11
11
  const {
12
12
  handleGPS,
13
13
  apiKey,
14
- googleReady,
15
14
  IconButton,
16
15
  IconLoadingButton
17
16
  } = props
@@ -56,25 +55,27 @@ export const GPSButton = (props: any) => {
56
55
  })
57
56
  }
58
57
 
59
- const getCurrentPosition = async () => {
58
+ const getCurrentPosition = async () => {
60
59
  let trackingStatus = await getTrackingStatus()
61
- if (trackingStatus === 'not-determined') {
62
- trackingStatus = await requestTrackingPermission()
63
- }
64
- if (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {
65
- setLoading(true);
60
+ if (trackingStatus === 'not-determined') {
61
+ trackingStatus = await requestTrackingPermission()
62
+ }
63
+ if (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {
64
+ setLoading(true)
66
65
  Geolocation.getCurrentPosition((pos) => {
67
- geoCodePosition(pos.coords);
66
+ geoCodePosition(pos.coords)
68
67
  }, (err) => {
69
68
  setLoading(false);
70
- console.log(err);
71
- });
69
+ console.log(`ERROR(${err.code}): ${err.message}`)
70
+ }, {
71
+ enableHighAccuracy: true, timeout: 15000, maximumAge: 10000
72
+ })
72
73
  }
73
- }
74
+ }
74
75
 
75
- useEffect(() => {
76
- Geocoder.init(apiKey);
77
- }, [])
76
+ useEffect(() => {
77
+ Geocoder.init(apiKey);
78
+ }, [])
78
79
 
79
80
  return (
80
81
  <GpsButtonStyle
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { useLanguage } from 'ordering-components/native'
2
+ import { useLanguage, useOrderingTheme } from 'ordering-components/native'
3
3
  import { Dimensions } from 'react-native'
4
4
  import RNRestart from 'react-native-restart'
5
5
  import { OText, OIcon, OButton } from '../shared'
@@ -16,7 +16,8 @@ export const NetworkError = (props: NoNetworkParams) => {
16
16
  } = props
17
17
  const theme = useTheme()
18
18
  const [, t] = useLanguage()
19
-
19
+ const [orderingTheme] = useOrderingTheme()
20
+ const urlimage = orderingTheme?.theme?.no_internet?.components?.image
20
21
  const noNetworkImage = image || theme.images.general.noNetwork
21
22
  const deviceWidth = Dimensions.get('screen').width
22
23
 
@@ -38,7 +39,8 @@ export const NetworkError = (props: NoNetworkParams) => {
38
39
  </OText>
39
40
  <ImageContainer>
40
41
  <OIcon
41
- src={noNetworkImage}
42
+ src={!urlimage && noNetworkImage}
43
+ url={urlimage}
42
44
  width={(deviceWidth - 80) * 0.9}
43
45
  height={(deviceWidth - 80) * 0.8}
44
46
  />
@@ -20,12 +20,13 @@ export const NotFoundSource = (props: NotFoundSourceParams) => {
20
20
  const theme = useTheme();
21
21
 
22
22
  const errorImage = image || theme.images.general.notFound
23
+ const isUrl = errorImage.includes('http')
23
24
 
24
25
  return (
25
26
  <NotFound>
26
27
  {errorImage && (
27
28
  <NotFoundImage>
28
- <OIcon src={errorImage} width={260} height={220} />
29
+ <OIcon url={isUrl && errorImage} src={!isUrl && errorImage} width={260} height={220} />
29
30
  </NotFoundImage>
30
31
  )}
31
32
  {content && conditioned && !errorImage && <OText color={theme.colors.disabled} size={18} style={{ textAlign: 'center' }}>{content}</OText>}
@@ -1,4 +1,4 @@
1
- import React from 'react'
1
+ import React, { useEffect } from 'react'
2
2
  import {
3
3
  OrderTypeControl,
4
4
  useLanguage,
@@ -17,6 +17,7 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
17
17
  const {
18
18
  navigation,
19
19
  handleChangeOrderType,
20
+ handleChangeType,
20
21
  typeSelected,
21
22
  defaultValue,
22
23
  configTypes,
@@ -51,6 +52,10 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
51
52
  }
52
53
  }
53
54
 
55
+ useEffect(() => {
56
+ handleChangeType(typeSelected)
57
+ }, [typeSelected])
58
+
54
59
  return (
55
60
  <Wrapper>
56
61
  {isChewLayout ? (
@@ -97,7 +97,7 @@ export const PreviousBusinessOrdered = (props: PreviousBusinessOrderedParams) =>
97
97
  const [orderState] = useOrder()
98
98
  const windowWidth = Dimensions.get('window').width;
99
99
  const onBusinessClick = (business: any) => {
100
- onNavigationRedirect('Business', { store: business.slug })
100
+ onNavigationRedirect('Business', { store: business.slug, logo: business.logo, header: business.header })
101
101
  }
102
102
 
103
103
  const styles = StyleSheet.create({
@@ -15,7 +15,7 @@ import Swiper from 'react-native-swiper'
15
15
  import FastImage from 'react-native-fast-image';
16
16
  import IconAntDesign from 'react-native-vector-icons/AntDesign';
17
17
  import YoutubePlayer from "react-native-youtube-iframe"
18
- import { TextInput } from 'react-native'
18
+ import { Keyboard, TextInput } from 'react-native'
19
19
  import {
20
20
  Grayscale
21
21
  } from 'react-native-color-matrix-image-filters'
@@ -183,6 +183,7 @@ export const ProductOptionsUI = (props: any) => {
183
183
  const [headerRefHeight, setHeaderRefHeight] = useState(0)
184
184
  const [summaryRefHeight, setSummaryRefHeight] = useState(0)
185
185
  const [isScrollAvailable, setIsScrollAvailable] = useState(null)
186
+ const [isKeyboardShow, setIsKeyboardShow] = useState(false)
186
187
 
187
188
  const isError = (id: number) => {
188
189
  let bgColor = theme.colors.white;
@@ -345,7 +346,7 @@ export const ProductOptionsUI = (props: any) => {
345
346
  useEffect(() => {
346
347
  const imageList: any = []
347
348
  const videoList: any = []
348
- product?.images && imageList.push(product.images)
349
+ product?.images?.length > 0 ? imageList.push(product.images) : imageList.push(theme?.images?.dummies?.product)
349
350
  if (product?.gallery && product?.gallery.length > 0) {
350
351
  for (const img of product?.gallery) {
351
352
  if (img?.file) {
@@ -454,6 +455,20 @@ export const ProductOptionsUI = (props: any) => {
454
455
  )
455
456
  }
456
457
 
458
+ useEffect(() => {
459
+ const keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', () => {
460
+ setIsKeyboardShow(true)
461
+ })
462
+ const keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => {
463
+ setIsKeyboardShow(false)
464
+ })
465
+ return () => {
466
+ keyboardDidShowListener.remove()
467
+ keyboardDidHideListener.remove()
468
+ }
469
+ }, [])
470
+
471
+
457
472
  return (
458
473
  <SafeAreaView style={{ flex: 1 }}>
459
474
  <TopHeader>
@@ -947,7 +962,7 @@ export const ProductOptionsUI = (props: any) => {
947
962
  </>
948
963
  )}
949
964
  {!product?.hide_special_instructions && (
950
- <ProductComment>
965
+ <ProductComment pb={isKeyboardShow && Platform.OS === 'ios' && 320}>
951
966
  <SectionTitle>
952
967
  <OText size={16} weight={'600'} lineHeight={24}>
953
968
  {t('SPECIAL_COMMENT', 'Special comment')}
@@ -65,7 +65,7 @@ export const WrapperSubOption = styled.View`
65
65
  `
66
66
 
67
67
  export const ProductComment = styled.View`
68
- padding-bottom: 60px;
68
+ padding-bottom: ${(props: any) => props.pb || 60}px;
69
69
  `
70
70
 
71
71
  export const ProductActions = styled.View`
@@ -143,12 +143,12 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
143
143
  >
144
144
  <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>
145
145
  <ContentInfo>
146
- {product?.images && (
146
+ {(product?.images || theme?.images?.dummies?.product) && (
147
147
  <ProductImage>
148
148
  {isFromCheckout ? (
149
- <OIcon url={optimizeImage(product?.images, 'h_100,c_limit')} style={{ ...styles.productImage, ...{ width: 82, height: 82 } }} />
149
+ <OIcon url={optimizeImage(product?.images || theme?.images?.dummies?.product, 'h_100,c_limit')} style={{ ...styles.productImage, ...{ width: 82, height: 82 } }} />
150
150
  ) : (
151
- <OIcon url={optimizeImage(product?.images, 'h_100,c_limit')} style={styles.productImage} />
151
+ <OIcon url={optimizeImage(product?.images || theme?.images?.dummies?.product, 'h_100,c_limit')} style={styles.productImage} />
152
152
  )}
153
153
  </ProductImage>
154
154
  )}
@@ -170,10 +170,10 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
170
170
  activeOpacity={0.7}
171
171
  >
172
172
  <InnerContainer>
173
- {!!order.business?.logo && (
173
+ {(!!order.business?.logo || theme?.images?.dummies?.businessLogo) && (
174
174
  <Logo style={styles.logoWrapper}>
175
175
  <OIcon
176
- url={optimizeImage(order.business?.logo, 'h_300,c_limit')}
176
+ url={optimizeImage(order.business?.logo || theme?.images?.dummies?.businessLogo, 'h_300,c_limit')}
177
177
  style={styles.logo}
178
178
  />
179
179
  </Logo>
@@ -222,11 +222,11 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
222
222
  </OText>
223
223
  </RibbonBox>
224
224
  )}
225
- {product?.images && (
225
+ {(product?.images || theme?.images?.dummies?.product) && (
226
226
  <FastImage
227
227
  style={styles.productStyle}
228
228
  source={{
229
- uri: optimizeImage(product?.images, 'h_250,c_limit'),
229
+ uri: optimizeImage(product?.images || theme?.images?.dummies?.product, 'h_250,c_limit'),
230
230
  priority: FastImage.priority.normal,
231
231
  }}
232
232
  resizeMode={FastImage.resizeMode.cover}
@@ -48,8 +48,6 @@ const WalletsUI = (props: any) => {
48
48
  const [{ parsePrice }] = useUtils()
49
49
  const [{ configs }] = useConfig()
50
50
 
51
- console.log(theme)
52
-
53
51
  const styles = StyleSheet.create({
54
52
  logoStyle: {
55
53
  width: 120,
@@ -65,7 +63,7 @@ const WalletsUI = (props: any) => {
65
63
 
66
64
  const [tabSelected, setTabSelected] = useState(isWalletCashEnabled ? 'cash' : 'credit_point')
67
65
  const [openHistory, setOpenHistory] = useState(false)
68
- const isChewLayout = theme?.wallets_view?.components?.layout?.type === 'original'
66
+ const isChewLayout = theme?.wallets_view?.components?.layout?.type === 'chew'
69
67
 
70
68
  const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (isWalletCashEnabled || isWalletPointsEnabled)
71
69