ordering-ui-react-native 0.17.39 → 0.17.41

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.39",
3
+ "version": "0.17.41",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -120,8 +120,7 @@
120
120
  "styled-components": "^5.1.1",
121
121
  "styled-system": "^5.1.5",
122
122
  "toggle-react-native": "^1.1.2",
123
- "toggle-switch-react-native": "^3.2.0",
124
- "lottie-react-native": "4.1.3"
123
+ "toggle-switch-react-native": "^3.2.0"
125
124
  },
126
125
  "devDependencies": {
127
126
  "@babel/core": "^7.11.6",
@@ -58,7 +58,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
58
58
  photoWrapper: {
59
59
  shadowColor: theme.colors.black,
60
60
  shadowRadius: 3,
61
- shadowOffset: {width: 1, height: 4},
61
+ shadowOffset: { width: 1, height: 4 },
62
62
  elevation: 3,
63
63
  borderRadius: 8,
64
64
  shadowOpacity: 0.1,
@@ -96,11 +96,11 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
96
96
  })
97
97
 
98
98
  const qualificationList = [
99
- { key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
99
+ { key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
100
100
  { key: 2, text: t('BAD', 'Bad'), percent: 0.25, parentStyle: { left: '25%' }, isInnerStyle: true, pointerColor: true },
101
101
  { key: 3, text: t('OKAY', 'Okay'), percent: 0.5, parentStyle: { left: '50%' }, isInnerStyle: true, pointerColor: true },
102
102
  { key: 4, text: t('GOOD', 'Good'), percent: 0.75, parentStyle: { left: '75%' }, isInnerStyle: true, pointerColor: true },
103
- { key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
103
+ { key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
104
104
  ]
105
105
 
106
106
  const commentsList = reviewCommentList('customer')
@@ -144,7 +144,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
144
144
  }, [actionState.error])
145
145
 
146
146
  useEffect(() => {
147
- if(scrollref?.current){
147
+ if (scrollref?.current) {
148
148
  Keyboard.addListener('keyboardDidShow', () => {
149
149
  scrollref.current.scrollToEnd()
150
150
  })
@@ -213,13 +213,13 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
213
213
  marginTop: 16
214
214
  }}
215
215
  >
216
- {order?.customer?.name} {order?.customer?.middle_name} {order?.customer?.lastname} {order?.customer?.second_lastname}
216
+ {order?.customer?.name ?? ''} {order?.customer?.middle_name ?? ''} {order?.customer?.lastname ?? ''} {order?.customer?.second_lastname ?? ''}
217
217
  </OText>
218
218
  </CustomerInfoContainer>
219
219
  <OText
220
220
  size={12}
221
221
  >
222
- {t('HOW_WAS_YOUR_CUSTOMER', 'How was your experience with _name_?').replace('_name_', `${order?.customer?.name} ${order?.customer?.middle_name} ${order?.customer?.lastname} ${order?.customer?.second_lastname}`)}
222
+ {t('HOW_WAS_YOUR_CUSTOMER', 'How was your experience with _name_?').replace('_name_', `${order?.customer?.name ?? ''} ${order?.customer?.middle_name ?? ''} ${order?.customer?.lastname ?? ''} ${order?.customer?.second_lastname ?? ''}`)}
223
223
  </OText>
224
224
  <RatingBarContainer>
225
225
  <LinearGradient
@@ -281,7 +281,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
281
281
  style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
282
282
  imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
283
283
  imgRightStyle={{ right: 5, margin: 5 }}
284
- onClick={() => handleChangeComment(commentItem) }
284
+ onClick={() => handleChangeComment(commentItem)}
285
285
  />
286
286
  ))}
287
287
  </CommentsButtonGroup>
@@ -309,7 +309,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
309
309
  </ActionButtonWrapper>
310
310
  <Alert
311
311
  open={alertState.open}
312
- onAccept={() => setAlertState({ open: false, content: [] })}
312
+ onAccept={() => setAlertState({ open: false, content: [] })}
313
313
  onClose={() => setAlertState({ open: false, content: [] })}
314
314
  content={alertState.content}
315
315
  title={t('ERROR', 'Error')}
@@ -234,8 +234,8 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
234
234
  <LottieAnimation
235
235
  type='favorite'
236
236
  onClick={handleChangeFavorite}
237
- initialValue={business?.favorite ? 1 : 0}
238
- toValue={business?.favorite ? 0 : 1}
237
+ initialValue={business?.favorite ? 0.75 : 0}
238
+ toValue={business?.favorite ? 0 : 0.75}
239
239
  disableAnimation={!auth}
240
240
  iconProps={{ color: theme.colors.danger5, size: 18 }}
241
241
  isActive={business?.favorite}
@@ -37,7 +37,7 @@ export const BusinessProductsListingContainer = styled.ScrollView`
37
37
  export const FiltProductsContainer = styled.ScrollView`
38
38
  position: absolute;
39
39
  width: 100%;
40
- z-index: 2000;
40
+ z-index: 20000;
41
41
  top: 80px;
42
42
  margin-top: 20px;
43
43
  `
@@ -48,7 +48,7 @@ export const BackgroundGray = styled.View`
48
48
  background-color: rgba(0,0,0,0.5);
49
49
  position: absolute;
50
50
  margin-top: 100px;
51
- z-index: 100;
51
+ z-index: 10000;
52
52
  width: 100%;
53
53
  `
54
54
 
@@ -13,7 +13,8 @@ import {
13
13
 
14
14
  export const Favorite = (props: any) => {
15
15
  const {
16
- navigation
16
+ navigation,
17
+ franchiseId
17
18
  } = props
18
19
  const [, t] = useLanguage()
19
20
  const theme = useTheme()
@@ -69,6 +70,7 @@ export const Favorite = (props: any) => {
69
70
  originalURL='business'
70
71
  location={`${orderState.options?.address?.location?.lat},${orderState.options?.address?.location?.lng}`}
71
72
  propsToFetch={['id', 'name', 'header', 'logo', 'location', 'address', 'ribbon', 'timezone', 'schedule', 'open', 'delivery_price', 'distance', 'delivery_time', 'pickup_time', 'reviews', 'featured', 'offers', 'food', 'laundry', 'alcohol', 'groceries', 'slug']}
73
+ franchiseId={franchiseId}
72
74
  />
73
75
  )}
74
76
  {tabSelected === 'products' && (
@@ -77,6 +79,7 @@ export const Favorite = (props: any) => {
77
79
  originalURL='products'
78
80
  onNavigationRedirect={onRedirect}
79
81
  isProduct
82
+ franchiseId={franchiseId}
80
83
  />
81
84
  )}
82
85
  {tabSelected === 'orders' && (
@@ -85,6 +88,7 @@ export const Favorite = (props: any) => {
85
88
  favoriteURL='favorite_orders'
86
89
  originalURL='orders'
87
90
  isOrder
91
+ franchiseId={franchiseId}
88
92
  />
89
93
  )}
90
94
  </Container>
@@ -7,7 +7,7 @@ import {
7
7
  } from 'ordering-components/native'
8
8
  import { useTheme } from 'styled-components/native'
9
9
  import { View, TouchableOpacity, FlatList, StyleSheet, KeyboardAvoidingView, Platform } from 'react-native'
10
- import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder'
10
+ import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder'
11
11
  import { OText, OIcon, OModal, OButton } from '../shared'
12
12
  import { getIconCard, flatArray } from '../../utils'
13
13
  import { StripeElementsForm } from '../StripeElementsForm'
@@ -37,7 +37,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
37
37
  const [{ configs }] = useConfig()
38
38
  const [{ parsePrice }] = useUtils()
39
39
 
40
- const [addCardOpen, setAddCardOpen] = useState({ stripe: false, stripeConnect: false });
40
+ const [addCardOpen, setAddCardOpen] = useState({ stripe: false, stripeConnect: false });
41
41
 
42
42
  const isWalletCashEnabled = configs?.wallet_cash_enabled?.value === '1'
43
43
  const isWalletPointsEnabled = configs?.wallet_credit_point_enabled?.value === '1'
@@ -54,52 +54,52 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
54
54
  }
55
55
 
56
56
  const getPayIcon = (method: string) => {
57
- switch (method) {
58
- case 'cash':
59
- return theme.images.general.cash
60
- case 'card_delivery':
61
- return theme.images.general.carddelivery
62
- case 'paypal':
63
- return theme.images.general.paypal
64
- case 'stripe':
65
- return theme.images.general.stripe
66
- case 'stripe_direct':
67
- return theme.images.general.stripecc
68
- case 'stripe_connect':
69
- return theme.images.general.stripes
70
- case 'stripe_redirect':
71
- return theme.images.general.stripesb
72
- default:
73
- return theme.images.general.creditCard
74
- }
75
- }
57
+ switch (method) {
58
+ case 'cash':
59
+ return theme.images.general.cash
60
+ case 'card_delivery':
61
+ return theme.images.general.carddelivery
62
+ case 'paypal':
63
+ return theme.images.general.paypal
64
+ case 'stripe':
65
+ return theme.images.general.stripe
66
+ case 'stripe_direct':
67
+ return theme.images.general.stripecc
68
+ case 'stripe_connect':
69
+ return theme.images.general.stripes
70
+ case 'stripe_redirect':
71
+ return theme.images.general.stripesb
72
+ default:
73
+ return theme.images.general.creditCard
74
+ }
75
+ }
76
76
 
77
77
  const renderPaymethods = ({ item }: any) => {
78
- return (
79
- <TouchableOpacity
80
- onPress={() => handleSelectPaymethod(item)}
81
- >
82
- <PMItem
83
- key={item.id}
84
- isActive={paymethodSelected?.paymethod_id === item.paymethod_id}
85
- >
86
- <OIcon
87
- src={getPayIcon(item.paymethod?.gateway)}
88
- width={20}
89
- height={20}
90
- color={paymethodSelected?.paymethod_id === item.paymethod_id ? theme.colors.white : theme.colors.backgroundDark}
91
- />
92
- <OText
93
- size={10}
94
- style={{ margin: 0, marginTop: 4 }}
95
- color={paymethodSelected?.paymethod_id === item.paymethod_id ? theme.colors.white : '#000'}
96
- >
97
- {t(item?.paymethod?.gateway.toUpperCase(), item?.paymethod?.name)}
98
- </OText>
99
- </PMItem>
100
- </TouchableOpacity>
101
- )
102
- }
78
+ return (
79
+ <TouchableOpacity
80
+ onPress={() => handleSelectPaymethod(item)}
81
+ >
82
+ <PMItem
83
+ key={item.id}
84
+ isActive={paymethodSelected?.paymethod_id === item.paymethod_id}
85
+ >
86
+ <OIcon
87
+ src={getPayIcon(item.paymethod?.gateway)}
88
+ width={20}
89
+ height={20}
90
+ color={paymethodSelected?.paymethod_id === item.paymethod_id ? theme.colors.white : theme.colors.backgroundDark}
91
+ />
92
+ <OText
93
+ size={10}
94
+ style={{ margin: 0, marginTop: 4 }}
95
+ color={paymethodSelected?.paymethod_id === item.paymethod_id ? theme.colors.white : '#000'}
96
+ >
97
+ {t(item?.paymethod?.gateway.toUpperCase(), item?.paymethod?.name)}
98
+ </OText>
99
+ </PMItem>
100
+ </TouchableOpacity>
101
+ )
102
+ }
103
103
 
104
104
  return (
105
105
  <PMContainer>
@@ -123,10 +123,10 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
123
123
  ) : (
124
124
  <FlatList
125
125
  horizontal
126
- showsHorizontalScrollIndicator={false}
127
- data={businessPaymethods.result.filter((paymethod: any) => paymethodsAndWallets.paymethods.find((item: any) => item.id === paymethod.paymethod_id))}
128
- renderItem={renderPaymethods}
129
- keyExtractor={(paymethod: any) => paymethod?.id?.toString?.()}
126
+ showsHorizontalScrollIndicator={false}
127
+ data={businessPaymethods?.result?.filter((paymethod: any) => paymethodsAndWallets.paymethods.find((item: any) => item.id === paymethod.paymethod_id))}
128
+ renderItem={renderPaymethods}
129
+ keyExtractor={(paymethod: any) => paymethod?.id?.toString?.()}
130
130
  />
131
131
  )}
132
132
  {!paymethodsAndWallets.loading && !paymethodsAndWallets.error && paymethodsAndWallets.paymethods.length === 0 && (
@@ -138,22 +138,22 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
138
138
  {paymethodSelected?.paymethod?.gateway === 'stripe' && (
139
139
  <View>
140
140
  <OButton
141
- text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
142
- bgColor={theme.colors.white}
143
- borderColor={theme.colors.primary}
144
- style={styles.btnAddStyle}
145
- textStyle={{ color: theme.colors.primary, fontSize: 12 }}
146
- imgRightSrc={null}
147
- onClick={() => setAddCardOpen({ ...addCardOpen, stripe: true })}
148
- />
141
+ text={t('ADD_PAYMENT_CARD', 'Add New Payment Card')}
142
+ bgColor={theme.colors.white}
143
+ borderColor={theme.colors.primary}
144
+ style={styles.btnAddStyle}
145
+ textStyle={{ color: theme.colors.primary, fontSize: 12 }}
146
+ imgRightSrc={null}
147
+ onClick={() => setAddCardOpen({ ...addCardOpen, stripe: true })}
148
+ />
149
149
  <StripeCardsList
150
- paymethod={paymethodSelected?.paymethod}
151
- businessId={businessIds[0]}
150
+ paymethod={paymethodSelected?.paymethod}
151
+ businessId={businessIds[0]}
152
152
  businessIds={businessIds}
153
- publicKey={paymethodSelected?.data?.publishable}
154
- payType={paymethodSelected?.paymethod?.name}
155
- onSelectCard={handlePaymethodDataChange}
156
- />
153
+ publicKey={paymethodSelected?.data?.publishable}
154
+ payType={paymethodSelected?.paymethod?.name}
155
+ onSelectCard={handlePaymethodDataChange}
156
+ />
157
157
  </View>
158
158
  )}
159
159
 
@@ -170,7 +170,7 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
170
170
  </>
171
171
  ) : (
172
172
  <>
173
- {walletsState.result.filter((wallet: any) => paymethodsAndWallets.wallets.find((item: any) => item.type === wallet.type)).map((wallet: any, idx: any) => walletName[wallet.type]?.isActive && (
173
+ {walletsState?.result?.filter((wallet: any) => paymethodsAndWallets.wallets.find((item: any) => item.type === wallet.type)).map((wallet: any, idx: any) => walletName[wallet.type]?.isActive && (
174
174
  <WalletItem
175
175
  key={wallet.type}
176
176
  isBottomBorder={idx === paymethodsAndWallets.wallets?.length - 1}
@@ -197,40 +197,40 @@ const MultiCartsPaymethodsAndWalletsUI = (props: any) => {
197
197
  )}
198
198
 
199
199
  <OModal
200
- entireModal
201
- title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
202
- open={addCardOpen.stripe}
203
- onClose={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
204
- style={{ backgroundColor: 'red' }}
205
- >
206
- <KeyboardAvoidingView
207
- behavior={Platform.OS == 'ios' ? 'padding' : 'height'}
208
- keyboardVerticalOffset={Platform.OS == 'ios' ? 0 : 0}
209
- enabled={Platform.OS === 'ios' ? true : false}
210
- >
211
- <StripeElementsForm
212
- toSave
213
- businessId={businessIds[0]}
200
+ entireModal
201
+ title={t('ADD_CREDIT_OR_DEBIT_CARD', 'Add credit or debit card')}
202
+ open={addCardOpen.stripe}
203
+ onClose={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
204
+ style={{ backgroundColor: 'red' }}
205
+ >
206
+ <KeyboardAvoidingView
207
+ behavior={Platform.OS == 'ios' ? 'padding' : 'height'}
208
+ keyboardVerticalOffset={Platform.OS == 'ios' ? 0 : 0}
209
+ enabled={Platform.OS === 'ios' ? true : false}
210
+ >
211
+ <StripeElementsForm
212
+ toSave
213
+ businessId={businessIds[0]}
214
214
  businessIds={businessIds}
215
215
  publicKey={paymethodSelected?.data?.publishable}
216
- requirements={props.clientSecret}
217
- onSelectCard={handlePaymethodDataChange}
218
- onCancel={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
219
- />
220
- </KeyboardAvoidingView>
221
- </OModal>
216
+ requirements={props.clientSecret}
217
+ onSelectCard={handlePaymethodDataChange}
218
+ onCancel={() => setAddCardOpen({ ...addCardOpen, stripe: false })}
219
+ />
220
+ </KeyboardAvoidingView>
221
+ </OModal>
222
222
  </PMContainer>
223
223
  )
224
224
  }
225
225
 
226
226
  const styles = StyleSheet.create({
227
- btnAddStyle: {
228
- marginVertical: 20,
229
- borderRadius: 7.6,
230
- shadowOpacity: 0,
231
- height: 44,
232
- borderWidth: 1
233
- },
227
+ btnAddStyle: {
228
+ marginVertical: 20,
229
+ borderRadius: 7.6,
230
+ shadowOpacity: 0,
231
+ height: 44,
232
+ borderWidth: 1
233
+ },
234
234
  })
235
235
 
236
236
 
@@ -187,6 +187,7 @@ export const ProductOptionsUI = (props: any) => {
187
187
  const [headerRefHeight, setHeaderRefHeight] = useState(0)
188
188
  const [summaryRefHeight, setSummaryRefHeight] = useState(0)
189
189
  const [isScrollAvailable, setIsScrollAvailable] = useState(null)
190
+ const [editionsLayoutY, setEditionsLayoutY] = useState(null)
190
191
 
191
192
  const isError = (id: number) => {
192
193
  let bgColor = theme.colors.white;
@@ -295,6 +296,7 @@ export const ProductOptionsUI = (props: any) => {
295
296
  maxProductQuantity === 0 ||
296
297
  Object.keys(errors).length > 0;
297
298
 
299
+
298
300
  const ExtraOptions = ({ eID, options }: any) => (
299
301
  <>
300
302
  {options.map(({ id, name, respect_to, suboptions }: any) => (
@@ -302,19 +304,25 @@ export const ProductOptionsUI = (props: any) => {
302
304
  {respect_to == null && suboptions?.length > 0 && (
303
305
  <TouchableOpacity
304
306
  key={`eopt_key_${id}`}
305
- onPress={() => setSelectedOpt(id)}
307
+ onPress={() => {
308
+ setSelectedOpt(id)
309
+ scrollViewRef?.current?.scrollTo && scrollViewRef.current.scrollTo({
310
+ y: optionLayout[`id:${id}`]?.y + editionsLayoutY - 50,
311
+ animated: true
312
+ })
313
+ }}
306
314
  style={[
307
315
  styles.extraItem,
308
316
  {
309
317
  borderBottomColor:
310
- selOpt == id ? theme.colors.textNormal : theme.colors.border,
318
+ selOpt == id ? theme.colors.textNormal : theme.colors.backgroundPage,
311
319
  },
312
320
  ]}>
313
321
  <OText
314
322
  color={
315
323
  selOpt == id ? theme.colors.textNormal : theme.colors.textSecondary
316
324
  }
317
- size={selOpt == id ? 14 : 12}
325
+ size={12}
318
326
  weight={selOpt == id ? '600' : 'normal'}
319
327
  style={{ maxWidth: 150 }}
320
328
  numberOfLines={1}>
@@ -701,39 +709,34 @@ export const ProductOptionsUI = (props: any) => {
701
709
  <ExtraOptionWrap
702
710
  horizontal
703
711
  showsHorizontalScrollIndicator={false}
704
- style={{ marginBottom: 20 }}
705
- contentContainerStyle={{ paddingHorizontal: 33, backgroundColor: theme.colors.white }}
712
+ style={{
713
+ marginBottom: 20,
714
+ borderBottomWidth: 1,
715
+ borderBottomColor: theme.colors.border,
716
+ marginHorizontal: 30,
717
+ backgroundColor: theme.colors.backgroundPage,
718
+ }}
706
719
  >
707
- <TouchableOpacity
708
- key={`eopt_key_00`}
709
- onPress={() => setSelectedOpt(-1)}
710
- style={[
711
- styles.extraItem,
712
- {
713
- borderBottomColor: selOpt == -1 ? theme.colors.textNormal : theme.colors.border,
714
- },
715
- ]}>
716
- <OText
717
- color={selOpt == -1 ? theme.colors.textNormal : theme.colors.textSecondary}
718
- size={selOpt == -1 ? 14 : 12}
719
- weight={selOpt == -1 ? '600' : 'normal'}>
720
- {t('ALL', 'All')}
721
- </OText>
722
- </TouchableOpacity>
723
720
  {product?.ingredients.length > 0 && (
724
721
  <TouchableOpacity
725
722
  key={`eopt_key_01`}
726
- onPress={() => setSelectedOpt(0)}
723
+ onPress={() => {
724
+ setSelectedOpt(0)
725
+ scrollViewRef?.current?.scrollTo && scrollViewRef.current.scrollTo({
726
+ y: optionLayout[`id:0`]?.y + editionsLayoutY - 50,
727
+ animated: true
728
+ })
729
+ }}
727
730
  style={[
728
731
  styles.extraItem,
729
732
  {
730
733
  borderBottomColor:
731
- selOpt == 0 ? theme.colors.textNormal : theme.colors.border,
734
+ selOpt == 0 ? theme.colors.textNormal : theme.colors.backgroundPage,
732
735
  },
733
736
  ]}>
734
737
  <OText
735
738
  color={selOpt == 0 ? theme.colors.textNormal : theme.colors.textSecondary}
736
- size={selOpt == 0 ? 14 : 12}
739
+ size={12}
737
740
  weight={selOpt == 0 ? '600' : 'normal'}>
738
741
  {t('INGREDIENTS', 'Ingredients')}
739
742
  </OText>
@@ -783,184 +786,93 @@ export const ProductOptionsUI = (props: any) => {
783
786
  ))}
784
787
  </>
785
788
  ) : (
786
- <ProductEditions>
787
- {selOpt === -1 ? (
788
- <>
789
- {product?.ingredients.length > 0 && (
790
- <View style={styles.optionContainer} onLayout={(event: any) => handleOnLayout(event, 0)}>
791
- <SectionTitle>
792
- <OText size={16}>
793
- {t('INGREDIENTS', 'Ingredients')}
794
- </OText>
795
- </SectionTitle>
796
- <WrapperIngredients>
797
- {product?.ingredients.map((ingredient: any) => (
798
- <ProductIngredient
799
- key={ingredient.id}
800
- ingredient={ingredient}
801
- state={
802
- productCart.ingredients[`id:${ingredient.id}`]
803
- }
804
- onChange={handleChangeIngredientState}
805
- isSoldOut={isSoldOut}
806
- />
807
- ))}
808
- </WrapperIngredients>
809
- </View>
810
- )}
811
- {product?.extras.sort((a: any, b: any) => a.rank - b.rank).map((extra: any) =>
812
- extra.options.sort((a: any, b: any) => a.rank - b.rank).map((option: any) => {
813
- const currentState =
814
- productCart.options[`id:${option.id}`] || {};
815
- return (
816
- <React.Fragment key={`popt_${option.id}`}>
817
- {showOption(option) && (
818
- <View style={styles.optionContainer} onLayout={(event: any) => handleOnLayout(event, option?.id)}>
819
- <ProductOption
820
- option={option}
821
- currentState={currentState}
822
- error={errors[`id:${option.id}`]}>
823
- <WrapperSubOption
824
- style={{
825
- backgroundColor: isError(option.id),
826
- borderRadius: 7.6
827
- }}>
828
- {option.suboptions.sort((a: any, b: any) => a.rank - b.rank).map(
829
- (suboption: any) => {
830
- const currentState =
831
- productCart.options[
832
- `id:${option.id}`
833
- ]?.suboptions[
834
- `id:${suboption.id}`
835
- ] || {};
836
- const balance =
837
- productCart.options[
838
- `id:${option.id}`
839
- ]?.balance || 0;
840
- return (
841
- <ProductOptionSubOption
842
- key={suboption.id}
843
- isSoldOut={isSoldOut}
844
- onChange={
845
- handleChangeSuboptionState
846
- }
847
- balance={balance}
848
- option={option}
849
- suboption={suboption}
850
- state={currentState}
851
- disabled={
852
- isSoldOut ||
853
- maxProductQuantity <= 0
854
- }
855
- setIsScrollAvailable={setIsScrollAvailable}
856
- error={errors[`id:${option.id}`]}
857
- />
858
- );
859
- },
860
- )}
861
- </WrapperSubOption>
862
- </ProductOption>
863
- </View>
864
- )}
865
- </React.Fragment>
866
- );
867
- }),
868
- )}
869
- </>
870
- ) : (
871
- <>
872
- {selOpt === 0 ? (
873
- <View style={styles.optionContainer}>
874
- <SectionTitle>
875
- <OText size={16}>
876
- {t('INGREDIENTS', 'Ingredients')}
877
- </OText>
878
- </SectionTitle>
879
- <WrapperIngredients>
880
- {product?.ingredients.map((ingredient: any) => (
881
- <ProductIngredient
882
- key={ingredient.id}
883
- ingredient={ingredient}
884
- state={
885
- productCart.ingredients[`id:${ingredient.id}`]
886
- }
887
- onChange={handleChangeIngredientState}
888
- isSoldOut={isSoldOut}
889
- />
890
- ))}
891
- </WrapperIngredients>
892
- </View>
893
- ) : (
894
- <>
895
- {product?.extras.map((extra: any) =>
896
- extra.options.sort((a: any, b: any) => a.rank - b.rank).map((option: any) => {
897
- if (
898
- option.id == selOpt ||
899
- (hasRespected(
900
- extra.options,
901
- option.respect_to,
902
- ) &&
903
- showOption(option))
904
- ) {
905
- const currentState =
906
- productCart.options[`id:${option.id}`] || {};
907
- return (
908
- <React.Fragment key={option.id}>
909
- {showOption(option) && (
910
- <View style={styles.optionContainer}>
911
- <ProductOption
912
- option={option}
913
- currentState={currentState}
914
- error={errors[`id:${option.id}`]}>
915
- <WrapperSubOption
916
- style={{
917
- backgroundColor: isError(
918
- option.id,
919
- ),
920
- }}>
921
- {option.suboptions.sort((a: any, b: any) => a.rank - b.rank).map(
922
- (suboption: any) => {
923
- const currentState =
924
- productCart.options[
925
- `id:${option.id}`
926
- ]?.suboptions[
927
- `id:${suboption.id}`
928
- ] || {};
929
- const balance =
930
- productCart.options[
931
- `id:${option.id}`
932
- ]?.balance || 0;
933
- return (
934
- <ProductOptionSubOption
935
- key={suboption.id}
936
- onChange={
937
- handleChangeSuboptionState
938
- }
939
- balance={balance}
940
- option={option}
941
- suboption={suboption}
942
- state={currentState}
943
- disabled={
944
- isSoldOut ||
945
- maxProductQuantity <= 0
946
- }
947
- />
948
- );
949
- },
950
- )}
951
- </WrapperSubOption>
952
- </ProductOption>
953
- </View>
954
- )}
955
- </React.Fragment>
956
- );
789
+ <ProductEditions
790
+ onLayout={(event: any) => {
791
+ setEditionsLayoutY(event.nativeEvent.layout?.y)
792
+ }}
793
+ >
794
+ <>
795
+ {product?.ingredients.length > 0 && (
796
+ <View style={styles.optionContainer} onLayout={(event: any) => handleOnLayout(event, 0)}>
797
+ <SectionTitle>
798
+ <OText size={16}>
799
+ {t('INGREDIENTS', 'Ingredients')}
800
+ </OText>
801
+ </SectionTitle>
802
+ <WrapperIngredients>
803
+ {product?.ingredients.map((ingredient: any) => (
804
+ <ProductIngredient
805
+ key={ingredient.id}
806
+ ingredient={ingredient}
807
+ state={
808
+ productCart.ingredients[`id:${ingredient.id}`]
957
809
  }
958
- }),
959
- )}
960
- </>
961
- )}
962
- </>
963
- )}
810
+ onChange={handleChangeIngredientState}
811
+ isSoldOut={isSoldOut}
812
+ />
813
+ ))}
814
+ </WrapperIngredients>
815
+ </View>
816
+ )}
817
+ {product?.extras.sort((a: any, b: any) => a.rank - b.rank).map((extra: any) =>
818
+ extra.options.sort((a: any, b: any) => a.rank - b.rank).map((option: any) => {
819
+ const currentState =
820
+ productCart.options[`id:${option.id}`] || {};
821
+ return (
822
+ <React.Fragment key={`popt_${option.id}`}>
823
+ {showOption(option) && (
824
+ <View style={styles.optionContainer} onLayout={(event: any) => handleOnLayout(event, option?.id)}>
825
+ <ProductOption
826
+ option={option}
827
+ currentState={currentState}
828
+ error={errors[`id:${option.id}`]}>
829
+ <WrapperSubOption
830
+ style={{
831
+ backgroundColor: isError(option.id),
832
+ borderRadius: 7.6
833
+ }}>
834
+ {option.suboptions.sort((a: any, b: any) => a.rank - b.rank).map(
835
+ (suboption: any) => {
836
+ const currentState =
837
+ productCart.options[
838
+ `id:${option.id}`
839
+ ]?.suboptions[
840
+ `id:${suboption.id}`
841
+ ] || {};
842
+ const balance =
843
+ productCart.options[
844
+ `id:${option.id}`
845
+ ]?.balance || 0;
846
+ return (
847
+ <ProductOptionSubOption
848
+ key={suboption.id}
849
+ isSoldOut={isSoldOut}
850
+ onChange={
851
+ handleChangeSuboptionState
852
+ }
853
+ balance={balance}
854
+ option={option}
855
+ suboption={suboption}
856
+ state={currentState}
857
+ disabled={
858
+ isSoldOut ||
859
+ maxProductQuantity <= 0
860
+ }
861
+ setIsScrollAvailable={setIsScrollAvailable}
862
+ error={errors[`id:${option.id}`]}
863
+ />
864
+ );
865
+ },
866
+ )}
867
+ </WrapperSubOption>
868
+ </ProductOption>
869
+ </View>
870
+ )}
871
+ </React.Fragment>
872
+ );
873
+ }),
874
+ )}
875
+ </>
964
876
  {!product?.hide_special_instructions && (
965
877
  <ProductComment>
966
878
  <SectionTitle>
@@ -9,7 +9,7 @@ export const TopActions = styled.TouchableOpacity`
9
9
  height: 60px;
10
10
  justify-content: center;
11
11
  padding-horizontal: 30px;
12
- width: 80px;
12
+ width: 100px;
13
13
  `;
14
14
 
15
15
  export const TopHeader = styled.View`
@@ -82,7 +82,6 @@ export const ProductActions = styled.View`
82
82
  border-top-color: ${(props: any) => props.theme.colors.border};
83
83
  `
84
84
  export const ExtraOptionWrap = styled.ScrollView`
85
- margin-horizontal: 30px;
86
85
  `;
87
86
 
88
87
  export const WeightUnitSwitch = styled.View`
@@ -191,7 +191,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
191
191
  )
192
192
  )}
193
193
  </ProductImage>
194
- )}
194
+ )}
195
195
  {!!product?.calendar_event ? (
196
196
  <View style={{ flex: 1, marginLeft: 10, flexDirection: 'column' }}>
197
197
  <View>
@@ -201,7 +201,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
201
201
  {parseDate(product?.calendar_event?.start, { outputFormat: 'hh:mm a' })} - {parseDate(product?.calendar_event?.end, { outputFormat: 'hh:mm a' })}
202
202
  </OText>
203
203
  </View>
204
- ): (
204
+ ) : (
205
205
  <>
206
206
  {isCartProduct && !isCartPending && getProductMax && (
207
207
  <ProductInfo>
@@ -316,22 +316,22 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
316
316
  </View>
317
317
  </AccordionSection>
318
318
  <OModal
319
- open={isServiceOpen}
320
- onClose={() => setIsServiceOpen(false)}
321
- entireModal
322
- >
323
- <ServiceForm
324
- isCartProduct
325
- isService
326
- businessId={product?.business_id}
319
+ open={isServiceOpen}
320
+ onClose={() => setIsServiceOpen(false)}
321
+ entireModal
322
+ >
323
+ <ServiceForm
324
+ isCartProduct
325
+ isService
326
+ businessId={product?.business_id}
327
327
  categoryId={product?.category_id}
328
328
  productId={product?.id}
329
329
  productCart={product}
330
- onSave={() => setIsServiceOpen(false)}
331
- onClose={() => setIsServiceOpen(false)}
332
- professionalSelected={product?.calendar_event?.professional}
333
- />
334
- </OModal>
330
+ onSave={() => setIsServiceOpen(false)}
331
+ onClose={() => setIsServiceOpen(false)}
332
+ professionalSelected={product?.calendar_event?.professional}
333
+ />
334
+ </OModal>
335
335
  </>
336
336
  )
337
337
  }
@@ -297,8 +297,8 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
297
297
  <LottieAnimation
298
298
  type='favorite'
299
299
  onClick={handleChangeFavorite}
300
- initialValue={order?.favorite ? 1 : 0}
301
- toValue={order?.favorite ? 0 : 1}
300
+ initialValue={order?.favorite ? 0.75 : 0}
301
+ toValue={order?.favorite ? 0 : 0.75}
302
302
  style={{ marginBottom: 5 }}
303
303
  iconProps={{ color: theme.colors.danger5, size: 16, style: { top: 7 } }}
304
304
  isActive={order?.favorite}
@@ -187,8 +187,8 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
187
187
  <LottieAnimation
188
188
  type='favorite'
189
189
  onClick={handleChangeFavorite}
190
- initialValue={product?.favorite ? 1 : 0}
191
- toValue={product?.favorite ? 0 : 1}
190
+ initialValue={product?.favorite ? 0.75 : 0}
191
+ toValue={product?.favorite ? 0 : 0.75}
192
192
  disableAnimation={!auth}
193
193
  iconProps={{ color: theme.colors.danger5, size: 18 }}
194
194
  isActive={product?.favorite}
@@ -146,7 +146,7 @@ const UpsellingProductsUI = (props: UpsellingProductsParams) => {
146
146
  </AddButton>
147
147
  </View>
148
148
  <View>
149
- <OIcon url={product.images} style={styles.imageStyle} />
149
+ <OIcon url={product?.images || theme?.images?.dummies?.product} style={styles.imageStyle} />
150
150
  </View>
151
151
  </Item>
152
152
  )) : (
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { Pressable, StyleSheet, View, ScrollView } from 'react-native';
2
+ import { Pressable, StyleSheet, View, ScrollView, TouchableOpacity } from 'react-native';
3
3
  import { useTheme } from 'styled-components/native'
4
4
  import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
5
5
  import FastImage from 'react-native-fast-image'
@@ -24,7 +24,6 @@ import {
24
24
  WalletTransactionsWrapper
25
25
  } from './styles'
26
26
 
27
- import NavBar from '../NavBar'
28
27
  import { OButton, OIcon, OText, OModal } from '../shared';
29
28
  import { NotFoundSource } from '../NotFoundSource';
30
29
  import { WalletTransactions } from '../WalletTransactions'
@@ -78,7 +77,7 @@ const WalletsUI = (props: any) => {
78
77
  isActive: isWalletCashEnabled
79
78
  },
80
79
  credit_point: {
81
- name: t('CREDITS_POINTS_WALLET', 'Credit Points Wallet'),
80
+ name: t('POINTS_WALLET', 'Points Wallet'),
82
81
  value: 1,
83
82
  isActive: isWalletPointsEnabled
84
83
  }
@@ -112,15 +111,7 @@ const WalletsUI = (props: any) => {
112
111
  <>
113
112
  <Container>
114
113
  <Header>
115
- <NavBar
116
- title={isChewLayout ? '' : t('WALLETS', 'Wallets')}
117
- titleAlign={'center'}
118
- onActionLeft={goToBack}
119
- showCall={false}
120
- paddingTop={10}
121
- btnStyle={{ paddingLeft: 0 }}
122
- style={{ flex: 1 }}
123
- />
114
+ <OText size={24}>{t('WALLETS', 'Wallets')}</OText>
124
115
  {isChewLayout && (
125
116
  <OButton
126
117
  text={t('WALLET_HISTORY', 'Wallet history')}
@@ -145,16 +136,25 @@ const WalletsUI = (props: any) => {
145
136
  showsHorizontalScrollIndicator={false}
146
137
  >
147
138
  {walletList.wallets?.map((wallet: any) => walletName[wallet.type]?.isActive && (
148
- <Pressable
139
+ <TouchableOpacity
149
140
  key={wallet.id}
150
141
  onPress={() => handleChangeTab(wallet)}
151
142
  >
152
- <OTab isSelected={tabSelected === wallet.type}>
153
- <OText size={18} color={tabSelected === wallet.type && theme.colors.primary}>
143
+ <OTab
144
+ isSelected={tabSelected === wallet.type}
145
+ style={{
146
+ borderBottomWidth: 1,
147
+ borderBottomColor:
148
+ tabSelected === wallet.type
149
+ ? theme.colors.textNormal
150
+ : theme.colors.border
151
+ }}
152
+ >
153
+ <OText>
154
154
  {walletName[wallet.type]?.name}
155
155
  </OText>
156
156
  </OTab>
157
- </Pressable>
157
+ </TouchableOpacity>
158
158
  ))}
159
159
  </OTabs>
160
160
 
@@ -10,7 +10,7 @@ interface Props {
10
10
  onClick: any
11
11
  }
12
12
 
13
- export const CardAnimation = (props : Props) => {
13
+ export const CardAnimation = (props: Props) => {
14
14
  const {
15
15
  children,
16
16
  onClick,
@@ -21,8 +21,8 @@ export const CardAnimation = (props : Props) => {
21
21
  cardAnimation: {
22
22
  elevation: isPressed ? 2 : 0,
23
23
  shadowColor: '#888',
24
- shadowOffset: { width: 0, height: isPressed ? 2 : 0 },
25
- shadowRadius: 18,
24
+ shadowOffset: { width: 0, height: 0 },
25
+ shadowRadius: 0,
26
26
  shadowOpacity: isPressed ? 0.8 : 0,
27
27
  borderRadius: 12,
28
28
  }
@@ -33,7 +33,7 @@ const OBottomPopup = (props: Props) => {
33
33
 
34
34
  return (
35
35
  <Modal
36
- animationType='slide'
36
+ animationType='fade'
37
37
  transparent={transparent}
38
38
  visible={open}
39
39
  onRequestClose={() => onClose()}
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
- import styled, { css } from 'styled-components/native';
3
- import { Platform } from 'react-native';
2
+ import { useSafeAreaInsets } from 'react-native-safe-area-context'
3
+ import styled, { css, useTheme } from 'styled-components/native';
4
+ import { Platform, View } from 'react-native';
4
5
 
5
6
  const ContainerStyled = styled.ScrollView`
6
7
  flex: 1;
@@ -10,17 +11,20 @@ const ContainerStyled = styled.ScrollView`
10
11
  background-color: ${(props: any) => props.theme.colors.backgroundPage};
11
12
  `;
12
13
 
13
- const SafeAreaStyled = styled.SafeAreaView`
14
- flex: 1;
15
- background-color: ${(props: any) => props.theme.colors.backgroundPage};
16
- `;
17
-
18
14
  export const Container = (props: any) => {
15
+ const theme = useTheme()
16
+ const insets = useSafeAreaInsets()
19
17
  return (
20
- <SafeAreaStyled>
18
+ <View
19
+ style={{
20
+ flex: 1,
21
+ paddingTop: insets.top,
22
+ backgroundColor: theme.colors.backgroundPage
23
+ }}
24
+ >
21
25
  <ContainerStyled {...props} ref={props?.forwardRef} keyboardShouldPersistTaps='handled' style={{...props.style}}>
22
26
  {props.children}
23
27
  </ContainerStyled>
24
- </SafeAreaStyled>
28
+ </View>
25
29
  )
26
30
  }