ordering-ui-react-native 0.17.16 → 0.17.18

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.17.16",
3
+ "version": "0.17.18",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -1,6 +1,7 @@
1
1
  import React, { useCallback, useEffect, useRef, useState } from 'react'
2
2
  import { View, TouchableOpacity, StyleSheet, SafeAreaView, Dimensions, Platform, KeyboardAvoidingViewBase, KeyboardAvoidingView } from 'react-native'
3
3
  import { IOScrollView } from 'react-native-intersection-observer'
4
+ import { useSafeAreaInsets } from 'react-native-safe-area-context'
4
5
  import { useTheme } from 'styled-components/native';
5
6
  import {
6
7
  BusinessAndProductList,
@@ -68,6 +69,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
68
69
  onBusinessClick
69
70
  } = props
70
71
 
72
+ const insets = useSafeAreaInsets()
71
73
  const theme = useTheme();
72
74
  const [, t] = useLanguage()
73
75
  const [{ auth }] = useSession()
@@ -245,12 +247,13 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
245
247
 
246
248
  return (
247
249
  <>
248
- <ContainerSafeAreaView
249
- style={{ flex: 1 }}
250
- isOpenFiltProducts={isOpenFiltProducts}
251
- >
250
+ <View style={{ flex: 1 }}>
252
251
  <Animated.View style={{ position: 'relative' }}>
253
- <TopHeader isIos={Platform.OS === 'ios'}>
252
+ <TopHeader
253
+ style={{
254
+ marginTop: Platform.OS === 'ios' ? insets.top : '40px'
255
+ }}
256
+ >
254
257
  {!isOpenSearchBar && (
255
258
  <>
256
259
  <TopActions onPress={() => handleBackNavigation()}>
@@ -512,7 +515,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
512
515
  onAccept={() => setAlertState({ open: false, content: [] })}
513
516
  onClose={() => setAlertState({ open: false, content: [] })}
514
517
  />
515
- </ContainerSafeAreaView>
518
+ </View>
516
519
  <OModal
517
520
  open={openService}
518
521
  onClose={() => setOpenService(false)}
@@ -1,8 +1,5 @@
1
1
  import styled, { css } from 'styled-components/native'
2
2
 
3
- export const ContainerSafeAreaView = styled.SafeAreaView`
4
- `
5
-
6
3
  export const WrapHeader = styled.View`
7
4
  position: relative;
8
5
  `
@@ -14,7 +11,6 @@ export const TopHeader = styled.View`
14
11
  z-index: 1;
15
12
  height: 60px;
16
13
  min-height: 60px;
17
- margin-top: ${(props : any) => props.isIos ? '0' : '40px'};
18
14
  `
19
15
  export const AddressInput = styled.TouchableOpacity`
20
16
  flex: 1;
@@ -28,46 +28,48 @@ export const OrderItAgain = (props: OrderItAgainParams) => {
28
28
  const { width } = Dimensions.get('window');
29
29
  const productsFilterd = productList?.length > 0 && productList?.sort((a: any, b:any) => moment(b?.last_ordered_date).valueOf() - moment(a?.last_ordered_date).valueOf()).filter((product : any) => product?.name?.toLowerCase()?.includes(searchValue?.toLowerCase()))
30
30
  return (
31
- <Container hide={productsFilterd?.length === 0}>
32
- <OText
33
- size={16}
34
- lineHeight={24}
35
- color={theme.colors.textNormal}
36
- style={{
37
- fontWeight: '600',
38
- marginBottom: 6
39
- }}
40
- >
41
- {t('ORDER_IT_AGAIN', 'Order it again')}
42
- </OText>
43
- <OText
44
- size={12}
45
- lineHeight={18}
46
- color={theme.colors.disabled}
47
- >
48
- {t('ORDER_IT_AGAIN_DESC', 'Quickly add items from your past orders.')}
49
- </OText>
50
- <ScrollView
51
- horizontal
52
- showsVerticalScrollIndicator={false}
53
- showsHorizontalScrollIndicator={false}
54
- >
55
- {productsFilterd.map((product: any, i: number) => (
56
- <ProductWrapper key={'prod_' + product.id + `_${i}`} style={{ width: width - 120, }}>
57
- <SingleProductCard
58
- isSoldOut={product.inventoried && !product.quantity}
59
- product={product}
60
- businessId={businessId}
61
- categoryState={categoryState}
62
- onProductClick={() => onProductClick(product)}
63
- productAddedToCartLength={currentCart?.products?.reduce((productsLength: number, Cproduct: any) => { return productsLength + (Cproduct?.id === product?.id ? Cproduct?.quantity : 0) }, 0)}
64
- handleUpdateProducts={handleUpdateProducts}
65
- navigation={navigation}
66
- isPreviously
67
- />
68
- </ProductWrapper>
69
- ))}
70
- </ScrollView>
71
- </Container>
31
+ productsFilterd?.length > 0 ? (
32
+ <Container>
33
+ <OText
34
+ size={16}
35
+ lineHeight={24}
36
+ color={theme.colors.textNormal}
37
+ style={{
38
+ fontWeight: '600',
39
+ marginBottom: 6
40
+ }}
41
+ >
42
+ {t('ORDER_IT_AGAIN', 'Order it again')}
43
+ </OText>
44
+ <OText
45
+ size={12}
46
+ lineHeight={18}
47
+ color={theme.colors.disabled}
48
+ >
49
+ {t('ORDER_IT_AGAIN_DESC', 'Quickly add items from your past orders.')}
50
+ </OText>
51
+ <ScrollView
52
+ horizontal
53
+ showsVerticalScrollIndicator={false}
54
+ showsHorizontalScrollIndicator={false}
55
+ >
56
+ {productsFilterd.map((product: any, i: number) => (
57
+ <ProductWrapper key={'prod_' + product.id + `_${i}`} style={{ width: width - 120, }}>
58
+ <SingleProductCard
59
+ isSoldOut={product.inventoried && !product.quantity}
60
+ product={product}
61
+ businessId={businessId}
62
+ categoryState={categoryState}
63
+ onProductClick={() => onProductClick(product)}
64
+ productAddedToCartLength={currentCart?.products?.reduce((productsLength: number, Cproduct: any) => { return productsLength + (Cproduct?.id === product?.id ? Cproduct?.quantity : 0) }, 0)}
65
+ handleUpdateProducts={handleUpdateProducts}
66
+ navigation={navigation}
67
+ isPreviously
68
+ />
69
+ </ProductWrapper>
70
+ ))}
71
+ </ScrollView>
72
+ </Container>
73
+ ) : null
72
74
  )
73
75
  }
@@ -72,9 +72,15 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
72
72
  },
73
73
  btnBackArrow: {
74
74
  borderWidth: 0,
75
+ width: 26,
76
+ height: 26,
75
77
  backgroundColor: theme.colors.clear,
78
+ borderColor: theme.colors.clear,
76
79
  shadowColor: theme.colors.clear,
77
- padding: 40,
80
+ paddingLeft: 0,
81
+ paddingRight: 0,
82
+ marginLeft: 20,
83
+ marginBottom: 10
78
84
  },
79
85
  })
80
86