ordering-ui-react-native 0.20.9-release → 0.21.0-release

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.20.9-release",
3
+ "version": "0.21.0-release",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -3,7 +3,6 @@ import { useLanguage, useConfig, useOrder } from 'ordering-components/native'
3
3
  import { useGooglePay, useApplePay } from '@stripe/stripe-react-native'
4
4
  import { Platform } from 'react-native';
5
5
  import { StripeMethodFormParams } from '../../types';
6
- import { android_app_id } from '../../config.json'
7
6
 
8
7
  export const StripeMethodForm = (props: StripeMethodFormParams) => {
9
8
  const {
@@ -17,7 +16,8 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
17
16
  placeByMethodPay,
18
17
  methodPaySupported,
19
18
  setPlaceByMethodPay,
20
- cartTotal
19
+ cartTotal,
20
+ androidAppId
21
21
  } = props
22
22
  const { initGooglePay, createGooglePayPaymentMethod, loading } = useGooglePay();
23
23
  const { presentApplePay, isApplePaySupported } = useApplePay();
@@ -61,7 +61,7 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
61
61
  })
62
62
  const { error } = await initGooglePay({
63
63
  testEnv: devMode,
64
- merchantName: android_app_id,
64
+ merchantName: androidAppId,
65
65
  countryCode: 'US',
66
66
  billingAddressConfig: {
67
67
  format: 'FULL',
@@ -494,5 +494,6 @@ export interface StripeMethodFormParams {
494
494
  placeByMethodPay?: any
495
495
  methodPaySupported?: any,
496
496
  setPlaceByMethodPay?: any,
497
- cartTotal?: number
497
+ cartTotal?: number,
498
+ androidAppId?: string
498
499
  }
@@ -35,7 +35,12 @@ import FastImage from 'react-native-fast-image'
35
35
  import { LottieAnimation } from '../LottieAnimation';
36
36
  import { CardAnimation } from '../shared/CardAnimation';
37
37
 
38
- export const BusinessControllerUI = (props: BusinessControllerParams) => {
38
+ function BusinessControllerPropsAreEqual (prevProps: any, nextProps: any) {
39
+ return JSON.stringify(prevProps.business) === JSON.stringify(nextProps.business) &&
40
+ prevProps.isBusinessOpen === nextProps.isBusinessOpen
41
+ }
42
+
43
+ export const BusinessControllerUI = React.memo((props: BusinessControllerParams) => {
39
44
  const {
40
45
  business,
41
46
  handleClick,
@@ -184,7 +189,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
184
189
  }
185
190
 
186
191
  return (
187
- <InView style={{ minHeight: 200 }} triggerOnce={true} onChange={(inView: boolean) => handleChangeInterSection(inView)}>
192
+ <View style={{ minHeight: 200 }}>
188
193
  {isIntersectionObserver ? (
189
194
  <CardAnimation
190
195
  style={[style, styles.container]}
@@ -376,9 +381,9 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
376
381
  </View>
377
382
  </Placeholder>
378
383
  )}
379
- </InView>
384
+ </View>
380
385
  );
381
- };
386
+ }, BusinessControllerPropsAreEqual);
382
387
 
383
388
  export const BusinessController = (props: BusinessControllerParams) => {
384
389
  const BusinessControllerProps = {
@@ -102,6 +102,7 @@ const CheckoutUI = (props: any) => {
102
102
  merchantId,
103
103
  setPlaceSpotNumber,
104
104
  maxDate,
105
+ androidAppId,
105
106
  urlscheme
106
107
  } = props
107
108
 
@@ -819,6 +820,7 @@ const CheckoutUI = (props: any) => {
819
820
  handlePlaceOrder={handlePlaceOrder}
820
821
  merchantId={merchantId}
821
822
  urlscheme={urlscheme}
823
+ androidAppId={androidAppId}
822
824
  setMethodPaySupported={setMethodPaySupported}
823
825
  methodPaySupported={methodPaySupported}
824
826
  placeByMethodPay={placeByMethodPay}
@@ -9,6 +9,7 @@ import { ScrollView } from 'react-native-gesture-handler';
9
9
  import { Tab } from './styles'
10
10
  import { useTheme } from 'styled-components/native';
11
11
  import { Container } from '../../layouts/Container';
12
+ import NavBar from '../NavBar'
12
13
 
13
14
  export const MyOrders = (props: any) => {
14
15
  const {
@@ -92,29 +93,15 @@ export const MyOrders = (props: any) => {
92
93
  ...props.titleStyle
93
94
  }}>
94
95
  {!props.hideBackBtn && (!isChewLayout || (isChewLayout && hideOrdersTheme)) && (
95
- <OButton
96
- imgLeftStyle={{ width: 18 }}
97
- imgRightSrc={null}
98
- style={{
99
- borderWidth: 0,
100
- width: 26,
101
- height: 26,
102
- backgroundColor: '#FFF',
103
- borderColor: '#FFF',
104
- shadowColor: '#FFF',
105
- paddingLeft: 0,
106
- paddingRight: 0,
107
- marginTop: 30,
108
- }}
109
- onClick={goToBack}
110
- icon={AntDesignIcon}
111
- iconProps={{
112
- name: 'arrowleft',
113
- size: 26
114
- }}
96
+ <NavBar
97
+ title={t('MY_ORDERS', 'My Orders')}
98
+ titleAlign={'center'}
99
+ onActionLeft={goToBack}
100
+ showCall={false}
101
+ paddingTop={30}
102
+ btnStyle={{ paddingLeft: 0 }}
115
103
  />
116
104
  )}
117
- <HeaderTitle ph={10} text={t('MY_ORDERS', 'My Orders')} />
118
105
  </View>
119
106
  )}
120
107
  {!hideOrders && !isChewLayout && !showNavbar && (
@@ -124,7 +111,7 @@ export const MyOrders = (props: any) => {
124
111
  <ScrollView
125
112
  horizontal
126
113
  style={{ ...styles.container, borderBottomWidth: 1 }}
127
- contentContainerStyle={{ paddingHorizontal: !!businessesSearchList ? 0 : 20 }}
114
+ contentContainerStyle={{ paddingHorizontal: !!businessesSearchList ? 0 : 20 }}
128
115
  showsHorizontalScrollIndicator={false}
129
116
  scrollEventThrottle={16}
130
117
  >
@@ -148,7 +135,7 @@ export const MyOrders = (props: any) => {
148
135
  )}
149
136
  {selectedOption === 'orders' && (
150
137
  <>
151
- <View style={{ paddingHorizontal: 20 }}>
138
+ <View style={{ paddingHorizontal: 20 }}>
152
139
  <OrdersOption
153
140
  {...props}
154
141
  preOrders
@@ -23,6 +23,7 @@ import {
23
23
  OrderProgressWrapper
24
24
  } from './styles'
25
25
  import { getOrderStatuPickUp, getOrderStatus } from '../../utils'
26
+ import DeviceInfo from 'react-native-device-info'
26
27
 
27
28
  const OrderProgressUI = (props: any) => {
28
29
  const {
@@ -56,7 +57,9 @@ const OrderProgressUI = (props: any) => {
56
57
  shadowColor: '#000',
57
58
  shadowOpacity: 0.2,
58
59
  shadowRadius: 2,
59
- elevation: 3
60
+ elevation: 3,
61
+ borderWidth: 1,
62
+ borderColor: 'rgba(0,0,0,0.1)'
60
63
  },
61
64
  logoWrapper: {
62
65
  overflow: 'hidden',
@@ -75,7 +75,8 @@ const PaymentOptionsUI = (props: any) => {
75
75
  requiredFields,
76
76
  openUserModal,
77
77
  paymethodClicked,
78
- setPaymethodClicked
78
+ setPaymethodClicked,
79
+ androidAppId
79
80
  } = props
80
81
 
81
82
  const theme = useTheme();
@@ -362,6 +363,7 @@ const PaymentOptionsUI = (props: any) => {
362
363
  onCancel={() => handlePaymethodClick(null)}
363
364
  merchantId={merchantId}
364
365
  urlscheme={urlscheme}
366
+ androidAppId={androidAppId}
365
367
  setMethodPaySupported={setMethodPaySupported}
366
368
  methodPaySupported={methodPaySupported}
367
369
  placeByMethodPay={placeByMethodPay}
@@ -410,6 +412,7 @@ const PaymentOptionsUI = (props: any) => {
410
412
  onCancel={() => handlePaymethodClick(null)}
411
413
  merchantId={merchantId}
412
414
  urlscheme={urlscheme}
415
+ androidAppId={androidAppId}
413
416
  publicKeyAddCard={isOpenMethod?.paymethod?.credentials?.stripe?.publishable}
414
417
  />
415
418
  </KeyboardAvoidingView>
@@ -35,7 +35,8 @@ const StripeElementsFormUI = (props: any) => {
35
35
  setPlaceByMethodPay,
36
36
  cartTotal,
37
37
  publicKeyAddCard,
38
- urlScheme
38
+ urlScheme,
39
+ androidAppId
39
40
  } = props;
40
41
 
41
42
  const theme = useTheme();
@@ -220,6 +221,7 @@ const StripeElementsFormUI = (props: any) => {
220
221
  placeByMethodPay={placeByMethodPay}
221
222
  methodPaySupported={methodPaySupported}
222
223
  setPlaceByMethodPay={setPlaceByMethodPay}
224
+ androidAppId={androidAppId}
223
225
  />
224
226
  ) : (
225
227
  <CardField