ordering-ui-react-native 0.15.66-test → 0.15.68

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.15.66-test",
3
+ "version": "0.15.68",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -90,7 +90,7 @@
90
90
  "react-native-linear-gradient": "^2.5.6",
91
91
  "react-native-loading-spinner-overlay": "^2.0.0",
92
92
  "react-native-map-link": "^2.8.2",
93
- "react-native-maps": "0.31.1",
93
+ "react-native-maps": "^0.28.0",
94
94
  "react-native-modal-dropdown": "^1.0.1",
95
95
  "react-native-onesignal": "^4.1.1",
96
96
  "react-native-paper": "^4.7.2",
@@ -34,6 +34,7 @@ export const getTraduction = (key: string, t: any) => {
34
34
  ERROR_ADD_PRODUCT_VERY_FAR_FOR_DELIVERY: 'Error adding product, very far for delivery',
35
35
  ERROR_PRODUCT_NOT_FOUND: 'Error with the product',
36
36
  ERROR_ADD_BUSINESS_INVALID: 'An error occurred with the business',
37
+ ERROR_INVALID_OFFER: 'The offer doesn\'t exist'
37
38
  }
38
39
 
39
40
  return keyList[key] ? t(key, keyList[key]) : t(key)
@@ -45,7 +45,7 @@ import { UpsellingProducts } from './src/components/UpsellingProducts';
45
45
  import { UserVerification } from './src/components/UserVerification';
46
46
  import { BusinessListingSearch } from './src/components/BusinessListingSearch';
47
47
  import { LastOrders } from './src/components/LastOrders';
48
- import NavBar from './src/components/NavBar';
48
+ import NavBar from './src/components/NavBar';
49
49
  import { BusinessTypeFilter } from './src/components/BusinessTypeFilter';
50
50
  import { BusinessController } from './src/components/BusinessController';
51
51
  import { BusinessFeaturedController } from './src/components/BusinessFeaturedController';
@@ -81,17 +81,17 @@ import { SingleProductReview } from './src/components/SingleProductReview';
81
81
  import { LogoutButton } from './src/components/LogoutButton';
82
82
  import { UserFormDetailsUI } from './src/components/UserFormDetails';
83
83
  import { WalletTransactionItem } from './src/components/WalletTransactionItem';
84
-
84
+ import { Promotions } from './src/components/Promotions'
85
85
  import { USER_TYPE, ORDER_TYPES } from './src/config/constants'
86
86
 
87
87
  import { OSBill, OSTable, OSCoupon, OSTotal, OSRow } from './src/components/OrderSummary/styles';
88
88
 
89
89
  import { FormInput, FormSide, ButtonsWrapper, LoginWith, OTab, OTabs } from './src/components/LoginForm/styles';
90
- import { OSItem, OSItemContent, OSItemActions} from './src/components/PaymentOptionStripe/styles';
90
+ import { OSItem, OSItemContent, OSItemActions } from './src/components/PaymentOptionStripe/styles';
91
91
 
92
92
  import Alert from './src/providers/AlertProvider'
93
93
 
94
- import {
94
+ import {
95
95
  LoginParams,
96
96
  ProfileParams,
97
97
  AddressListParams,
@@ -134,7 +134,7 @@ import {
134
134
  OAlert,
135
135
  OModal,
136
136
  OBottomPopup,
137
- HeaderTitle
137
+ HeaderTitle
138
138
  } from './src/components/shared';
139
139
 
140
140
  import { Container } from './src/layouts/Container';
@@ -176,7 +176,7 @@ export {
176
176
  BusinessMenuList,
177
177
  UserProfile,
178
178
  MessageListing,
179
- Messages,
179
+ Messages,
180
180
  Help,
181
181
  HelpAccountAndPayment,
182
182
  HelpGuide,
@@ -231,7 +231,7 @@ export {
231
231
  LogoutButton,
232
232
  UserFormDetailsUI,
233
233
  WalletTransactionItem,
234
-
234
+ Promotions,
235
235
  ORDER_TYPES,
236
236
  USER_TYPE,
237
237
 
@@ -296,7 +296,7 @@ export {
296
296
  OAlert,
297
297
  OModal,
298
298
  OBottomPopup,
299
- HeaderTitle,
299
+ HeaderTitle,
300
300
 
301
301
  // layout
302
302
  Container,
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect, useRef } from 'react'
2
2
  import { Dimensions, StyleSheet, View, Platform } from 'react-native';
3
- import MapView, { PROVIDER_DEFAULT, PROVIDER_GOOGLE, Marker, Region, enableLatestRenderer} from 'react-native-maps'
3
+ import MapView, { PROVIDER_DEFAULT, PROVIDER_GOOGLE, Marker, Region, } from 'react-native-maps'
4
4
  import Geocoder from 'react-native-geocoding';
5
5
  import { useLanguage, useConfig } from 'ordering-components/native'
6
6
  import { GoogleMapsParams } from '../../types';
@@ -152,26 +152,11 @@ export const GoogleMap = (props: GoogleMapsParams) => {
152
152
  animated: true,
153
153
  });
154
154
  }
155
-
156
- const handleEnableLatestRenderer = async () => {
157
- try {
158
- const result = await enableLatestRenderer()
159
- if (result == 'LATEST') {
160
- setMapErrors && setMapErrors('Latest')
161
- }else {
162
- setMapErrors && setMapErrors('Legacy')
163
- }
164
-
165
- } catch (error: any) {
166
- setMapErrors && setMapErrors(error)
167
- }
168
- }
169
155
 
170
156
  useEffect(() => {
171
- handleEnableLatestRenderer()
172
157
  Geocoder.init(googleMapsApiKey)
173
158
  }, [])
174
-
159
+
175
160
 
176
161
  useEffect(() => {
177
162
  if (saveLocation) {
@@ -94,6 +94,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
94
94
  const [isReviewed, setIsReviewed] = useState(false)
95
95
  const [openTaxModal, setOpenTaxModal] = useState<any>({ open: false, tax: null, type: '' })
96
96
  const { order, businessData } = props.order;
97
+ const mapValidStatuses = [9, 19, 23]
97
98
 
98
99
  const walletName: any = {
99
100
  cash: {
@@ -680,7 +681,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
680
681
  )}
681
682
  {order?.driver && (
682
683
  <>
683
- {order?.driver?.location && parseInt(order?.status) === 9 && (
684
+ {order?.driver?.location && mapValidStatuses.includes(parseInt(order?.status)) && (
684
685
  <Map>
685
686
  <GoogleMap
686
687
  location={order?.driver?.location}
@@ -24,15 +24,6 @@ export const SearchBarContainer = styled.View`
24
24
  width: 100%;
25
25
  justify-content: flex-start;
26
26
  margin-bottom: 20px;
27
- .search-bar {
28
- justify-content: flex-start;
29
- input {
30
- width: 100%;
31
- }
32
- }
33
- .clear {
34
- right: 0;
35
- }
36
27
  `
37
28
 
38
29
  export const SingleBusinessOffer = styled.View`
@@ -48,11 +39,6 @@ export const OfferData = styled.View`
48
39
  display: flex;
49
40
  align-items: center;
50
41
  flex-direction: column;
51
- p{
52
- color: #909BA9;
53
- margin: 3px;
54
- font-size: 14px;
55
- }
56
42
  `
57
43
 
58
44
  export const Code = styled.View`
@@ -62,14 +48,7 @@ export const Code = styled.View`
62
48
  margin-bottom: 10px;
63
49
  `
64
50
 
65
- export const ValueOfOffer = styled.View`
66
- p{
67
- font-size: 16px;
68
- }
69
- span{
70
- font-size: 20px;
71
- }
72
- `
51
+ export const ValueOfOffer = styled.View``
73
52
 
74
53
  export const BusinessInfo = styled.View`
75
54
  flex: 1;
@@ -109,7 +109,7 @@ const ProfileListUI = (props: ProfileParams) => {
109
109
  const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
110
110
 
111
111
  const isWalletEnabled = configs?.wallet_enabled?.value === '1' && (configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
112
- const IsPromotionsEnabled = configs?.advanced_offers_module === '1' || configs?.advanced_offers_module === 'true'
112
+ const IsPromotionsEnabled = configs?.advanced_offers_module?.value === '1' || configs?.advanced_offers_module?.value === true
113
113
  const onRedirect = (route: string, params?: any) => {
114
114
  navigation.navigate(route, params)
115
115
  }
@@ -63,7 +63,7 @@ const WalletsUI = (props: any) => {
63
63
 
64
64
  const currentWalletSelected = (walletList.wallets?.length > 0 && walletList.wallets?.find((w: any) => w.type === tabSelected)) ?? null
65
65
 
66
- const loyaltyLevel = Object.keys(user?.loyalty_level).length > 0 && user?.loyalty_level
66
+ const loyaltyLevel = Object.keys(user?.loyalty_level ?? {}).length > 0 && user?.loyalty_level
67
67
 
68
68
  const walletName: any = {
69
69
  cash: {
@@ -33,7 +33,8 @@ export const getTraduction = (key: string) => {
33
33
  ERROR_PLACE_PAY_WITH_CARD1: 'An error occurred while trying to pay by card',
34
34
  ERROR_PLACE_PAY_WITH_PAYPAL_CAPTURE: 'An error occurred while trying to pay by PayPal',
35
35
  ERROR_ADD_PRODUCT_VERY_FAR_FOR_DELIVERY: 'Error adding product, very far for delivery',
36
- ERROR_PRODUCT_NOT_FOUND: 'Error with the product'
36
+ ERROR_PRODUCT_NOT_FOUND: 'Error with the product',
37
+ ERROR_INVALID_OFFER: 'The offer doesn\'t exist'
37
38
  }
38
39
 
39
40
  return keyList[key] ? t(key, keyList[key]) : t(key)