ordering-ui-react-native 0.22.64 → 0.22.66

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.22.64",
3
+ "version": "0.22.66",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -156,7 +156,8 @@ const NewOrderNotificationUI = (props: any) => {
156
156
  setCurrentEvent({ evt: 2, orderId: value?.id ?? value?.order_id })
157
157
  }
158
158
  }
159
- if ((!orderStatus.includes(value.status) && evtType !== 1 && isBusinessApp) || value?.author_id === user.id) return setCurrentEvent({
159
+ if ((!orderStatus.includes(value.status) && evtType !== 1 && isBusinessApp) || value?.author_id === user.id) return
160
+ setCurrentEvent({
160
161
  evt: evtType,
161
162
  orderId: value?.driver
162
163
  ? value?.order_id ?? value?.id
@@ -380,18 +380,18 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
380
380
  }
381
381
 
382
382
  useEffect(() => {
383
- scrollRefTab.current?.scrollTo({ animated: true });
384
- scrollListRef.current?.scrollTo({ animated: true });
385
- scrollRef.current?.scrollTo({ y: 0, animated: true });
383
+ scrollRefTab.current?.scrollTo();
384
+ scrollListRef.current?.scrollTo();
385
+ scrollRef.current?.scrollTo();
386
386
  setTags({ values: [] })
387
387
  }, [currentTabSelected])
388
388
 
389
389
  useEffect(() => {
390
390
  const unsubcribe = navigation.addListener('focus', () => {
391
- currentTabSelected === 'logisticOrders' ? loadLogisticOrders() : loadOrders && loadOrders({ newFetch: true })
391
+ currentTabSelected === 'logisticOrders' && loadLogisticOrders()
392
392
  })
393
393
  return unsubcribe
394
- }, [navigation, loadOrders, loadLogisticOrders])
394
+ }, [navigation, loadLogisticOrders])
395
395
 
396
396
  return (
397
397
  <>
@@ -77,7 +77,6 @@ export const OrderItem = React.memo((props: any) => {
77
77
  marginLeft: 3,
78
78
  },
79
79
  title: {
80
- marginBottom: showExternalId ? 0 : 6,
81
80
  fontFamily: 'Poppins',
82
81
  fontStyle: 'normal',
83
82
  fontWeight: '600',
@@ -85,7 +84,6 @@ export const OrderItem = React.memo((props: any) => {
85
84
  color: theme.colors.textGray,
86
85
  },
87
86
  date: {
88
- marginBottom: showExternalId ? 0 : 6,
89
87
  fontFamily: 'Poppins',
90
88
  fontStyle: 'normal',
91
89
  fontWeight: 'normal',
@@ -180,7 +178,7 @@ export const OrderItem = React.memo((props: any) => {
180
178
  />
181
179
  </NotificationIcon>
182
180
  )}
183
- <View style={{ flexDirection: `${showExternalId ? 'column' : 'row'}`, flexWrap: 'wrap' }}>
181
+ <View>
184
182
  {!order?.order_group_id && showExternalId && !order?.order_group && (
185
183
  <OText
186
184
  style={styles.date}
@@ -188,26 +186,28 @@ export const OrderItem = React.memo((props: any) => {
188
186
  numberOfLines={1}
189
187
  adjustsFontSizeToFit
190
188
  >
191
- {order?.external_id ?? t('NO_EXTERNAL_ID', 'No external Id ') + t('NO', 'Order No.') + order?.id}
189
+ {`${order?.external_id ?? t('NO_EXTERNAL_ID', 'No external Id ') + t('NO', 'Order No.') + order?.id}` + ' · ' + `${order?.delivery_datetime_utc
190
+ ? parseDate(order?.delivery_datetime_utc)
191
+ : parseDate(order?.delivery_datetime, { utc: false })
192
+ }`}
192
193
  </OText>
193
194
  )}
194
- <OText
195
+ {!showExternalId && (<OText
195
196
  style={styles.date}
196
197
  color={theme.colors.unselectText}
197
198
  numberOfLines={1}
198
199
  adjustsFontSizeToFit
199
200
  >
200
- {!showExternalId && ((!!order?.order_group_id && order?.order_group && isLogisticOrder
201
+ {((!!order?.order_group_id && order?.order_group && isLogisticOrder
201
202
  ? `${order?.order_group?.orders?.length} ${t('ORDERS', 'Orders')}`
202
203
  : (t('NO', 'Order No.') + order?.id)
203
- ) + ' · ')}
204
- {order?.delivery_datetime_utc
204
+ ) + ' · ' + `${order?.delivery_datetime_utc
205
205
  ? parseDate(order?.delivery_datetime_utc)
206
- : parseDate(order?.delivery_datetime, { utc: false })}
206
+ : parseDate(order?.delivery_datetime, { utc: false })}`)}
207
207
  </OText>
208
+ )}
208
209
  {((currentTabSelected === 'pending' || currentTabSelected === 'inProgress') && allowColumns?.timer) && (
209
210
  <>
210
- {!showExternalId && <OText> · </OText>}
211
211
  <OText
212
212
  style={styles.date}
213
213
  color={
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useEffect, useRef, useState } from 'react'
2
- import { View, TouchableOpacity, StyleSheet, SafeAreaView, Dimensions, Platform, KeyboardAvoidingViewBase, KeyboardAvoidingView, Keyboard, KeyboardEvent, BackHandler, ScrollView } from 'react-native'
2
+ import { View, TouchableOpacity, StyleSheet, SafeAreaView, Dimensions, Platform, KeyboardAvoidingViewBase, KeyboardAvoidingView, Keyboard, KeyboardEvent, BackHandler, ScrollView, Vibration } from 'react-native'
3
3
  import { IOScrollView } from 'react-native-intersection-observer'
4
4
  import { useSafeAreaInsets } from 'react-native-safe-area-context'
5
5
  import { useTheme } from 'styled-components/native';
@@ -687,7 +687,10 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
687
687
  btnLeftValue={currentCart?.products.reduce((prev: number, product: any) => prev + product.quantity, 0)}
688
688
  btnRightValue={parsePrice(currentCart?.total)}
689
689
  disabled={subtotalWithTaxes < currentCart?.minimum || openUpselling}
690
- handleClick={() => setOpenUpselling(true)}
690
+ handleClick={() => {
691
+ Vibration.vibrate(100)
692
+ setOpenUpselling(true)
693
+ }}
691
694
  />
692
695
  </View>
693
696
  )}
@@ -19,7 +19,7 @@ import { CouponControl } from '../CouponControl';
19
19
  import { OButton, OInput, OModal, OText } from '../shared';
20
20
  import { UpsellingProducts } from '../UpsellingProducts';
21
21
  import { verifyDecimals } from '../../utils';
22
- import { ActivityIndicator, TouchableOpacity, View } from 'react-native';
22
+ import { ActivityIndicator, TouchableOpacity, View, Vibration } from 'react-native';
23
23
  import AntIcon from 'react-native-vector-icons/AntDesign'
24
24
  import { TaxInformation } from '../TaxInformation';
25
25
  import { CartStoresListing } from '../CartStoresListing';
@@ -197,6 +197,7 @@ const CartUI = (props: any) => {
197
197
  }, cart?.subtotal)
198
198
 
199
199
  const handleClickCheckout = () => {
200
+ Vibration.vibrate(100)
200
201
  if (cart?.business_id) {
201
202
  setOpenUpselling(true)
202
203
  } else {
@@ -243,7 +244,10 @@ const CartUI = (props: any) => {
243
244
  handleClearProducts={handleClearProducts}
244
245
  handleCartOpen={handleCartOpen}
245
246
  onNavigationRedirect={props.onNavigationRedirect}
246
- handleChangeStore={() => setOpenChangeStore(true)}
247
+ handleChangeStore={() => {
248
+ Vibration.vibrate(100)
249
+ setOpenChangeStore(true)
250
+ }}
247
251
  handleClickCheckout={() => handleClickCheckout()}
248
252
  checkoutButtonDisabled={(openUpselling && !canOpenUpselling) || subtotalWithTaxes < cart?.minimum || !cart?.valid_address}
249
253
  isMultiCheckout={isMultiCheckout}
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useEffect, useState } from 'react';
2
- import { View } from 'react-native';
2
+ import { Vibration, View } from 'react-native';
3
3
  import { useLanguage, useConfig, useUtils, useOrder } from 'ordering-components/native';
4
4
  import { useTheme } from 'styled-components/native';
5
5
  import { CCContainer, CCNotCarts, CCList, CheckoutAction, ChCartsTotal } from './styles';
@@ -39,6 +39,7 @@ export const CartContent = (props: any) => {
39
39
  ?.filter((cart: any) => cart?.status !== 1 && cart?.valid && cart?.products?.length)
40
40
  ?.reduce((total: any, cart: any) => { return total + (cart?.delivery_price_with_discount) }, 0)
41
41
  const handleCheckoutRedirect = () => {
42
+ Vibration.vibrate(100)
42
43
  if (cartsAvailable.length === 1) {
43
44
  onNavigationRedirect('CheckoutNavigator', {
44
45
  screen: 'CheckoutPage',
@@ -44,6 +44,7 @@ const ProfileListUI = (props: ProfileParams) => {
44
44
  handleRemoveAccount,
45
45
  removeAccountState,
46
46
  handleChangePromotions,
47
+ appVersion
47
48
  } = props;
48
49
 
49
50
  const theme = useTheme();
@@ -151,7 +152,7 @@ const ProfileListUI = (props: ProfileParams) => {
151
152
  const detailProps = {
152
153
  goToBack: () => props.navigation?.canGoBack() && props.navigation.goBack(),
153
154
  onNavigationRedirect: (route: string, params: any) => props.navigation.navigate(route, params),
154
- handleRemoveAccount
155
+ handleRemoveAccount,
155
156
  }
156
157
 
157
158
  useEffect(() => {
@@ -271,6 +272,13 @@ const ProfileListUI = (props: ProfileParams) => {
271
272
  </Actions>
272
273
  </ListWrap>
273
274
  <WebsocketStatus />
275
+ {appVersion && (
276
+ <View
277
+ style={{ alignItems: 'center' }}
278
+ >
279
+ <OText>v{appVersion}</OText>
280
+ </View>
281
+ )}
274
282
  <OAlert
275
283
  open={confirm.open}
276
284
  title={confirm.title}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react'
2
2
  import styled, { css } from 'styled-components/native'
3
- import { Alert } from 'react-native'
3
+ import { Alert, Vibration } from 'react-native'
4
4
  import { useLanguage } from 'ordering-components/native'
5
5
 
6
6
  const Wrapper = styled.TouchableOpacity`
@@ -41,6 +41,7 @@ const OAlert = (props: Props) => {
41
41
  }
42
42
 
43
43
  const handleClick = () => {
44
+ Vibration.vibrate(100)
44
45
  props.onClick && props.onClick()
45
46
  createTwoButtonAlert()
46
47
  }
@@ -50,6 +50,7 @@ export interface ProfileParams {
50
50
  removeAccountState?: any;
51
51
  handleChangePromotions?: any;
52
52
  notificationsGroup?: any;
53
+ appVersion?: string
53
54
  }
54
55
 
55
56
  export interface AddressListParams {