ordering-ui-react-native 0.16.32-release → 0.16.33-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.16.32-release",
3
+ "version": "0.16.33-release",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -1,4 +1,6 @@
1
- import React, { useState, useEffect } from 'react'
1
+
2
+
3
+ import React, { useState, useEffect, useRef } from 'react'
2
4
  import {
3
5
  useLanguage,
4
6
  useUtils,
@@ -10,7 +12,8 @@ import {
10
12
  View,
11
13
  StyleSheet,
12
14
  I18nManager,
13
- TouchableOpacity
15
+ TouchableOpacity,
16
+ Keyboard
14
17
  } from 'react-native'
15
18
  import { useTheme } from 'styled-components/native'
16
19
  import { ReviewCustomerParams } from '../../types'
@@ -52,12 +55,12 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
52
55
  const { top, bottom } = useSafeAreaInsets()
53
56
  const [comments, setComments] = useState<Array<any>>([])
54
57
  const [extraComment, setExtraComment] = useState('')
55
-
58
+ const scrollref = useRef<any>()
56
59
  const styles = StyleSheet.create({
57
60
  photoWrapper: {
58
61
  shadowColor: theme.colors.black,
59
62
  shadowRadius: 3,
60
- shadowOffset: {width: 1, height: 4},
63
+ shadowOffset: { width: 1, height: 4 },
61
64
  elevation: 3,
62
65
  borderRadius: 8,
63
66
  shadowOpacity: 0.1,
@@ -95,11 +98,11 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
95
98
  })
96
99
 
97
100
  const qualificationList = [
98
- { key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
101
+ { key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
99
102
  { key: 2, text: t('BAD', 'Bad'), percent: 0.25, parentStyle: { left: '25%' }, isInnerStyle: true, pointerColor: true },
100
103
  { key: 3, text: t('OKAY', 'Okay'), percent: 0.5, parentStyle: { left: '50%' }, isInnerStyle: true, pointerColor: true },
101
104
  { key: 4, text: t('GOOD', 'Good'), percent: 0.75, parentStyle: { left: '75%' }, isInnerStyle: true, pointerColor: true },
102
- { key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
105
+ { key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
103
106
  ]
104
107
 
105
108
  const commentsList = reviewCommentList('customer')
@@ -142,6 +145,16 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
142
145
 
143
146
  }, [actionState.error])
144
147
 
148
+ useEffect(() => {
149
+ if (scrollref?.current) {
150
+ Keyboard.addListener('keyboardDidShow', () => {
151
+ scrollref.current.scrollToEnd()
152
+ })
153
+ }
154
+ }, [scrollref?.current])
155
+
156
+ const customerName = `${order?.customer?.name ?? ''} ${order?.customer?.middle_name ?? ''} ${order?.customer?.lastname ?? ''} ${order?.customer?.second_lastname ?? ''}`?.replace(' ', ' ')?.trim() ?? ''
157
+
145
158
  return (
146
159
  <KeyboardAvoidingView
147
160
  enabled
@@ -179,6 +192,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
179
192
  <Content
180
193
  showsVerticalScrollIndicator={false}
181
194
  contentContainerStyle={{ paddingBottom: 30 }}
195
+ ref={scrollref}
182
196
  >
183
197
  <CustomerInfoContainer>
184
198
  <View
@@ -196,20 +210,20 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
196
210
  style={{ borderRadius: 7.6 }}
197
211
  />
198
212
  </View>
199
- <OText
213
+ {!!customerName && <OText
200
214
  size={14}
201
215
  weight="500"
202
216
  style={{
203
217
  marginTop: 16
204
218
  }}
205
219
  >
206
- {order?.customer?.name} {order?.customer?.middle_name} {order?.customer?.lastname} {order?.customer?.second_lastname}
207
- </OText>
220
+ {customerName}
221
+ </OText>}
208
222
  </CustomerInfoContainer>
209
223
  <OText
210
224
  size={12}
211
225
  >
212
- {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}`)}
226
+ {customerName ? t('HOW_WAS_YOUR_CUSTOMER', 'How was your experience with _name_?').replace('_name_', customerName) : t('HOW_WAS_YOUR_NO_CUSTOMER', 'How was your experience?')}
213
227
  </OText>
214
228
  <RatingBarContainer>
215
229
  <LinearGradient
@@ -271,7 +285,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
271
285
  style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
272
286
  imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
273
287
  imgRightStyle={{ right: 5, margin: 5 }}
274
- onClick={() => handleChangeComment(commentItem) }
288
+ onClick={() => handleChangeComment(commentItem)}
275
289
  />
276
290
  ))}
277
291
  </CommentsButtonGroup>
@@ -299,7 +313,7 @@ const ReviewCustomerUI = (props: ReviewCustomerParams) => {
299
313
  </ActionButtonWrapper>
300
314
  <Alert
301
315
  open={alertState.open}
302
- onAccept={() => setAlertState({ open: false, content: [] })}
316
+ onAccept={() => setAlertState({ open: false, content: [] })}
303
317
  onClose={() => setAlertState({ open: false, content: [] })}
304
318
  content={alertState.content}
305
319
  title={t('ERROR', 'Error')}
@@ -57,7 +57,7 @@ const AddressDetailsUI = (props: any) => {
57
57
  }>
58
58
  <OText
59
59
  size={12}
60
- color={theme.colors.textSecondary}
60
+ color={theme.colors.primary}
61
61
  style={{ textDecorationLine: 'underline' }}>
62
62
  {t('CHANGE', 'Change')}
63
63
  </OText>
@@ -83,7 +83,6 @@ const AddressFormUI = (props: AddressFormParams) => {
83
83
  backgroundColor: theme.colors.clear
84
84
  },
85
85
  inputsStyle: {
86
- borderColor: theme.colors.border,
87
86
  borderRadius: 10,
88
87
  marginBottom: 20,
89
88
  height: 50,
@@ -92,7 +91,6 @@ const AddressFormUI = (props: AddressFormParams) => {
92
91
  flex: 1,
93
92
  },
94
93
  textAreaStyles: {
95
- borderColor: theme.colors.border,
96
94
  borderRadius: 10,
97
95
  marginBottom: 20,
98
96
  height: 104,
@@ -140,6 +138,7 @@ const AddressFormUI = (props: AddressFormParams) => {
140
138
  const [isKeyboardShow, setIsKeyboardShow] = useState(false);
141
139
  const [isSignUpEffect, setIsSignUpEffect] = useState(false);
142
140
  const [hasEditing, setAddressEditing] = useState(false);
141
+ const [autoCompleteInputFocused, setAutoCompleteInputFocused] = useState(false)
143
142
 
144
143
  const googleInput: any = useRef(null);
145
144
  const internalNumberRef: any = useRef(null);
@@ -563,6 +562,8 @@ const AddressFormUI = (props: AddressFormParams) => {
563
562
  autoCorrect: false,
564
563
  blurOnSubmit: false,
565
564
  returnKeyType: 'next',
565
+ onFocus: () => setAutoCompleteInputFocused(true),
566
+ onBlur: () => setAutoCompleteInputFocused(false)
566
567
  }}
567
568
  onFail={(error) =>
568
569
  setAlertState({
@@ -586,7 +587,7 @@ const AddressFormUI = (props: AddressFormParams) => {
586
587
  textInput: {
587
588
  borderWidth: 1,
588
589
  borderRadius: 7.6,
589
- borderColor: theme.colors.border,
590
+ borderColor: autoCompleteInputFocused ? theme.colors.primary : theme.colors.border,
590
591
  flexGrow: 1,
591
592
  fontSize: 15,
592
593
  paddingLeft: 16,
@@ -676,6 +677,7 @@ const AddressFormUI = (props: AddressFormParams) => {
676
677
  addressState?.address?.internal_number ||
677
678
  ''
678
679
  }
680
+ isFocusHighlight
679
681
  style={{
680
682
  ...styles.inputsStyle,
681
683
  marginRight: showField('internal_number') && showField('zipcode') ? 24 : 0
@@ -722,6 +724,7 @@ const AddressFormUI = (props: AddressFormParams) => {
722
724
  addressState.address.zipcode ||
723
725
  ''
724
726
  }
727
+ isFocusHighlight
725
728
  style={styles.inputsStyle}
726
729
  forwardRef={zipCodeRef}
727
730
  returnKeyType="next"
@@ -767,6 +770,7 @@ const AddressFormUI = (props: AddressFormParams) => {
767
770
  ''
768
771
  }
769
772
  multiline
773
+ isFocusHighlight
770
774
  style={styles.textAreaStyles}
771
775
  returnKeyType="done"
772
776
  forwardRef={addressNotesRef}
@@ -268,7 +268,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
268
268
  {!isOpenSearchBar && (
269
269
  <>
270
270
  <TopActions onPress={() => handleBackNavigation()}>
271
- <IconAntDesign name='arrowleft' size={26} />
271
+ <OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
272
272
  </TopActions>
273
273
  {!errorQuantityProducts && (
274
274
  <View style={{ ...styles.headerItem }}>
@@ -276,7 +276,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
276
276
  onPress={() => setIsOpenSearchBar(true)}
277
277
  style={styles.searchIcon}
278
278
  >
279
- <OIcon src={theme.images.general.search} color={theme.colors.textNormal} width={16} />
279
+ <OIcon src={theme.images.general.search} color={theme.colors.textNormal} width={20} />
280
280
  </TouchableOpacity>
281
281
  </View>
282
282
  )}
@@ -32,7 +32,6 @@ import {
32
32
  HeaderWrapper,
33
33
  ListWrapper,
34
34
  FeaturedWrapper,
35
- OrderProgressWrapper,
36
35
  FarAwayMessage,
37
36
  AddressInputContainer,
38
37
  PreorderInput,
@@ -137,7 +136,8 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
137
136
  minHeight: 45,
138
137
  paddingVertical: 5,
139
138
  paddingHorizontal: 20,
140
- borderWidth: 1
139
+ borderWidth: 1,
140
+ justifyContent: 'center'
141
141
  },
142
142
  businessSkeleton: {
143
143
  borderRadius: 8,
@@ -167,6 +167,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
167
167
  const timerId = useRef<any>(false)
168
168
  const [favoriteIds, setFavoriteIds] = useState<any>([])
169
169
  const chewOrderTypes = [{ name: t('DELIVERY', 'Delivery').toUpperCase(), value: 1 }, { name: t('PICKUP', 'Pickup').toUpperCase(), value: 2 }]
170
+ const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
170
171
 
171
172
  const handleMomentClick = () => {
172
173
  if (isPreorderEnabled) {
@@ -353,6 +354,13 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
353
354
  />
354
355
  }
355
356
  >
357
+ {enabledPoweredByOrdering && auth && (
358
+ <View style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', top: 20 }}>
359
+ <OText>
360
+ Powered By Ordering.co
361
+ </OText>
362
+ </View>
363
+ )}
356
364
  <View style={{
357
365
  height: !isPreOrderSetting && isChewLayout ? 150 : isChewLayout ? 200 : isFarAway ? 150 : 100,
358
366
  marginTop: Platform.OS == 'ios' ? 0 : 50,
@@ -458,9 +466,9 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
458
466
  </View>
459
467
  {!isChewLayout ? (
460
468
  <HeaderWrapper
461
- source={bgHeader ? {uri: bgHeader} : theme.images.backgrounds.business_list_header}
469
+ source={bgHeader ? { uri: bgHeader } : theme.images.backgrounds.business_list_header}
462
470
  style={{ paddingTop: top + 20 }}
463
- resizeMode='cover'
471
+ resizeMode='stretch'
464
472
  >
465
473
  {!auth && (
466
474
 
@@ -492,12 +500,10 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
492
500
  </TouchableOpacity>
493
501
  </View>
494
502
  )}
495
- <OrderProgressWrapper>
496
- <OrderProgress
497
- {...props}
498
- isFocused={isFocused}
499
- />
500
- </OrderProgressWrapper>
503
+ <OrderProgress
504
+ {...props}
505
+ isFocused={isFocused}
506
+ />
501
507
  {
502
508
  !businessId && !props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
503
509
  <FeaturedWrapper>
@@ -647,14 +653,25 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
647
653
  key={city?.id}
648
654
  style={{
649
655
  padding: 10,
650
- borderBottomWidth: 1,
651
- borderBottomColor: orderState?.options?.city_id === city?.id ? theme.colors.primary : theme.colors.backgroundGray,
652
- marginBottom: 10,
656
+ flexDirection: 'row'
653
657
  }}
654
658
  onPress={() => handleChangeCity(city?.id)}
655
659
  disabled={orderState?.loading}
656
660
  >
657
- <OText color={orderState?.options?.city_id === city?.id ? theme.colors.primary : theme.colors.black}>
661
+ {orderState?.options?.city_id === city?.id ? (
662
+ <OIcon
663
+ src={theme.images.general.option_checked}
664
+ width={16}
665
+ style={{ marginEnd: 24 }}
666
+ />
667
+ ) : (
668
+ <OIcon
669
+ src={theme.images.general.option_normal}
670
+ width={16}
671
+ style={{ marginEnd: 24 }}
672
+ />
673
+ )}
674
+ <OText color={theme.colors.black}>
658
675
  {city?.name}
659
676
  </OText>
660
677
  </TouchableOpacity>
@@ -60,7 +60,9 @@ export const WrapMomentOption = styled.TouchableOpacity`
60
60
 
61
61
  export const HeaderWrapper = styled.ImageBackground`
62
62
  width: 100%;
63
- height: 270px;
63
+ height: 5%;
64
+ min-height: 270px;
65
+ max-height: 400px;
64
66
  padding: 20px 40px;
65
67
  background-color: transparent;
66
68
  `;
@@ -72,16 +74,9 @@ export const ListWrapper = styled.View`
72
74
 
73
75
  export const FeaturedWrapper = styled.View`
74
76
  background-color: ${(props: any) => props.theme.colors.backgroundLight};
75
- height: 220px;
76
77
  paddingVertical: 30px;
77
78
  `;
78
79
 
79
- export const OrderProgressWrapper = styled.View`
80
- margin-top: 37px;
81
- margin-bottom: 20px;
82
- padding-horizontal: 40px;
83
- `
84
-
85
80
  export const FarAwayMessage = styled.View`
86
81
  flex-direction: row;
87
82
  align-items: center;
@@ -96,7 +96,7 @@ const LoginFormUI = (props: LoginParams) => {
96
96
  const [alertState, setAlertState] = useState({ open: false, title: '', content: [] })
97
97
  const [tabLayouts, setTabLayouts] = useState<any>({})
98
98
  const tabsRef = useRef<any>(null)
99
-
99
+ const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
100
100
  const theme = useTheme();
101
101
  const isOtpEmail = loginTab === 'otp' && otpType === 'email'
102
102
  const isOtpCellphone = loginTab === 'otp' && otpType === 'cellphone'
@@ -789,6 +789,12 @@ const LoginFormUI = (props: LoginParams) => {
789
789
  </Placeholder>
790
790
  </SkeletonWrapper>
791
791
  )}
792
+
793
+ {enabledPoweredByOrdering && (
794
+ <OText>
795
+ Powered By Ordering.co
796
+ </OText>
797
+ )}
792
798
  </FormSide>
793
799
  <OModal
794
800
  open={isModalVisible}
@@ -28,6 +28,7 @@ import {
28
28
  TimeItem
29
29
  } from './styles';
30
30
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
31
+ import { locale, monthsEnum } from '../../utils';
31
32
 
32
33
  const MomentOptionUI = (props: MomentOptionParams) => {
33
34
  const {
@@ -281,7 +282,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
281
282
  style={{ marginEnd: 24 }}
282
283
  />
283
284
  )}
284
- <OText color={optionSelected.isAsap ? theme.colors.textNormal : theme.colors.disabled}>{t('ASAP_ABBREVIATION', 'ASAP') + ` (${moment().format('dddd, MMM D, yyyy h:mm A')} + delivery time)`}</OText>
285
+ <OText color={optionSelected.isAsap ? theme.colors.textNormal : theme.colors.disabled}>{t('ASAP_ABBREVIATION', 'ASAP') + ` (${t(moment().format('dddd')?.toLocaleUpperCase(), moment().format('dddd'))}, ${t(monthsEnum[moment().format('MMM')], moment().format('MMM'))}${moment().format(' D, yyyy h:mm A')} + ${t('DELIVERY_TIME', 'delivery time')})`}</OText>
285
286
  </WrapSelectOption>
286
287
  <WrapSelectOption
287
288
  onPress={() => setOptionSelected({ isAsap: false, isSchedule: true })}
@@ -308,6 +309,7 @@ const MomentOptionUI = (props: MomentOptionParams) => {
308
309
  {selectDate && datesWhitelist[0]?.start !== null && (
309
310
  <CalendarStrip
310
311
  scrollable
312
+ locale={locale}
311
313
  style={styles.calendar}
312
314
  calendarHeaderContainerStyle={styles.calendarHeaderContainer}
313
315
  calendarHeaderStyle={styles.calendarHeader}
@@ -342,12 +344,12 @@ const MomentOptionUI = (props: MomentOptionParams) => {
342
344
  style={{
343
345
  lineHeight: 24
344
346
  }}
345
- >{is12hours ? (
346
- time.startTime.includes('12')
347
+ >{is12hours ? (
348
+ time.startTime.includes('12')
347
349
  ? `${time.startTime}PM`
348
350
  : parseTime(moment(time.startTime, 'HH:mm'), { outputFormat: 'hh:mma' })
349
- ) : time.startTime
350
- }</OText>
351
+ ) : time.startTime
352
+ }</OText>
351
353
  </TimeItem>
352
354
  </TouchableOpacity>
353
355
  ))}
@@ -118,6 +118,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
118
118
  const mapValidStatuses = [9, 19, 23]
119
119
  const placeSpotTypes = [3, 4, 5]
120
120
  const directionTypes = [2, 3, 4, 5]
121
+ const enabledPoweredByOrdering = configs?.powered_by_ordering_module?.value
121
122
 
122
123
  const walletName: any = {
123
124
  cash: {
@@ -599,6 +600,13 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
599
600
  : parseDate(order?.delivery_datetime, { utc: false })}
600
601
  </OText>}
601
602
  />
603
+ {enabledPoweredByOrdering && (
604
+ <View style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
605
+ <OText>
606
+ Powered By Ordering.co
607
+ </OText>
608
+ </View>
609
+ )}
602
610
  <OrderInfo>
603
611
  <OrderData>
604
612
  <View style={styles.linkWrapper}>
@@ -17,7 +17,8 @@ import {
17
17
  ProgressBar,
18
18
  TimeWrapper,
19
19
  ProgressTextWrapper,
20
- OrderInfoWrapper
20
+ OrderInfoWrapper,
21
+ OrderProgressWrapper
21
22
  } from './styles'
22
23
  const OrderProgressUI = (props: any) => {
23
24
  const {
@@ -47,9 +48,9 @@ const OrderProgressUI = (props: any) => {
47
48
  height: 1
48
49
  },
49
50
  shadowColor: '#000',
50
- shadowOpacity: 0.1,
51
- shadowRadius: 1,
52
- elevation: 2
51
+ shadowOpacity: 0.2,
52
+ shadowRadius: 2,
53
+ elevation: 3
53
54
  },
54
55
  logoWrapper: {
55
56
  overflow: 'hidden',
@@ -144,70 +145,74 @@ const OrderProgressUI = (props: any) => {
144
145
  return (
145
146
  <>
146
147
  {(orderList?.loading && !initialLoaded) && (
147
- <Placeholder Animation={Fade} height={Platform.OS === 'ios' ? 147.5 : 158}>
148
- <PlaceholderLine height={60} style={{ borderRadius: 8, marginBottom: 10 }} />
149
- <PlaceholderLine height={20} style={{ marginBottom: 10 }} />
150
- <PlaceholderLine height={40} style={{ borderRadius: 8, marginBottom: 10 }} />
151
- </Placeholder>
148
+ <OrderProgressWrapper>
149
+ <Placeholder Animation={Fade} height={Platform.OS === 'ios' ? 147.5 : 158}>
150
+ <PlaceholderLine height={60} style={{ borderRadius: 8, marginBottom: 10 }} />
151
+ <PlaceholderLine height={20} style={{ marginBottom: 10 }} />
152
+ <PlaceholderLine height={40} style={{ borderRadius: 8, marginBottom: 10 }} />
153
+ </Placeholder>
154
+ </OrderProgressWrapper>
152
155
  )}
153
156
  {(!orderList?.loading || initialLoaded) && orderList?.orders?.length > 0 && lastOrder && (
154
- <View style={styles.main}>
155
- <OrderInfoWrapper style={{ flex: 1 }}>
156
- <View style={styles.logoWrapper}>
157
- <FastImage
158
- style={{ width: 50, height: 50 }}
159
- source={{
160
- uri: optimizeImage(lastOrder?.business?.logo, 'h_50,c_limit'),
161
- priority: FastImage.priority.normal,
162
- }}
163
- resizeMode={FastImage.resizeMode.cover}
164
- />
165
- </View>
166
- <View style={{
167
- paddingHorizontal: 10,
168
- flex: 1
169
- }}
170
- >
171
- <OText
172
- size={13}
173
- style={{
174
- fontWeight: 'bold',
175
- marginBottom: 3
176
- }}
177
- >{t('ORDER_IN_PROGRESS', 'Order in progress')}</OText>
178
- <OText size={11} numberOfLines={1} ellipsizeMode='tail'>{t('RESTAURANT_PREPARING_YOUR_ORDER', 'The restaurant is preparing your order')}</OText>
179
- <TouchableOpacity onPress={() => handleGoToOrder('MyOrders')}>
180
- <View style={styles.navigationButton}>
181
- <OText size={11} color={theme.colors.primary}>{t('GO_TO_MY_ORDERS', 'Go to my orders')}</OText>
182
- <IconAntDesign
183
- name='arrowright'
184
- color={theme.colors.primary}
185
- size={13}
186
- style={{ marginHorizontal: 5 }}
187
- />
188
- </View>
189
- </TouchableOpacity>
157
+ <OrderProgressWrapper>
158
+ <View style={styles.main}>
159
+ <OrderInfoWrapper style={{ flex: 1 }}>
160
+ <View style={styles.logoWrapper}>
161
+ <FastImage
162
+ style={{ width: 50, height: 50 }}
163
+ source={{
164
+ uri: optimizeImage(lastOrder?.business?.logo, 'h_50,c_limit'),
165
+ priority: FastImage.priority.normal,
166
+ }}
167
+ resizeMode={FastImage.resizeMode.cover}
168
+ />
169
+ </View>
170
+ <View style={{
171
+ paddingHorizontal: 10,
172
+ flex: 1
173
+ }}
174
+ >
175
+ <OText
176
+ size={13}
177
+ style={{
178
+ fontWeight: 'bold',
179
+ marginBottom: 3
180
+ }}
181
+ >{t('ORDER_IN_PROGRESS', 'Order in progress')}</OText>
182
+ <OText size={11} numberOfLines={1} ellipsizeMode='tail'>{t('RESTAURANT_PREPARING_YOUR_ORDER', 'The restaurant is preparing your order')}</OText>
183
+ <TouchableOpacity onPress={() => handleGoToOrder('MyOrders')}>
184
+ <View style={styles.navigationButton}>
185
+ <OText size={11} color={theme.colors.primary}>{t('GO_TO_MY_ORDERS', 'Go to my orders')}</OText>
186
+ <IconAntDesign
187
+ name='arrowright'
188
+ color={theme.colors.primary}
189
+ size={13}
190
+ style={{ marginHorizontal: 5 }}
191
+ />
192
+ </View>
193
+ </TouchableOpacity>
194
+ </View>
195
+ </OrderInfoWrapper>
196
+ <View style={{ flex: 1 }}>
197
+ <ProgressContentWrapper>
198
+ <ProgressBar style={{ width: getOrderStatus(lastOrder.status)?.percentage ? `${getOrderStatus(lastOrder.status)?.percentage}%` : '0%' }} />
199
+ </ProgressContentWrapper>
200
+ <ProgressTextWrapper>
201
+ <OText size={12} style={{ width: '50%' }}>{getOrderStatus(lastOrder.status)?.value}</OText>
202
+ <TimeWrapper>
203
+ <OText size={11}>{t('ESTIMATED_DELIVERY', 'Estimated delivery')}</OText>
204
+ <OText size={11}>
205
+ {lastOrder?.delivery_datetime_utc
206
+ ? parseTime(lastOrder?.delivery_datetime_utc, { outputFormat: 'hh:mm A' })
207
+ : parseTime(lastOrder?.delivery_datetime, { utc: false })}
208
+ &nbsp;-&nbsp;
209
+ {convertDiffToHours(lastOrder)}
210
+ </OText>
211
+ </TimeWrapper>
212
+ </ProgressTextWrapper>
190
213
  </View>
191
- </OrderInfoWrapper>
192
- <View style={{ flex: 1 }}>
193
- <ProgressContentWrapper>
194
- <ProgressBar style={{ width: getOrderStatus(lastOrder.status)?.percentage ? `${getOrderStatus(lastOrder.status)?.percentage}%` : '0%' }} />
195
- </ProgressContentWrapper>
196
- <ProgressTextWrapper>
197
- <OText size={12} style={{ width: '50%' }}>{getOrderStatus(lastOrder.status)?.value}</OText>
198
- <TimeWrapper>
199
- <OText size={11}>{t('ESTIMATED_DELIVERY', 'Estimated delivery')}</OText>
200
- <OText size={11}>
201
- {lastOrder?.delivery_datetime_utc
202
- ? parseTime(lastOrder?.delivery_datetime_utc, { outputFormat: 'hh:mm A' })
203
- : parseTime(lastOrder?.delivery_datetime, { utc: false })}
204
- &nbsp;-&nbsp;
205
- {convertDiffToHours(lastOrder)}
206
- </OText>
207
- </TimeWrapper>
208
- </ProgressTextWrapper>
209
214
  </View>
210
- </View>
215
+ </OrderProgressWrapper>
211
216
  )}
212
217
  {/* {!orderList?.loading && orderList?.orders?.length === 0 && (
213
218
  <NotFoundSource
@@ -29,3 +29,8 @@ export const OrderInfoWrapper = styled.View`
29
29
  align-items: center;
30
30
  margin-bottom: 15px;
31
31
  `
32
+ export const OrderProgressWrapper = styled.View`
33
+ margin-top: 37px;
34
+ margin-bottom: 20px;
35
+ padding-horizontal: 40px;
36
+ `
@@ -126,6 +126,7 @@ export const ProductOptionsUI = (props: any) => {
126
126
  },
127
127
  slide1: {
128
128
  flex: 1,
129
+ alignItems: 'center'
129
130
  },
130
131
  mainSwiper: {
131
132
  height: 258,
@@ -919,7 +920,7 @@ export const ProductOptionsUI = (props: any) => {
919
920
  disabled={productCart.quantity === 1 || !productCart.quantity || isSoldOut || ((productCart?.quantity + productAddedToCartLength) <= product?.minimum_per_order)}>
920
921
  <OIcon
921
922
  src={theme.images.general.minus}
922
- width={16}
923
+ width={20}
923
924
  color={
924
925
  productCart.quantity === 1 || isSoldOut
925
926
  ? theme.colors.backgroundGray
@@ -940,7 +941,8 @@ export const ProductOptionsUI = (props: any) => {
940
941
  borderRadius: 8,
941
942
  borderColor: theme.colors.inputBorderColor,
942
943
  height: 44,
943
- marginHorizontal: 10
944
+ marginHorizontal: 10,
945
+ fontSize: 16
944
946
  }}
945
947
  />
946
948
  )}
@@ -963,7 +965,7 @@ export const ProductOptionsUI = (props: any) => {
963
965
  }>
964
966
  <OIcon
965
967
  src={theme.images.general.plus}
966
- width={16}
968
+ width={20}
967
969
  color={
968
970
  maxProductQuantity <= 0 ||
969
971
  (productCart?.quantity + productAddedToCartLength) >= maxProductQuantity ||
@@ -241,7 +241,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
241
241
  <TouchableOpacity onPress={() => handleEditProduct(product)} style={{ marginEnd: 7 }}>
242
242
  <OIcon
243
243
  src={theme.images.general.pencil}
244
- width={16}
244
+ width={20}
245
245
  color={theme.colors.textSecondary}
246
246
  />
247
247
  </TouchableOpacity>
@@ -254,7 +254,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
254
254
  >
255
255
  <OIcon
256
256
  src={theme.images.general.trash}
257
- width={17}
257
+ width={20}
258
258
  color={theme.colors.textSecondary}
259
259
  />
260
260
  </OAlert>
@@ -186,7 +186,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
186
186
  <NavBar
187
187
  title={t('REVIEW_DRIVER', 'Review driver')}
188
188
  titleAlign={'center'}
189
- onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
189
+ onActionLeft={() => onNavigationRedirect('BottomTab')}
190
190
  showCall={false}
191
191
  btnStyle={{ paddingLeft: 0 }}
192
192
  style={{ flexDirection: 'column', alignItems: 'flex-start' }}
@@ -67,7 +67,7 @@ const ReviewProductsUI = (props: ReviewProductParams) => {
67
67
  <NavBar
68
68
  title={t('REVIEW_PRODUCT', 'Review product')}
69
69
  titleAlign={'center'}
70
- onActionLeft={() => onNavigationRedirect('MyOrders')}
70
+ onActionLeft={() => onNavigationRedirect('BottomTab')}
71
71
  showCall={false}
72
72
  btnStyle={{ paddingLeft: 0 }}
73
73
  style={{ flexDirection: 'column', alignItems: 'flex-start' }}
@@ -168,7 +168,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
168
168
  <View style={{ flexDirection: 'row' }}>
169
169
  {productAddedToCartLength > 0 && (
170
170
  <QuantityContainer style={[styles.quantityContainer, {
171
- transform: [{ translateX: 25 }, { translateY: hideAddButton ? -25 : -55 }],
171
+ transform: [{ translateX: 25 }, { translateY: -25 }],
172
172
  }]}>
173
173
  <OText size={12} color={theme.colors.white}>{productAddedToCartLength.toString()}</OText>
174
174
  </QuantityContainer>
@@ -273,6 +273,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
273
273
  width: '100%',
274
274
  borderRadius: 7.6,
275
275
  marginTop: 10,
276
+ height: 40
276
277
 
277
278
  }}
278
279
  bgColor={isSoldOut ? '#B8B8B8' : theme?.colors?.white}
@@ -21,6 +21,7 @@ export const QuantityContainer = styled.View`
21
21
  export const PricesContainer = styled.View`
22
22
  flex-direction: row;
23
23
  align-items: center;
24
+ margin-vertical: 6px;
24
25
  `
25
26
 
26
27
  export const LogoWrapper = styled.View`
@@ -195,6 +195,9 @@ const StripeElementsFormUI = (props: any) => {
195
195
  cardStyle={{
196
196
  backgroundColor: '#FFFFFF',
197
197
  textColor: '#000000',
198
+ borderWidth: 1,
199
+ borderRadius: 8,
200
+ borderColor: theme.colors.border
198
201
  }}
199
202
  style={{
200
203
  width: '100%',
@@ -3,6 +3,7 @@ import { ImageSourcePropType, ImageStyle, ViewStyle, TextInputProps, TextStyle }
3
3
  import styled from 'styled-components/native';
4
4
  import OIcon from './OIcon';
5
5
  import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
6
+ import { useTheme } from 'styled-components/native';
6
7
 
7
8
  const Input = styled.TextInput`
8
9
  flex-grow: 1;
@@ -39,6 +40,7 @@ interface Props extends TextInputProps {
39
40
  inputStyle?: TextStyle;
40
41
  wrapperRef?: any;
41
42
  onPress?: any;
43
+ isFocusHighlight?: boolean
42
44
  }
43
45
 
44
46
  const Wrapper = styled.Pressable`
@@ -54,12 +56,16 @@ const Wrapper = styled.Pressable`
54
56
  `;
55
57
 
56
58
  const OInput = (props: Props): React.ReactElement => {
59
+ const theme = useTheme();
60
+ const [inputFocused, setInputFocused] = React.useState(false)
57
61
  return (
58
62
  <Wrapper
59
63
  onPress={() => { props.forwardRef?.current?.focus?.(); props.onPress && props.onPress() }}
60
64
  style={{
61
65
  backgroundColor: props.bgColor,
62
- borderColor: props.borderColor,
66
+ borderColor: !props.isFocusHighlight
67
+ ? props.borderColor
68
+ : inputFocused ? theme.colors.primary : theme.colors.border,
63
69
  ...props.style,
64
70
  }}>
65
71
  {props.icon ? (
@@ -95,6 +101,8 @@ const OInput = (props: Props): React.ReactElement => {
95
101
  props.forwardRef && (props.forwardRef.current = e)
96
102
  }}
97
103
  style={props?.inputStyle}
104
+ onFocus={() => setInputFocused(true)}
105
+ onBlur={() => setInputFocused(false)}
98
106
  />
99
107
  {props.iconRight && (
100
108
  <OIcon
@@ -114,6 +122,7 @@ OInput.defaultProps = {
114
122
  iconColor: '#959595',
115
123
  bgColor: 'white',
116
124
  borderColor: 'white',
125
+ isFocusHighlight: false
117
126
  };
118
127
 
119
128
  export default OInput;
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  import { useLanguage } from 'ordering-components/native';
3
3
  import FontAwesome from 'react-native-vector-icons/FontAwesome';
4
- import {CODES} from 'ordering-components/native'
4
+ import { CODES } from 'ordering-components/native'
5
5
  import { ORDER_TYPES } from '../config/constants';
6
6
 
7
7
  export const flatArray = (arr: any) => [].concat(...arr)
8
+ const [languageState, t] = useLanguage();
8
9
 
9
10
  /**
10
11
  * Function to return the traduction depending of a key 't'
@@ -43,69 +44,113 @@ export const getTraduction = (key: string) => {
43
44
  /**
44
45
  * Change local moment variables
45
46
  */
46
- export const setLocalMoment = (moment : any, t : any) => {
47
+ export const setLocalMoment = (moment: any, t: any) => {
47
48
  moment.locale('custom', {
48
49
  months: [
49
- t('MONTH1','January'),
50
- t('MONTH2','February'),
51
- t('MONTH3','March'),
52
- t('MONTH4','April'),
53
- t('MONTH5','May'),
54
- t('MONTH6','June'),
55
- t('MONTH7','July'),
56
- t('MONTH8','August'),
57
- t('MONTH9','September'),
58
- t('MONTH10','October'),
59
- t('MONTH11','November'),
60
- t('MONTH12','December')
50
+ t('MONTH1', 'January'),
51
+ t('MONTH2', 'February'),
52
+ t('MONTH3', 'March'),
53
+ t('MONTH4', 'April'),
54
+ t('MONTH5', 'May'),
55
+ t('MONTH6', 'June'),
56
+ t('MONTH7', 'July'),
57
+ t('MONTH8', 'August'),
58
+ t('MONTH9', 'September'),
59
+ t('MONTH10', 'October'),
60
+ t('MONTH11', 'November'),
61
+ t('MONTH12', 'December')
61
62
  ],
62
63
  monthsShort: [
63
- t('MONTHSHORT1','Jan'),
64
- t('MONTHSHORT2','Feb'),
65
- t('MONTHSHORT3','Mar'),
66
- t('MONTHSHORT4','Apr'),
67
- t('MONTHSHORT5','May'),
68
- t('MONTHSHORT6','Jun'),
69
- t('MONTHSHORT7','Jul'),
70
- t('MONTHSHORT8','Aug'),
71
- t('MONTHSHORT9','Sep'),
72
- t('MONTHSHORT10','Oct'),
73
- t('MONTHSHORT11','Nov'),
74
- t('MONTHSHORT12','Dec')
64
+ t('MONTHSHORT1', 'Jan'),
65
+ t('MONTHSHORT2', 'Feb'),
66
+ t('MONTHSHORT3', 'Mar'),
67
+ t('MONTHSHORT4', 'Apr'),
68
+ t('MONTHSHORT5', 'May'),
69
+ t('MONTHSHORT6', 'Jun'),
70
+ t('MONTHSHORT7', 'Jul'),
71
+ t('MONTHSHORT8', 'Aug'),
72
+ t('MONTHSHORT9', 'Sep'),
73
+ t('MONTHSHORT10', 'Oct'),
74
+ t('MONTHSHORT11', 'Nov'),
75
+ t('MONTHSHORT12', 'Dec')
75
76
  ],
76
77
  weekdays: [
77
- t('DAY7','Sunday'),
78
- t('DAY1','Monday'),
79
- t('DAY2','Tuesday'),
80
- t('DAY3','Wednesday'),
81
- t('DAY4','Thursday'),
82
- t('DAY5','Friday'),
83
- t('DAY6','Saturday')
78
+ t('DAY7', 'Sunday'),
79
+ t('DAY1', 'Monday'),
80
+ t('DAY2', 'Tuesday'),
81
+ t('DAY3', 'Wednesday'),
82
+ t('DAY4', 'Thursday'),
83
+ t('DAY5', 'Friday'),
84
+ t('DAY6', 'Saturday')
84
85
  ],
85
86
  weekdaysShort: [
86
- t('DAYSHORT7','Sun'),
87
- t('DAYSHORT1','Mon'),
88
- t('DAYSHORT2','Tue'),
89
- t('DAYSHORT3','Wed'),
90
- t('DAYSHORT4','Thu'),
91
- t('DAYSHORT5','Fri'),
92
- t('DAYSHORT6','Sat')
87
+ t('DAYSHORT7', 'Sun'),
88
+ t('DAYSHORT1', 'Mon'),
89
+ t('DAYSHORT2', 'Tue'),
90
+ t('DAYSHORT3', 'Wed'),
91
+ t('DAYSHORT4', 'Thu'),
92
+ t('DAYSHORT5', 'Fri'),
93
+ t('DAYSHORT6', 'Sat')
93
94
  ],
94
95
  weekdaysMin: [
95
- t('DAYMIN7','Su'),
96
- t('DAYMIN1','Mo'),
97
- t('DAYMIN2','Tu'),
98
- t('DAYMIN3','We'),
99
- t('DAYMIN4','Th'),
100
- t('DAYMIN5','Fr'),
101
- t('DAYMIN6','Sa')
96
+ t('DAYMIN7', 'Su'),
97
+ t('DAYMIN1', 'Mo'),
98
+ t('DAYMIN2', 'Tu'),
99
+ t('DAYMIN3', 'We'),
100
+ t('DAYMIN4', 'Th'),
101
+ t('DAYMIN5', 'Fr'),
102
+ t('DAYMIN6', 'Sa')
102
103
  ],
103
- meridiem : function (hours : any) {
104
- return hours < 12 ? t('AM', 'AM') : t('PM','PM');
104
+ meridiem: function (hours: any) {
105
+ return hours < 12 ? t('AM', 'AM') : t('PM', 'PM');
105
106
  }
106
107
  })
107
108
  }
108
109
 
110
+ export const monthsEnum: any = {
111
+ Jan: 'MONTHSHORT1',
112
+ Feb: 'MONTHSHORT2',
113
+ Mar: 'MONTHSHORT3',
114
+ Apr: 'MONTHSHORT4',
115
+ May: 'MONTHSHORT5',
116
+ Jun: 'MONTHSHORT6',
117
+ Jul: 'MONTHSHORT7',
118
+ Aug: 'MONTHSHORT8',
119
+ Sep: 'MONTHSHORT9',
120
+ Oct: 'MONTHSHORT10',
121
+ Nov: 'MONTHSHORT11',
122
+ Dec: 'MONTHSHORT12',
123
+ }
124
+
125
+ export const locale = {
126
+ name: languageState?.language?.code?.slice(0, 2),
127
+ config: {
128
+ months: [
129
+ t('MONTH1', 'January'),
130
+ t('MONTH2', 'February'),
131
+ t('MONTH3', 'March'),
132
+ t('MONTH4', 'April'),
133
+ t('MONTH5', 'May'),
134
+ t('MONTH6', 'June'),
135
+ t('MONTH7', 'July'),
136
+ t('MONTH8', 'August'),
137
+ t('MONTH9', 'September'),
138
+ t('MONTH10', 'October'),
139
+ t('MONTH11', 'November'),
140
+ t('MONTH12', 'December')
141
+ ],
142
+ weekdaysShort: [
143
+ t('DAYSHORT7', 'Sun'),
144
+ t('DAYSHORT1', 'Mon'),
145
+ t('DAYSHORT2', 'Tue'),
146
+ t('DAYSHORT3', 'Wed'),
147
+ t('DAYSHORT4', 'Thu'),
148
+ t('DAYSHORT5', 'Fri'),
149
+ t('DAYSHORT6', 'Sat')
150
+ ],
151
+ }
152
+ };
153
+
109
154
  /**
110
155
  * Function to convert delivery time in minutes
111
156
  * @param {string} time business delivery time
@@ -182,7 +227,7 @@ export const getIconCard = (brand: string, size: number) => {
182
227
  * Function to return a static google maps image based in location
183
228
  * @param {object} param object with latitude and logitude
184
229
  */
185
- export const getGoogleMapImage = ({ lat, lng }: any, apiKey: string) => {
230
+ export const getGoogleMapImage = ({ lat, lng }: any, apiKey: string) => {
186
231
  return `https://maps.googleapis.com/maps/api/staticmap?size=500x190&center=${lat},${lng}&zoom=17&scale=2&maptype=roadmap&&markers=icon:https://res.cloudinary.com/ditpjbrmz/image/upload/f_auto,q_auto,w_45,q_auto:best,q_auto:best/v1564675872/marker-customer_kvxric.png%7Ccolor:white%7C${lat},${lng}&key=${apiKey}`
187
232
  }
188
233
  /**
@@ -213,8 +258,8 @@ export const sortInputFields = ({ fields, values }: any) => {
213
258
  return fieldsSorted;
214
259
  }
215
260
 
216
- export const transformCountryCode = (countryCode : number) => {
217
- const code = CODES.find((code : any) => code.phoneCode === countryCode)
261
+ export const transformCountryCode = (countryCode: number) => {
262
+ const code = CODES.find((code: any) => code.phoneCode === countryCode)
218
263
  return code?.countryCode
219
264
  }
220
265
 
@@ -224,7 +269,7 @@ export const transformCountryCode = (countryCode : number) => {
224
269
  * @param {*} parser function fallback when is decimal
225
270
  * @returns string
226
271
  */
227
- export const verifyDecimals = (value: number, parser: any) => {
272
+ export const verifyDecimals = (value: number, parser: any) => {
228
273
  if (value % 1 === 0) {
229
274
  return value
230
275
  } else {
@@ -240,7 +285,7 @@ export const getTypesText = (value: number) => {
240
285
  /**
241
286
  * List shape for ribbon
242
287
  */
243
- export const shape = {
288
+ export const shape = {
244
289
  rectangle: 'rectangle',
245
290
  rectangleRound: 'rectangle_round',
246
291
  capsuleShape: 'capsule_shape'
@@ -251,7 +296,7 @@ export const getTypesText = (value: number) => {
251
296
  * @param {number} value for transform
252
297
  *
253
298
  */
254
- export const convertToRadian = (value: number) => {
299
+ export const convertToRadian = (value: number) => {
255
300
  return value * Math.PI / 180
256
301
  }
257
302
 
@@ -273,14 +318,14 @@ export const getDistance = (lat1: any, lon1: any, lat2: any, lon2: any) => {
273
318
  return R * c
274
319
  }
275
320
 
276
- export const formatUrlVideo = (url : string) => {
321
+ export const formatUrlVideo = (url: string) => {
277
322
  const regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/
278
323
  const match = url.match(regExp)
279
324
  const id = (match && match[7].length === 11) ? match[7] : false
280
325
  return `https://www.youtube-nocookie.com/embed/${id}`
281
326
  }
282
327
 
283
- export const formatSeconds = (seconds : number) => {
328
+ export const formatSeconds = (seconds: number) => {
284
329
  // Hours, minutes and seconds
285
330
  var hrs = ~~(seconds / 3600)
286
331
  var mins = ~~((seconds % 3600) / 60)
@@ -299,7 +344,7 @@ export const formatSeconds = (seconds : number) => {
299
344
  /**
300
345
  * List of price to filter businesses
301
346
  */
302
- export const priceList = [
347
+ export const priceList = [
303
348
  { level: '1', content: '$' },
304
349
  { level: '2', content: '$$' },
305
350
  { level: '3', content: '$$$' },