ordering-ui-react-native 0.16.42 → 0.16.45

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.42",
3
+ "version": "0.16.45",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -86,6 +86,7 @@
86
86
  "react-native-google-places-autocomplete": "^2.1.3",
87
87
  "react-native-html-to-pdf": "^0.10.0",
88
88
  "react-native-image-picker": "^4.0.6",
89
+ "react-native-intersection-observer": "^0.0.9",
89
90
  "react-native-lightbox": "^0.8.1",
90
91
  "react-native-linear-gradient": "^2.5.6",
91
92
  "react-native-loading-spinner-overlay": "^2.0.0",
@@ -1,24 +1,25 @@
1
- import React, {useEffect} from 'react'
1
+ import React, { useEffect } from 'react'
2
2
  import { BusinessesListing as BusinessListingController } from '../components/BusinessesListing'
3
3
  import styled from 'styled-components/native'
4
4
  import { useTheme } from 'styled-components/native'
5
5
 
6
6
  const BusinessesListing = (props: any) => {
7
7
  const theme = useTheme()
8
- const businessId = props.route.params?.businessId
8
+ const businessId = props.route.params?.businessId
9
9
  const categoryId = props.route.params?.categoryId
10
- const productId = props.route.params?.productId
11
- const store = props.route.params?.store
10
+ const productId = props.route.params?.productId
11
+ const store = props.route.params?.store
12
12
 
13
13
  useEffect(() => {
14
- if(store){
15
- props.navigation.navigate('Business', {store,businessId,categoryId,productId})
14
+ if (store) {
15
+ props.navigation.navigate('Business', { store, businessId, categoryId, productId })
16
16
  return
17
17
  }
18
18
  }, [businessId, categoryId, productId, store])
19
19
 
20
20
  const BusinessesListingProps = {
21
21
  ...props,
22
+ navigation: props?.navigation,
22
23
  isSearchByName: true,
23
24
  isSearchByDescription: true,
24
25
  propsToFetch: ['id', 'name', 'header', 'logo', 'ribbon', 'location', 'schedule', 'open', 'delivery_price', 'distance', 'delivery_time', 'pickup_time', 'reviews', 'featured', 'offers', 'food', 'laundry', 'alcohol', 'groceries', 'slug'],
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import { OrderDetails as OrderDetailsController } from '../components/OrderDetails'
3
3
  import { SafeAreaContainer } from '../layouts/SafeAreaContainer'
4
4
 
5
- const OrderDetails = ({ navigation, route } : any) => {
5
+ const OrderDetails = ({ navigation, route }: any) => {
6
6
  const orderDetailsProps = {
7
7
  navigation,
8
8
  orderId: route.params?.orderId,
@@ -1,14 +1,14 @@
1
1
  import React from 'react'
2
2
  import { Platform } from 'react-native';
3
3
  import styled from 'styled-components/native';
4
- import {ReviewDriver as ReviewDriverController} from '../components/ReviewDriver'
4
+ import { ReviewDriver as ReviewDriverController } from '../components/ReviewDriver'
5
5
  import { SafeAreaContainer } from '../layouts/SafeAreaContainer';
6
6
 
7
7
  const KeyboardView = styled.KeyboardAvoidingView`
8
8
  flex: 1;
9
9
  `;
10
10
 
11
- const ReviewDriver = ({navigation, route} : any) => {
11
+ const ReviewDriver = ({ navigation, route }: any) => {
12
12
  const reviewDriverProps = {
13
13
  navigation,
14
14
  order: route?.params?.order,
@@ -1,14 +1,14 @@
1
1
  import React from 'react'
2
2
  import { Platform } from 'react-native';
3
3
  import styled from 'styled-components/native';
4
- import {ReviewOrder as ReviewOrderController} from '../components/ReviewOrder'
4
+ import { ReviewOrder as ReviewOrderController } from '../components/ReviewOrder'
5
5
  import { SafeAreaContainer } from '../layouts/SafeAreaContainer';
6
6
 
7
7
  const KeyboardView = styled.KeyboardAvoidingView`
8
8
  flex: 1;
9
9
  `;
10
10
 
11
- const ReviewOrder = ({navigation, route} : any) => {
11
+ const ReviewOrder = ({ navigation, route }: any) => {
12
12
  const reviewOrderProps = {
13
13
  navigation,
14
14
  order: route?.params?.order,
@@ -182,7 +182,7 @@ export const PreviousOrders = (props: any) => {
182
182
  <Timestatus style={{ backgroundColor: getStatusClassName(getDelayMinutes(order)) === 'in_time' ? '#00D27A' : getStatusClassName(getDelayMinutes(order)) === 'at_risk' ? '#FFC700' : getStatusClassName(getDelayMinutes(order)) === 'delayed' ? '#E63757' : '' }} />
183
183
  )}
184
184
  {
185
- order.business?.logo && (
185
+ !!order.business?.logo && (
186
186
  <Logo style={styles.logo}>
187
187
  <OIcon
188
188
  url={optimizeImage(
@@ -194,17 +194,17 @@ export const PreviousOrders = (props: any) => {
194
194
  </Logo>
195
195
  )}
196
196
  <Information>
197
- {order?.order_group_id && (
197
+ {!!order?.order_group_id && (
198
198
  <OText>
199
199
  <OText>{(t('INVOICE_GROUP_NO', 'Group No.') + order?.order_group_id)}</OText>
200
200
  </OText>
201
201
  )}
202
- {order.business?.name && (
202
+ {!!order.business?.name && (
203
203
  <OText numberOfLines={1} style={styles.title}>
204
204
  {order.business?.name}
205
205
  </OText>
206
206
  )}
207
- {order?.showNotification && (
207
+ {!!order?.showNotification && (
208
208
  <NotificationIcon>
209
209
  <EntypoIcon
210
210
  name="dot-single"
@@ -258,7 +258,7 @@ export const PreviousOrders = (props: any) => {
258
258
  </TouchableOpacity>
259
259
  {isLogisticOrder && (
260
260
  <AcceptOrRejectOrder>
261
- {order?.order_group_id && order?.order_group ? (
261
+ {!!order?.order_group_id && !!order?.order_group ? (
262
262
  <OButton
263
263
  text={t('VIEW_ORDER', 'View order')}
264
264
  onClick={() => handlePressOrder({ ...order, logistic_order_id: _order?.id })}
@@ -203,7 +203,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
203
203
  multiRemoveProducts && await multiRemoveProducts(unavailableProducts, _carts)
204
204
  return
205
205
  }
206
-
206
+
207
207
  if (alreadyRemoved === 'removed') {
208
208
  setAlertState({ open: true, content: [t('NOT_AVAILABLE_PRODUCT', 'This product is not available.')] })
209
209
  }
@@ -223,7 +223,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
223
223
 
224
224
  return (
225
225
  <>
226
- <ContainerSafeAreaView
226
+ <ContainerSafeAreaView
227
227
  style={{ flex: 1 }}
228
228
  isOpenFiltProducts={isOpenFiltProducts}
229
229
  >
@@ -237,7 +237,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
237
237
  imgRightSrc={null}
238
238
  style={styles.btnBackArrow}
239
239
  onClick={() => handleBackNavigation()}
240
- imgLeftStyle={{ tintColor: theme.colors.textNormal, width: 16 }}
240
+ imgLeftStyle={{ tintColor: theme.colors.textNormal, width: 30 }}
241
241
  />
242
242
  </View>
243
243
  {!errorQuantityProducts && (
@@ -255,6 +255,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
255
255
  {isOpenSearchBar && (
256
256
  <WrapSearchBar>
257
257
  <SearchBar
258
+ autoFocus
258
259
  onSearch={handleChangeSearch}
259
260
  onCancel={() => handleCancel()}
260
261
  isCancelXButtonShow
@@ -268,42 +269,42 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
268
269
  </Animated.View>
269
270
 
270
271
  {business?.categories?.length > 0 && isOpenFiltProducts && (
271
- <FiltProductsContainer
272
- isIos={Platform.OS === 'ios'}
273
- style={{
274
- height: Dimensions.get('window').height - filtProductsHeight
275
- }}
276
- >
277
- <View style={{ padding: 20, backgroundColor: theme.colors.white }}>
278
- <BusinessProductsList
279
- categories={[
280
- { id: null, name: t('ALL', 'All') },
281
- { id: 'featured', name: t('FEATURED', 'Featured') },
282
- ...business?.categories.sort((a: any, b: any) => a.rank - b.rank)
283
- ]}
284
- category={categorySelected}
285
- categoryState={categoryState}
286
- businessId={business.id}
287
- errors={errors}
288
- onProductClick={onProductClick}
289
- handleSearchRedirect={handleSearchRedirect}
290
- featured={featuredProducts}
291
- searchValue={searchValue}
292
- handleClearSearch={handleChangeSearch}
293
- errorQuantityProducts={errorQuantityProducts}
294
- handleCancelSearch={handleCancel}
295
- categoriesLayout={categoriesLayout}
296
- subcategoriesSelected={subcategoriesSelected}
297
- lazyLoadProductsRecommended={business?.lazy_load_products_recommended}
298
- setCategoriesLayout={setCategoriesLayout}
299
- currentCart={currentCart}
300
- setSubcategoriesSelected={setSubcategoriesSelected}
301
- onClickCategory={handleChangeCategory}
302
- handleUpdateProducts={handleUpdateProducts}
303
- isFiltMode
304
- />
305
- </View>
306
- </FiltProductsContainer>
272
+ <FiltProductsContainer
273
+ isIos={Platform.OS === 'ios'}
274
+ style={{
275
+ height: Dimensions.get('window').height - filtProductsHeight
276
+ }}
277
+ >
278
+ <View style={{ padding: 20, backgroundColor: theme.colors.white }}>
279
+ <BusinessProductsList
280
+ categories={[
281
+ { id: null, name: t('ALL', 'All') },
282
+ { id: 'featured', name: t('FEATURED', 'Featured') },
283
+ ...business?.categories.sort((a: any, b: any) => a.rank - b.rank)
284
+ ]}
285
+ category={categorySelected}
286
+ categoryState={categoryState}
287
+ businessId={business.id}
288
+ errors={errors}
289
+ onProductClick={onProductClick}
290
+ handleSearchRedirect={handleSearchRedirect}
291
+ featured={featuredProducts}
292
+ searchValue={searchValue}
293
+ handleClearSearch={handleChangeSearch}
294
+ errorQuantityProducts={errorQuantityProducts}
295
+ handleCancelSearch={handleCancel}
296
+ categoriesLayout={categoriesLayout}
297
+ subcategoriesSelected={subcategoriesSelected}
298
+ lazyLoadProductsRecommended={business?.lazy_load_products_recommended}
299
+ setCategoriesLayout={setCategoriesLayout}
300
+ currentCart={currentCart}
301
+ setSubcategoriesSelected={setSubcategoriesSelected}
302
+ onClickCategory={handleChangeCategory}
303
+ handleUpdateProducts={handleUpdateProducts}
304
+ isFiltMode
305
+ />
306
+ </View>
307
+ </FiltProductsContainer>
307
308
  )}
308
309
  {isOpenFiltProducts && (
309
310
  <BackgroundGray />
@@ -1,17 +1,50 @@
1
1
 
2
- import React from 'react'
2
+ import React, { useState, useEffect } from 'react'
3
+ import { useOrder, useSession } from 'ordering-components/native';
4
+
3
5
  import { useTheme } from 'styled-components/native'
4
6
  import { BusinessesListing as OriginalBusinessListing } from './Layout/Original'
5
7
  import { BusinessesListing as AppointmentBusinessListing } from './Layout/Appointment'
6
8
 
7
9
  export const BusinessesListing = (props: any) => {
8
- const theme = useTheme()
9
- const layout = theme?.layout?.businessListing?.layout?.type || 'original'
10
+ const theme = useTheme()
11
+ const layout = theme?.layout?.businessListing?.layout?.type || 'original'
12
+ const [{ auth }] = useSession()
13
+ const [, { getLastOrderHasNoReview }] = useOrder();
14
+ const [, setIsReviewed] = useState(false)
15
+ const handleOrderReview = (order: any) => {
16
+ props?.navigation && props.navigation.navigate(
17
+ 'ReviewOrder',
18
+ {
19
+ order: {
20
+ id: order?.id,
21
+ business_id: order?.business_id,
22
+ business_name: order?.business?.name,
23
+ delivery_datetime: order?.delivery_datetime,
24
+ logo: order.business?.logo,
25
+ driver: order?.driver,
26
+ products: order?.products,
27
+ review: order?.review,
28
+ user_review: order?.user_review
29
+ },
30
+ setIsReviewed
31
+ }
32
+ )
33
+ }
34
+
35
+ const _getLastOrderHasNoReview = async () => {
36
+ const lastOrderHasNoReview = await getLastOrderHasNoReview()
37
+ lastOrderHasNoReview && handleOrderReview(lastOrderHasNoReview)
38
+ }
39
+
40
+ useEffect(() => {
41
+ auth && _getLastOrderHasNoReview()
42
+ }, [auth])
10
43
 
11
- return (
44
+ return (
12
45
  <>
13
46
  {(layout === 'original') && <OriginalBusinessListing {...props} />}
14
47
  {(layout === 'appointment') && <AppointmentBusinessListing {...props} />}
15
48
  </>
16
- )
49
+ )
17
50
  }
@@ -178,7 +178,7 @@ const CheckoutUI = (props: any) => {
178
178
  }
179
179
  }
180
180
 
181
- const handlePlaceOrder = (confirmPayment) => {
181
+ const handlePlaceOrder = (confirmPayment : any) => {
182
182
  if (!userErrors.length && !requiredFields?.length) {
183
183
  handlerClickPlaceOrder && handlerClickPlaceOrder(null, null, confirmPayment)
184
184
  return
@@ -741,7 +741,7 @@ const CheckoutUI = (props: any) => {
741
741
  </Container>
742
742
  {!cartState.loading && cart && cart?.status !== 2 && (
743
743
  <FloatingButton
744
- handleClick={() => handlePlaceOrder()}
744
+ handleClick={() => handlePlaceOrder(null)}
745
745
  isSecondaryBtn={isDisabledButtonPlace}
746
746
  disabled={isDisabledButtonPlace}
747
747
  btnText={cart?.subtotal >= cart?.minimum
@@ -755,7 +755,7 @@ const CheckoutUI = (props: any) => {
755
755
  : (`${t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:')} ${parsePrice(cart?.minimum)}`)
756
756
  }
757
757
  btnRightValueShow
758
- btnRightValue={parsePrice(cart?.total)}
758
+ btnRightValue={parsePrice(cart?.balance)}
759
759
  iosBottom={30}
760
760
  />
761
761
  )}
@@ -62,7 +62,7 @@ const NavBar = (props: Props) => {
62
62
  <Wrapper style={{ paddingTop: props.paddingTop, ...{ flexDirection: props.isVertical ? 'column' : 'row', alignItems: props.isVertical ? 'flex-start' : 'center' }, ...props.style }}>
63
63
  <OButton
64
64
  imgLeftSrc={props.leftImg || theme.images.general.arrow_left}
65
- imgLeftStyle={{width: 18}}
65
+ imgLeftStyle={{ width: 18 }}
66
66
  imgRightSrc={null}
67
67
  style={{ ...btnBackArrow, ...props.btnStyle, ...props.isVertical ? (I18nManager.isRTL ? { paddingRight: 0 } : { paddingLeft: 0 }) : {} }}
68
68
  onClick={props?.onActionLeft}
@@ -126,9 +126,9 @@ NavBar.defaultProps = {
126
126
  textAlign: 'center'
127
127
  };
128
128
 
129
- const areEqual=(prevProps: { route?: any; }, nextProps: { route?: any; })=>{
130
- return prevProps.route === nextProps.route
131
- return true
129
+ const areEqual = (prevProps: { route?: any; }, nextProps: { route?: any; }) => {
130
+ return prevProps.route === nextProps.route
131
+ return true
132
132
  }
133
133
 
134
134
  export default React.memo(NavBar, areEqual);
@@ -354,6 +354,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
354
354
  id: order?.id,
355
355
  business_id: order?.business_id,
356
356
  logo: order.business?.logo,
357
+ business_name: order?.business?.name,
358
+ delivery_datetime: order?.delivery_datetime,
357
359
  driver: order?.driver,
358
360
  products: order?.products,
359
361
  review: order?.review,
@@ -370,7 +370,7 @@ export const ProductOptionsUI = (props: any) => {
370
370
  <SafeAreaView style={{ flex: 1 }}>
371
371
  <TopHeader>
372
372
  <TopActions onPress={() => handleGoBack()}>
373
- <OIcon src={theme.images.general.arrow_left} width={15} />
373
+ <OIcon src={theme.images.general.arrow_left} width={30} />
374
374
  </TopActions>
375
375
  </TopHeader>
376
376
  <ScrollView ref={scrollViewRef}>
@@ -44,7 +44,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
44
44
  photoWrapper: {
45
45
  shadowColor: theme.colors.black,
46
46
  shadowRadius: 3,
47
- shadowOffset: {width: 1, height: 4},
47
+ shadowOffset: { width: 1, height: 4 },
48
48
  elevation: 3,
49
49
  borderRadius: 8,
50
50
  shadowOpacity: 0.1,
@@ -86,11 +86,11 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
86
86
  const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
87
87
 
88
88
  const qualificationList = [
89
- { key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
89
+ { key: 1, text: t('TERRIBLE', 'Terrible'), percent: 0, parentStyle: { left: '0%' }, isInnerStyle: false, pointerColor: false },
90
90
  { key: 2, text: t('BAD', 'Bad'), percent: 0.25, parentStyle: { left: '25%' }, isInnerStyle: true, pointerColor: true },
91
91
  { key: 3, text: t('OKAY', 'Okay'), percent: 0.5, parentStyle: { left: '50%' }, isInnerStyle: true, pointerColor: true },
92
92
  { key: 4, text: t('GOOD', 'Good'), percent: 0.75, parentStyle: { left: '75%' }, isInnerStyle: true, pointerColor: true },
93
- { key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
93
+ { key: 5, text: t('GREAT', 'Great'), percent: 1, parentStyle: { right: '0%' }, isInnerStyle: false, pointerColor: false }
94
94
  ]
95
95
 
96
96
  const commentsList = reviewCommentList('driver')
@@ -204,7 +204,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
204
204
  <OIcon
205
205
  url={order?.driver?.photo}
206
206
  src={!order?.driver?.photo && theme.images.general.user}
207
- cover={order?.driver?.photo ? true: false}
207
+ cover={order?.driver?.photo ? true : false}
208
208
  width={80}
209
209
  height={80}
210
210
  />
@@ -212,7 +212,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
212
212
  <OText weight={500} style={{ marginVertical: 10 }} color={theme.colors.textNormal}>{order?.driver?.name} {order?.driver?.lastname}</OText>
213
213
  </DriverPhotoContainer>
214
214
 
215
- <View style={{flex: 1, justifyContent: 'flex-end'}}>
215
+ <View style={{ flex: 1, justifyContent: 'flex-end' }}>
216
216
  <FormReviews>
217
217
  <OText mBottom={13} color={theme.colors.textNormal}>{t('HOW_WAS_YOUR_DRIVER', 'How was your driver?')}</OText>
218
218
  <RatingBarContainer>
@@ -264,7 +264,7 @@ const ReviewDriverUI = (props: ReviewDriverParams) => {
264
264
  style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
265
265
  imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
266
266
  imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
267
- onClick={() => handleChangeComment(commentItem) }
267
+ onClick={() => handleChangeComment(commentItem)}
268
268
  />
269
269
  ))}
270
270
  </CommentsButtonGroup>
@@ -1,5 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { OrderReview as ReviewOrderController, useLanguage, useToast, ToastType } from 'ordering-components/native'
2
+ import FontAwesome from 'react-native-vector-icons/FontAwesome';
3
+ import { OrderReview as ReviewOrderController, useLanguage, useToast, ToastType, useUtils } from 'ordering-components/native'
3
4
  import { useForm, Controller } from 'react-hook-form'
4
5
  import LinearGradient from 'react-native-linear-gradient'
5
6
 
@@ -11,7 +12,9 @@ import {
11
12
  ActionContainer,
12
13
  SkipButton,
13
14
  RatingBarContainer,
14
- RatingTextContainer
15
+ RatingTextContainer,
16
+ RatingStarContainer,
17
+ PlacedDate
15
18
  } from './styles'
16
19
  import { OButton, OIcon, OInput, OText } from '../shared'
17
20
  import { TouchableOpacity, StyleSheet, View, I18nManager } from 'react-native';
@@ -88,10 +91,11 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
88
91
  const [, t] = useLanguage()
89
92
  const [, { showToast }] = useToast()
90
93
  const { handleSubmit, control, errors } = useForm()
91
-
94
+ const [{ parseDate }] = useUtils()
92
95
  const [alertState, setAlertState] = useState<{ open: boolean, content: Array<any>, success?: boolean }>({ open: false, content: [], success: false })
93
96
  const [comments, setComments] = useState<Array<any>>([])
94
97
  const [extraComment, setExtraComment] = useState('')
98
+ const placedOnDate = parseDate(order?.delivery_datetime, { outputFormat: 'dddd MMMM DD, YYYY' })
95
99
 
96
100
  const onSubmit = () => {
97
101
  if (Object.values(stars).some((value: any) => value === 0)) {
@@ -191,14 +195,15 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
191
195
  <>
192
196
  <ReviewOrderContainer>
193
197
  <NavBar
194
- title={t('REVIEW_ORDER', 'Review your Order')}
198
+ title={t('HEY', 'Hey! ') + t('HOW_WAS_YOUR_ORDER', 'How was your order?')}
195
199
  titleAlign={'center'}
200
+ leftImg={theme.images.general.close}
196
201
  onActionLeft={() => navigation?.canGoBack() && navigation.goBack()}
197
202
  showCall={false}
198
203
  btnStyle={{ paddingLeft: 0 }}
199
- style={{ flexDirection: 'column', alignItems: 'flex-start' }}
200
- titleWrapStyle={{ paddingHorizontal: 0 }}
201
- titleStyle={{ marginRight: 0, marginLeft: 0 }}
204
+ style={{ flexDirection: 'column', alignItems: 'flex-start', justifyContent: 'center' }}
205
+ titleWrapStyle={{ paddingHorizontal: 0, width: '100%', justifyContent: 'center' }}
206
+ titleStyle={{ textAlign: 'center', marginRight: 0, marginLeft: 0 }}
202
207
  />
203
208
  <BusinessLogo>
204
209
  <View style={styles.logoWrapper}>
@@ -209,6 +214,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
209
214
  />
210
215
  </View>
211
216
  </BusinessLogo>
217
+ {!!order?.business_name && <OText style={{ textAlign: 'center', marginTop: 15 }} color={theme.colors.textNormal}>{order?.business_name}</OText>}
212
218
  {order?.review ? (
213
219
  <View style={styles.reviewedStyle}>
214
220
  <OText color={theme.colors.primary}>{t('ORDER_REVIEWED', 'This order has been already reviewed')}</OText>
@@ -216,78 +222,92 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
216
222
  ) : (
217
223
  <View style={{ flex: 1, justifyContent: 'flex-end' }}>
218
224
  <FormReviews>
219
- <OText mBottom={13} color={theme.colors.textNormal}>{t('HOW_WAS_YOUR_ORDER', 'How was your order?')}</OText>
220
- <RatingBarContainer>
221
- <LinearGradient
222
- start={{ x: 0.0, y: 0.0 }}
223
- end={{ x: qualificationList[stars.quality - 1]?.percent || 0, y: 0 }}
224
- locations={[.9999, .9999]}
225
- colors={[theme.colors.primary, theme.colors.backgroundGray200]}
226
- style={styles.statusBar}
227
- />
228
- <RatingTextContainer>
229
- {qualificationList.map((qualification: any) => (
230
- <View
231
- key={qualification.key}
232
- style={{ ...qualification.parentStyle, ...styles.ratingItemContainer }}
233
- >
234
- <TouchableOpacity
235
- style={qualification.isInnerStyle && styles.ratingItem}
236
- onPress={() => handleChangeStars(qualification.key)}
237
- >
238
- <View
239
- style={{
240
- ...styles.ratingLineStyle,
241
- backgroundColor: (qualification.pointerColor && !(stars.quality >= qualification.key)) ? theme.colors.dusk : 'transparent'
242
- }}
243
- />
244
- <OText size={12} color={stars.quality === qualification.key ? theme.colors.black : theme.colors.backgroundGray200}>{qualification.text}</OText>
245
- </TouchableOpacity>
246
- </View>
247
- ))}
248
- </RatingTextContainer>
249
- </RatingBarContainer>
250
-
251
- <OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>
252
- {commentsList[stars?.quality || 1]?.title}
253
- </OText>
254
- <CommentsButtonGroup>
255
- {commentsList[stars?.quality || 1]?.list?.map(commentItem => (
256
- <OButton
257
- key={commentItem.key}
258
- text={commentItem.content}
259
- bgColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
260
- borderColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
261
- textStyle={{
262
- color: isSelectedComment(commentItem.key) ? theme.colors.white : theme.colors.black,
263
- fontSize: 13,
264
- paddingRight: isSelectedComment(commentItem.key) ? 15 : 0
265
- }}
266
- style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
267
- imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
268
- imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
269
- onClick={() => handleChangeComment(commentItem)}
270
- />
271
- ))}
272
- </CommentsButtonGroup>
273
-
274
- <OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>{t('REVIEW_COMMENT_QUESTION', 'Do you want to add something?')}</OText>
275
- <Controller
276
- control={control}
277
- defaultValue=''
278
- name='comments'
279
- render={({ onChange }: any) => (
280
- <OInput
281
- name='comments'
282
- onChange={(val: any) => {
283
- onChange(val)
284
- setExtraComment(val.target.value)
285
- }}
286
- style={styles.inputTextArea}
287
- multiline
225
+ {/* <OText mBottom={13} color={theme.colors.textNormal}>{t('HOW_WAS_YOUR_ORDER', 'How was your order?')}</OText> */}
226
+ {false && (
227
+ <RatingBarContainer>
228
+ <LinearGradient
229
+ start={{ x: 0.0, y: 0.0 }}
230
+ end={{ x: qualificationList[stars.quality - 1]?.percent || 0, y: 0 }}
231
+ locations={[.9999, .9999]}
232
+ colors={[theme.colors.primary, theme.colors.backgroundGray200]}
233
+ style={styles.statusBar}
288
234
  />
235
+ <RatingTextContainer>
236
+ {qualificationList.map((qualification: any) => (
237
+ <View
238
+ key={qualification.key}
239
+ style={{ ...qualification.parentStyle, ...styles.ratingItemContainer }}
240
+ >
241
+ <TouchableOpacity
242
+ style={qualification.isInnerStyle && styles.ratingItem}
243
+ onPress={() => handleChangeStars(qualification.key)}
244
+ >
245
+ <View
246
+ style={{
247
+ ...styles.ratingLineStyle,
248
+ backgroundColor: (qualification.pointerColor && !(stars.quality >= qualification.key)) ? theme.colors.dusk : 'transparent'
249
+ }}
250
+ />
251
+ <OText size={12} color={stars.quality === qualification.key ? theme.colors.black : theme.colors.backgroundGray200}>{qualification.text}</OText>
252
+ </TouchableOpacity>
253
+ </View>
254
+ ))}
255
+ </RatingTextContainer>
256
+ </RatingBarContainer>
257
+ )}
258
+ <RatingStarContainer>
259
+ {[...Array(5).keys()].map((index) => (<FontAwesome name={(index <= (stars?.quality - 1)) ? 'star' : 'star-o'} size={28} key={`star-symbol-${index}`} onPress={() => handleChangeStars(index + 1)} color={theme?.colors?.primary} />)
289
260
  )}
290
- />
261
+ </RatingStarContainer>
262
+ <PlacedDate>
263
+ <OText color={theme.colors.textNormal}>{t('DONOT_FORGET_RATE_YOUR_ORDER', 'Do not forget to rate your order placed on ')}</OText>
264
+ <OText color={theme.colors.textNormal} style={{ fontWeight: "bold" }}>{placedOnDate}</OText>
265
+ </PlacedDate>
266
+ {false && (
267
+ <>
268
+ <OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>
269
+ {commentsList[stars?.quality || 1]?.title}
270
+ </OText>
271
+ <CommentsButtonGroup>
272
+ {commentsList[stars?.quality || 1]?.list?.map((commentItem: any) => (
273
+ <OButton
274
+ key={commentItem.key}
275
+ text={commentItem.content}
276
+ bgColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
277
+ borderColor={isSelectedComment(commentItem.key) ? theme.colors.primary : theme.colors.backgroundGray200}
278
+ textStyle={{
279
+ color: isSelectedComment(commentItem.key) ? theme.colors.white : theme.colors.black,
280
+ fontSize: 13,
281
+ paddingRight: isSelectedComment(commentItem.key) ? 15 : 0
282
+ }}
283
+ style={{ height: 35, paddingLeft: 5, paddingRight: 5, marginHorizontal: 3, marginVertical: 10 }}
284
+ imgRightSrc={isSelectedComment(commentItem.key) ? theme.images.general.close : null}
285
+ imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
286
+ onClick={() => handleChangeComment(commentItem)}
287
+ />
288
+ ))}
289
+ </CommentsButtonGroup>
290
+ </>
291
+ )}
292
+ {/* <OText style={{ marginTop: 30 }} color={theme.colors.textNormal}>{t('REVIEW_COMMENT_QUESTION', 'Do you want to add something?')}</OText> */}
293
+ {false && (
294
+ <Controller
295
+ control={control}
296
+ defaultValue=''
297
+ name='comments'
298
+ render={({ onChange }: any) => (
299
+ <OInput
300
+ name='comments'
301
+ onChange={(val: any) => {
302
+ onChange(val)
303
+ setExtraComment(val.target.value)
304
+ }}
305
+ style={styles.inputTextArea}
306
+ multiline
307
+ />
308
+ )}
309
+ />
310
+ )}
291
311
  </FormReviews>
292
312
  </View>
293
313
  )}
@@ -302,7 +322,7 @@ export const ReviewOrderUI = (props: ReviewOrderParams) => {
302
322
  </SkipButton>
303
323
  <OButton
304
324
  textStyle={{ color: theme.colors.white, paddingRight: 10 }}
305
- text={t('CONTINUE', 'Continue')}
325
+ text={t('GOTO_REVIEW', 'Go to review')}
306
326
  style={{ borderRadius: 8 }}
307
327
  imgRightSrc={theme.images.general.arrow_right}
308
328
  imgRightStyle={{ tintColor: theme.colors.white, right: 5, margin: 5 }}
@@ -42,3 +42,12 @@ export const RatingTextContainer = styled.View`
42
42
  justify-content: space-between;
43
43
  margin-top: 10px;
44
44
  `
45
+ export const RatingStarContainer = styled.View`
46
+ flex-direction: row;
47
+ align-items: center;
48
+ justify-content: space-between;
49
+ margin-top: 10px;
50
+ `
51
+ export const PlacedDate = styled.View`
52
+ margin-top: 30px;
53
+ `
@@ -25,7 +25,8 @@ export const SearchBar = (props: any) => {
25
25
  blurOnSubmit,
26
26
  inputContainerStyles,
27
27
  containerStyles,
28
- hideIcon
28
+ hideIcon,
29
+ autoFocus
29
30
  } = props
30
31
 
31
32
  const theme = useTheme();
@@ -82,15 +83,16 @@ export const SearchBar = (props: any) => {
82
83
  return (
83
84
  <Pressable style={[styles.container, containerStyles, { height: height }]}>
84
85
  <OInput
86
+ autoFocus={autoFocus}
85
87
  value={searchValue}
86
88
  onChange={onChangeSearch}
87
- style={{...styles.inputStyle, ...inputContainerStyles}}
89
+ style={{ ...styles.inputStyle, ...inputContainerStyles }}
88
90
  placeholder={placeholder}
89
91
  icon={!hideIcon && theme.images.general.search}
90
92
  isDisabled={isDisabled}
91
93
  iconStyle={{ width: 12 }}
92
94
  returnKeyType='done'
93
- inputStyle={{padding: 0, paddingTop: Platform.OS == 'android' ? 2 : 0, ...inputStyle}}
95
+ inputStyle={{ padding: 0, paddingTop: Platform.OS == 'android' ? 2 : 0, ...inputStyle }}
94
96
  onPress={() => onPress && onPress()}
95
97
  iconCustomRight={iconCustomRight}
96
98
  onSubmitEditing={() => onSubmitEditing && onSubmitEditing()}
@@ -271,16 +271,16 @@ const ProfileUI = (props: ProfileParams) => {
271
271
  }, [verifyPhoneState])
272
272
 
273
273
  const handleSendPhoneCode = (values: any) => {
274
- setWillVerifyOtpState(false)
274
+ setWillVerifyOtpState(false)
275
275
  setIsModalVisible(false)
276
- setFormState({
277
- ...formState,
278
- changes: {
279
- ...formState?.changes,
280
- verification_code: values?.code
281
- }
282
- })
283
- }
276
+ setFormState({
277
+ ...formState,
278
+ changes: {
279
+ ...formState?.changes,
280
+ verification_code: values?.code
281
+ }
282
+ })
283
+ }
284
284
 
285
285
  return (
286
286
  <>
@@ -289,7 +289,7 @@ const ProfileUI = (props: ProfileParams) => {
289
289
  titleAlign={'center'}
290
290
  onActionLeft={() => navigation.goBack()}
291
291
  showCall={false}
292
- style={{ paddingHorizontal: 40, paddingVertical: Platform.OS === 'ios' ? 0 : 30 , marginTop: Platform.OS === 'ios' ? 50 : 40 }}
292
+ style={{ paddingHorizontal: 40, paddingVertical: Platform.OS === 'ios' ? 0 : 30 }}
293
293
  />
294
294
  <KeyboardAvoidingView behavior={Platform.OS == 'ios' ? 'padding' : 'height'} enabled style={{ flex: 1, flexDirection: 'column', justifyContent: 'center' }}>
295
295
  <Container noPadding>
@@ -56,7 +56,7 @@ const Wrapper = styled.Pressable`
56
56
  const OInput = (props: Props): React.ReactElement => {
57
57
  return (
58
58
  <Wrapper
59
- onPress={() => {props.forwardRef?.current?.focus?.(); props.onPress && props.onPress()}}
59
+ onPress={() => { props.forwardRef?.current?.focus?.(); props.onPress && props.onPress() }}
60
60
  style={{
61
61
  backgroundColor: props.bgColor,
62
62
  borderColor: props.borderColor,
@@ -75,6 +75,7 @@ const OInput = (props: Props): React.ReactElement => {
75
75
  <MaterialIcon name={props?.vertorIcon} size={20} color={props?.vectorIconColor} style={{ marginHorizontal: 10 }} />
76
76
  )}
77
77
  <Input
78
+ autoFocus={props?.autoFocus}
78
79
  name={props.name}
79
80
  secureTextEntry={props.isSecured}
80
81
  onChangeText={(txt: any) => props.name ? props.onChange({ target: { name: props.name, value: txt } }) : props.onChange(txt)}
@@ -90,7 +91,7 @@ const OInput = (props: Props): React.ReactElement => {
90
91
  returnKeyType={props.returnKeyType}
91
92
  onSubmitEditing={props.onSubmitEditing}
92
93
  blurOnSubmit={props.blurOnSubmit}
93
- ref={(e : any) => {
94
+ ref={(e: any) => {
94
95
  props.forwardRef && (props.forwardRef.current = e)
95
96
  }}
96
97
  style={props?.inputStyle}
@@ -415,7 +415,7 @@ export interface ProductItemAccordionParams {
415
415
  isFromCheckout?: any
416
416
  }
417
417
  export interface ReviewOrderParams {
418
- order?: { id: number, businessId: number, logo: string, driver: any, products: Array<any>, review: any, user_review: any },
418
+ order?: { id: number, businessId: number, business_name?: string, delivery_datetime?: string, logo: string, driver: any, products: Array<any>, review: any, user_review: any },
419
419
  stars?: any,
420
420
  handleChangeInput?: any,
421
421
  handleChangeRating?: any,