ordering-ui-react-native 0.17.80 → 0.17.81

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.80",
3
+ "version": "0.17.81",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useEffect, useRef, useState } from 'react'
2
- import { View, TouchableOpacity, StyleSheet, SafeAreaView, Dimensions, Platform, KeyboardAvoidingViewBase, KeyboardAvoidingView } from 'react-native'
2
+ import { View, TouchableOpacity, StyleSheet, SafeAreaView, Dimensions, Platform, KeyboardAvoidingViewBase, KeyboardAvoidingView, Vibration } from 'react-native'
3
3
  import { IOScrollView } from 'react-native-intersection-observer'
4
4
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
5
5
  import { useTheme } from 'styled-components/native';
@@ -156,6 +156,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
156
156
  code: isProductAddedToCart?.code,
157
157
  quantity: productQuantity + 1
158
158
  }
159
+ Vibration.vibrate()
159
160
  const cartData = currentCart?.business_id ? currentCart : { business_id: business.id }
160
161
  if (isProductAddedToCart) {
161
162
  await updateProduct(updateCurrentProduct, cartData, isQuickAddProduct)
@@ -308,7 +308,7 @@ const CheckoutUI = (props: any) => {
308
308
  titleAlign={'center'}
309
309
  onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
310
310
  showCall={false}
311
- btnStyle={{ paddingLeft: 0 }}
311
+ btnStyle={{ paddingLeft: 0, paddingTop: Platform.OS == 'ios' ? 0 : 2 }}
312
312
  titleWrapStyle={{ paddingHorizontal: 0 }}
313
313
  titleStyle={{ marginRight: 0, marginLeft: 0 }}
314
314
  />
@@ -578,7 +578,7 @@ const CheckoutUI = (props: any) => {
578
578
  cart={cart}
579
579
  isDisabled={cart?.status === 2}
580
580
  businessId={!isGiftCardCart ? businessDetails?.business?.id : -1}
581
- isLoading={!isGiftCardCart ? businessDetails.loading : false}
581
+ isLoading={!isGiftCardCart ? businessDetails.loading : false}
582
582
  paymethods={businessDetails?.business?.paymethods}
583
583
  onPaymentChange={handlePaymethodChange}
584
584
  errorCash={errorCash}
@@ -36,7 +36,7 @@ export const Favorite = (props: any) => {
36
36
 
37
37
  return (
38
38
  <Container
39
- pdng={Platform.OS === 'ios' ? '20px' : '30px'}
39
+ pdng={Platform.OS === 'ios' ? '10px' : '20px'}
40
40
  >
41
41
  <NavBar
42
42
  title={t('FAVORITE', 'Favorite')}
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import { RefreshControl } from 'react-native'
2
+ import { Platform, RefreshControl } from 'react-native'
3
3
  import { HelpParams } from '../../types'
4
4
  import { useLanguage } from 'ordering-components/native'
5
5
  import NavBar from '../NavBar'
@@ -31,7 +31,7 @@ export const Help = (props: HelpParams) => {
31
31
 
32
32
  return (
33
33
  <Container
34
- pt={10}
34
+ pt={Platform.OS === 'ios' ? 20 : 10}
35
35
  noPadding
36
36
  refreshControl={
37
37
  <RefreshControl
@@ -3,7 +3,7 @@ import { useLanguage } from 'ordering-components/native'
3
3
  import { HelpGuideParams } from '../../types'
4
4
  import { OText, OIcon } from '../shared'
5
5
  import { useTheme } from 'styled-components/native'
6
- import { StyleSheet } from 'react-native'
6
+ import { Platform, StyleSheet } from 'react-native'
7
7
  import NavBar from '../NavBar'
8
8
  import {
9
9
  Content,
@@ -37,7 +37,7 @@ export const HelpGuide = (props: HelpGuideParams) => {
37
37
  const goToBack = () => navigation?.canGoBack() && navigation.goBack()
38
38
 
39
39
  return (
40
- <Container>
40
+ <Container pdng={Platform.OS === 'ios' ? '10px' : '0px'}>
41
41
  <NavBar
42
42
  title={t('GUIDE_TO_ORDERING', 'Guide to Ordering')}
43
43
  onActionLeft={goToBack}
@@ -8,4 +8,5 @@ export const Container = styled.ScrollView`
8
8
  position: relative;
9
9
  flex: 1;
10
10
  margin: 10px 0;
11
+ padding-top: ${(props: any) => props.pdng}
11
12
  `
@@ -51,6 +51,7 @@ import { ScrollView } from 'react-native-gesture-handler';
51
51
  import { ProductOptionSubOption } from '../ProductOptionSubOption';
52
52
  import { NotFoundSource } from '../NotFoundSource';
53
53
  import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
54
+ import NavBar from '../NavBar';
54
55
  const windowWidth = Dimensions.get('window').width;
55
56
 
56
57
  export const ProductOptionsUI = (props: any) => {
@@ -166,6 +167,11 @@ export const ProductOptionsUI = (props: any) => {
166
167
  justifyContent: 'space-between',
167
168
  width: '100%',
168
169
  marginTop: 10
170
+ },
171
+ wrapperNavbar: {
172
+ paddingVertical: 0,
173
+ paddingHorizontal: 40,
174
+ marginVertical: 2
169
175
  }
170
176
  });
171
177
 
@@ -208,7 +214,7 @@ export const ProductOptionsUI = (props: any) => {
208
214
  };
209
215
 
210
216
  const handleSaveProduct = () => {
211
- Vibration.vibrate()
217
+ Vibration.vibrate()
212
218
  if (!productCart.quantity) {
213
219
  showToast(ToastType.Error, t('VALIDATION_ERROR_REQUIRED', 'The quantity field is required').replace('_attribute_', t('PRODUCT_POTIONS_QUANTITY', 'Quantity')))
214
220
  return
@@ -483,14 +489,17 @@ export const ProductOptionsUI = (props: any) => {
483
489
  }
484
490
  }, [])
485
491
 
486
-
487
492
  return (
488
493
  <SafeAreaView style={{ flex: 1 }}>
489
- <TopHeader>
490
- <TopActions onPress={() => handleGoBack()}>
491
- <OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
492
- </TopActions>
493
- </TopHeader>
494
+ <View style={styles.wrapperNavbar}>
495
+ <NavBar
496
+ onActionLeft={() => handleGoBack()}
497
+ showCall={false}
498
+ btnStyle={{ paddingLeft: 0, paddingTop: Platform.OS == 'ios' ? 0 : 2 }}
499
+ titleWrapStyle={{ paddingHorizontal: 0 }}
500
+ titleStyle={{ marginRight: 0, marginLeft: 0 }}
501
+ />
502
+ </View>
494
503
  {!error && (
495
504
  <ScrollView
496
505
  ref={scrollViewRef}
@@ -32,7 +32,7 @@ export const ProductOptionSubOptionUI = (props: any) => {
32
32
  setIsScrollAvailable
33
33
  } = props
34
34
 
35
- const disableIncrement = option?.limit_suboptions_by_max ? balance === option?.max : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
35
+ const disableIncrement = option?.limit_suboptions_by_max ? balance === option?.max || state.quantity === suboption?.max : state.quantity === suboption?.max || (!state.selected && balance === option?.max)
36
36
  const price = option?.with_half_option && suboption?.half_price && state.position !== 'whole' ? suboption?.half_price : suboption?.price
37
37
 
38
38
  const theme = useTheme();
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import { View, TouchableOpacity } from 'react-native'
2
+ import { View, TouchableOpacity, Platform } from 'react-native'
3
3
  import { useLanguage, useSession, useUtils, Sessions as SessionsController } from 'ordering-components/native'
4
4
  import NavBar from '../NavBar'
5
5
  import { SessionsParams } from '../../types'
@@ -12,7 +12,8 @@ import AntIcon from 'react-native-vector-icons/AntDesign'
12
12
  import {
13
13
  SessionsWrapper,
14
14
  SessionItem,
15
- DurationWrapper
15
+ DurationWrapper,
16
+ Container
16
17
  } from './styles'
17
18
 
18
19
  export const SessionsUI = (props: SessionsParams) => {
@@ -27,7 +28,7 @@ export const SessionsUI = (props: SessionsParams) => {
27
28
  const [, t] = useLanguage()
28
29
  const [{ user }] = useSession()
29
30
  const [{ parseDate }] = useUtils()
30
- const theme = useTheme()
31
+ const theme = useTheme()
31
32
  const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
32
33
  const goToBack = () => navigation?.canGoBack() && navigation.goBack()
33
34
 
@@ -61,7 +62,9 @@ export const SessionsUI = (props: SessionsParams) => {
61
62
  }
62
63
 
63
64
  return (
64
- <>
65
+ <Container
66
+ pdng={Platform.OS === 'ios' ? '10px' : '0'}
67
+ >
65
68
  <NavBar
66
69
  title={t('SESSIONS', 'Sessions')}
67
70
  titleAlign={'center'}
@@ -77,11 +80,11 @@ export const SessionsUI = (props: SessionsParams) => {
77
80
  <SessionItem key={i}>
78
81
  <Placeholder Animation={Fade}>
79
82
  <View style={{ flexDirection: 'row', alignItems: 'center' }}>
80
- <View style={{ flex: 1}}>
83
+ <View style={{ flex: 1 }}>
81
84
  <PlaceholderLine width={40} />
82
85
  <PlaceholderLine width={40} />
83
86
  </View>
84
- <PlaceholderLine width={5}/>
87
+ <PlaceholderLine width={5} />
85
88
  </View>
86
89
  </Placeholder>
87
90
  </SessionItem>
@@ -120,7 +123,7 @@ export const SessionsUI = (props: SessionsParams) => {
120
123
  style={{ borderRadius: 7.6, marginTop: 20 }}
121
124
  />
122
125
  </SessionsWrapper>
123
- ) : (
126
+ ) : (
124
127
  <OText>{t('YOU_DONT_HAVE_ANY_SESSIONS', 'You don\'t have any sessions')}</OText>
125
128
  )
126
129
  )}
@@ -147,7 +150,7 @@ export const SessionsUI = (props: SessionsParams) => {
147
150
  onCancel={() => setConfirm({ ...confirm, open: false, title: null })}
148
151
  onClose={() => setConfirm({ ...confirm, open: false, title: null })}
149
152
  />
150
- </>
153
+ </Container>
151
154
  )
152
155
  }
153
156
 
@@ -13,3 +13,7 @@ export const SessionItem = styled.View`
13
13
  export const DurationWrapper = styled.View`
14
14
  /* flex-direction: row; */
15
15
  `
16
+
17
+ export const Container = styled.View`
18
+ padding-top: ${(props: any) => props.pdng};
19
+ `
@@ -84,9 +84,13 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
84
84
  marginRight: 2,
85
85
  },
86
86
  reorderLoading: {
87
- width: 80,
88
- height: 40,
89
- borderRadius: 10,
87
+ height: 23,
88
+ paddingLeft: 20,
89
+ paddingRight: 20,
90
+ borderRadius: 23,
91
+ shadowOpacity: 0,
92
+ backgroundColor: theme.colors.primary,
93
+ borderWidth: 0,
90
94
  },
91
95
  reorderbutton: {
92
96
  height: 23,
@@ -183,8 +187,6 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
183
187
 
184
188
  const handleOriginalReorder = () => {
185
189
  setConfirm({ ...confirm, open: false, title: null })
186
- setReorderSelected(order?.id);
187
- handleReorder && handleReorder(order?.id);
188
190
  }
189
191
 
190
192
  return (
@@ -21,7 +21,6 @@ import {
21
21
  import { OrderSummary } from '../OrderSummary';
22
22
  import { ScrollView } from 'react-native-gesture-handler';
23
23
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
24
- import AntDesignIcon from 'react-native-vector-icons/AntDesign'
25
24
 
26
25
  const UpsellingProductsUI = (props: UpsellingProductsParams) => {
27
26
  const {
@@ -166,17 +165,10 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
166
165
  const UpsellingContent = () => {
167
166
  return (
168
167
  <>
169
- <View style={{ ...styles.headerItem, flex: 1, marginTop: Platform.OS == 'ios' ? 35 : 70 }}>
170
- <OButton
171
- imgRightSrc={null}
172
- style={styles.btnBackArrow}
173
- onClick={() => onGoBack()}
174
- icon={AntDesignIcon}
175
- iconProps={{
176
- name: 'arrowleft',
177
- size: 26
178
- }}
179
- />
168
+ <View style={{ ...styles.headerItem, flex: 1, marginTop: Platform.OS == 'ios' ? 35 : 14 }}>
169
+ <TouchableOpacity onPress={() => onGoBack()} style={styles.btnBackArrow}>
170
+ <OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
171
+ </TouchableOpacity>
180
172
  </View>
181
173
  <ScrollView style={{ marginTop: 10, marginBottom: props.isPage ? 40 : bottom + (Platform.OS == 'ios' ? 96 : 130) }} showsVerticalScrollIndicator={false}>
182
174
  {productsList.length > 0 &&
@@ -278,7 +278,9 @@ const ProfileUI = (props: ProfileParams) => {
278
278
 
279
279
  return (
280
280
  <>
281
- <Container>
281
+ <Container
282
+ pdng={Platform.OS === 'ios' ? '20px' : '10px'}
283
+ >
282
284
  <NavBar
283
285
  title={t('ACCOUNT', 'Account')}
284
286
  titleAlign={'center'}
@@ -12,7 +12,7 @@ export const UserData = styled.View`
12
12
  export const Container = styled.ScrollView`
13
13
  position: relative;
14
14
  flex: 1;
15
- paddingTop: 20px;
15
+ padding-top: ${(props: any) => props.pdng};
16
16
  margin-bottom: 40px;
17
17
  `
18
18