ordering-ui-react-native 0.16.44 → 0.16.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.16.44",
3
+ "version": "0.16.45",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -86,6 +86,7 @@
86
86
  "react-native-google-places-autocomplete": "^2.1.3",
87
87
  "react-native-html-to-pdf": "^0.10.0",
88
88
  "react-native-image-picker": "^4.0.6",
89
+ "react-native-intersection-observer": "^0.0.9",
89
90
  "react-native-lightbox": "^0.8.1",
90
91
  "react-native-linear-gradient": "^2.5.6",
91
92
  "react-native-loading-spinner-overlay": "^2.0.0",
@@ -203,7 +203,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
203
203
  multiRemoveProducts && await multiRemoveProducts(unavailableProducts, _carts)
204
204
  return
205
205
  }
206
-
206
+
207
207
  if (alreadyRemoved === 'removed') {
208
208
  setAlertState({ open: true, content: [t('NOT_AVAILABLE_PRODUCT', 'This product is not available.')] })
209
209
  }
@@ -223,7 +223,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
223
223
 
224
224
  return (
225
225
  <>
226
- <ContainerSafeAreaView
226
+ <ContainerSafeAreaView
227
227
  style={{ flex: 1 }}
228
228
  isOpenFiltProducts={isOpenFiltProducts}
229
229
  >
@@ -237,7 +237,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
237
237
  imgRightSrc={null}
238
238
  style={styles.btnBackArrow}
239
239
  onClick={() => handleBackNavigation()}
240
- imgLeftStyle={{ tintColor: theme.colors.textNormal, width: 16 }}
240
+ imgLeftStyle={{ tintColor: theme.colors.textNormal, width: 30 }}
241
241
  />
242
242
  </View>
243
243
  {!errorQuantityProducts && (
@@ -255,6 +255,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
255
255
  {isOpenSearchBar && (
256
256
  <WrapSearchBar>
257
257
  <SearchBar
258
+ autoFocus
258
259
  onSearch={handleChangeSearch}
259
260
  onCancel={() => handleCancel()}
260
261
  isCancelXButtonShow
@@ -268,42 +269,42 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
268
269
  </Animated.View>
269
270
 
270
271
  {business?.categories?.length > 0 && isOpenFiltProducts && (
271
- <FiltProductsContainer
272
- isIos={Platform.OS === 'ios'}
273
- style={{
274
- height: Dimensions.get('window').height - filtProductsHeight
275
- }}
276
- >
277
- <View style={{ padding: 20, backgroundColor: theme.colors.white }}>
278
- <BusinessProductsList
279
- categories={[
280
- { id: null, name: t('ALL', 'All') },
281
- { id: 'featured', name: t('FEATURED', 'Featured') },
282
- ...business?.categories.sort((a: any, b: any) => a.rank - b.rank)
283
- ]}
284
- category={categorySelected}
285
- categoryState={categoryState}
286
- businessId={business.id}
287
- errors={errors}
288
- onProductClick={onProductClick}
289
- handleSearchRedirect={handleSearchRedirect}
290
- featured={featuredProducts}
291
- searchValue={searchValue}
292
- handleClearSearch={handleChangeSearch}
293
- errorQuantityProducts={errorQuantityProducts}
294
- handleCancelSearch={handleCancel}
295
- categoriesLayout={categoriesLayout}
296
- subcategoriesSelected={subcategoriesSelected}
297
- lazyLoadProductsRecommended={business?.lazy_load_products_recommended}
298
- setCategoriesLayout={setCategoriesLayout}
299
- currentCart={currentCart}
300
- setSubcategoriesSelected={setSubcategoriesSelected}
301
- onClickCategory={handleChangeCategory}
302
- handleUpdateProducts={handleUpdateProducts}
303
- isFiltMode
304
- />
305
- </View>
306
- </FiltProductsContainer>
272
+ <FiltProductsContainer
273
+ isIos={Platform.OS === 'ios'}
274
+ style={{
275
+ height: Dimensions.get('window').height - filtProductsHeight
276
+ }}
277
+ >
278
+ <View style={{ padding: 20, backgroundColor: theme.colors.white }}>
279
+ <BusinessProductsList
280
+ categories={[
281
+ { id: null, name: t('ALL', 'All') },
282
+ { id: 'featured', name: t('FEATURED', 'Featured') },
283
+ ...business?.categories.sort((a: any, b: any) => a.rank - b.rank)
284
+ ]}
285
+ category={categorySelected}
286
+ categoryState={categoryState}
287
+ businessId={business.id}
288
+ errors={errors}
289
+ onProductClick={onProductClick}
290
+ handleSearchRedirect={handleSearchRedirect}
291
+ featured={featuredProducts}
292
+ searchValue={searchValue}
293
+ handleClearSearch={handleChangeSearch}
294
+ errorQuantityProducts={errorQuantityProducts}
295
+ handleCancelSearch={handleCancel}
296
+ categoriesLayout={categoriesLayout}
297
+ subcategoriesSelected={subcategoriesSelected}
298
+ lazyLoadProductsRecommended={business?.lazy_load_products_recommended}
299
+ setCategoriesLayout={setCategoriesLayout}
300
+ currentCart={currentCart}
301
+ setSubcategoriesSelected={setSubcategoriesSelected}
302
+ onClickCategory={handleChangeCategory}
303
+ handleUpdateProducts={handleUpdateProducts}
304
+ isFiltMode
305
+ />
306
+ </View>
307
+ </FiltProductsContainer>
307
308
  )}
308
309
  {isOpenFiltProducts && (
309
310
  <BackgroundGray />
@@ -370,7 +370,7 @@ export const ProductOptionsUI = (props: any) => {
370
370
  <SafeAreaView style={{ flex: 1 }}>
371
371
  <TopHeader>
372
372
  <TopActions onPress={() => handleGoBack()}>
373
- <OIcon src={theme.images.general.arrow_left} width={15} />
373
+ <OIcon src={theme.images.general.arrow_left} width={30} />
374
374
  </TopActions>
375
375
  </TopHeader>
376
376
  <ScrollView ref={scrollViewRef}>
@@ -25,7 +25,8 @@ export const SearchBar = (props: any) => {
25
25
  blurOnSubmit,
26
26
  inputContainerStyles,
27
27
  containerStyles,
28
- hideIcon
28
+ hideIcon,
29
+ autoFocus
29
30
  } = props
30
31
 
31
32
  const theme = useTheme();
@@ -82,15 +83,16 @@ export const SearchBar = (props: any) => {
82
83
  return (
83
84
  <Pressable style={[styles.container, containerStyles, { height: height }]}>
84
85
  <OInput
86
+ autoFocus={autoFocus}
85
87
  value={searchValue}
86
88
  onChange={onChangeSearch}
87
- style={{...styles.inputStyle, ...inputContainerStyles}}
89
+ style={{ ...styles.inputStyle, ...inputContainerStyles }}
88
90
  placeholder={placeholder}
89
91
  icon={!hideIcon && theme.images.general.search}
90
92
  isDisabled={isDisabled}
91
93
  iconStyle={{ width: 12 }}
92
94
  returnKeyType='done'
93
- inputStyle={{padding: 0, paddingTop: Platform.OS == 'android' ? 2 : 0, ...inputStyle}}
95
+ inputStyle={{ padding: 0, paddingTop: Platform.OS == 'android' ? 2 : 0, ...inputStyle }}
94
96
  onPress={() => onPress && onPress()}
95
97
  iconCustomRight={iconCustomRight}
96
98
  onSubmitEditing={() => onSubmitEditing && onSubmitEditing()}
@@ -271,16 +271,16 @@ const ProfileUI = (props: ProfileParams) => {
271
271
  }, [verifyPhoneState])
272
272
 
273
273
  const handleSendPhoneCode = (values: any) => {
274
- setWillVerifyOtpState(false)
274
+ setWillVerifyOtpState(false)
275
275
  setIsModalVisible(false)
276
- setFormState({
277
- ...formState,
278
- changes: {
279
- ...formState?.changes,
280
- verification_code: values?.code
281
- }
282
- })
283
- }
276
+ setFormState({
277
+ ...formState,
278
+ changes: {
279
+ ...formState?.changes,
280
+ verification_code: values?.code
281
+ }
282
+ })
283
+ }
284
284
 
285
285
  return (
286
286
  <>
@@ -289,7 +289,7 @@ const ProfileUI = (props: ProfileParams) => {
289
289
  titleAlign={'center'}
290
290
  onActionLeft={() => navigation.goBack()}
291
291
  showCall={false}
292
- style={{ paddingHorizontal: 40, paddingVertical: Platform.OS === 'ios' ? 0 : 30 , marginTop: Platform.OS === 'ios' ? 50 : 40 }}
292
+ style={{ paddingHorizontal: 40, paddingVertical: Platform.OS === 'ios' ? 0 : 30 }}
293
293
  />
294
294
  <KeyboardAvoidingView behavior={Platform.OS == 'ios' ? 'padding' : 'height'} enabled style={{ flex: 1, flexDirection: 'column', justifyContent: 'center' }}>
295
295
  <Container noPadding>
@@ -56,7 +56,7 @@ const Wrapper = styled.Pressable`
56
56
  const OInput = (props: Props): React.ReactElement => {
57
57
  return (
58
58
  <Wrapper
59
- onPress={() => {props.forwardRef?.current?.focus?.(); props.onPress && props.onPress()}}
59
+ onPress={() => { props.forwardRef?.current?.focus?.(); props.onPress && props.onPress() }}
60
60
  style={{
61
61
  backgroundColor: props.bgColor,
62
62
  borderColor: props.borderColor,
@@ -75,6 +75,7 @@ const OInput = (props: Props): React.ReactElement => {
75
75
  <MaterialIcon name={props?.vertorIcon} size={20} color={props?.vectorIconColor} style={{ marginHorizontal: 10 }} />
76
76
  )}
77
77
  <Input
78
+ autoFocus={props?.autoFocus}
78
79
  name={props.name}
79
80
  secureTextEntry={props.isSecured}
80
81
  onChangeText={(txt: any) => props.name ? props.onChange({ target: { name: props.name, value: txt } }) : props.onChange(txt)}
@@ -90,7 +91,7 @@ const OInput = (props: Props): React.ReactElement => {
90
91
  returnKeyType={props.returnKeyType}
91
92
  onSubmitEditing={props.onSubmitEditing}
92
93
  blurOnSubmit={props.blurOnSubmit}
93
- ref={(e : any) => {
94
+ ref={(e: any) => {
94
95
  props.forwardRef && (props.forwardRef.current = e)
95
96
  }}
96
97
  style={props?.inputStyle}