ordering-ui-react-native 0.16.75 → 0.16.76-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 +6 -5
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/BusinessInformation/index.tsx +19 -4
- package/src/components/BusinessInformation/styles.tsx +2 -2
- package/src/components/BusinessProductsList/index.tsx +10 -10
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/Messages/index.tsx +2 -2
- package/src/components/OrderCreating/index.tsx +2 -2
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +298 -347
- package/src/components/PaymentOptionsWebView/index.tsx +119 -120
- package/src/components/SingleProductReview/index.tsx +7 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OToast.tsx +4 -4
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/utils/index.tsx +2 -1
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +260 -238
- package/themes/business/src/components/AcceptOrRejectOrder/styles.tsx +6 -4
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +31 -31
- package/themes/business/src/components/DriverMap/index.tsx +7 -5
- package/themes/business/src/components/LoginForm/Otp/index.tsx +120 -0
- package/themes/business/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/business/src/components/LoginForm/index.tsx +332 -140
- package/themes/business/src/components/LoginForm/styles.tsx +10 -0
- package/themes/business/src/components/MapView/index.tsx +14 -3
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/NewOrderNotification/index.tsx +31 -41
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +70 -43
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +3 -3
- package/themes/business/src/components/OrdersOption/index.tsx +63 -73
- package/themes/business/src/components/OrdersOption/styles.tsx +5 -1
- package/themes/business/src/components/OrdersOptionBusiness/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionCity/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDate/index.tsx +19 -6
- package/themes/business/src/components/OrdersOptionDelivery/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionDriver/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionPaymethod/index.tsx +15 -1
- package/themes/business/src/components/OrdersOptionStatus/index.tsx +10 -1
- package/themes/business/src/components/PreviousMessages/index.tsx +17 -18
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +250 -0
- package/themes/business/src/components/PreviousOrders/OrdersGroupedItem.tsx +115 -0
- package/themes/business/src/components/PreviousOrders/index.tsx +440 -245
- package/themes/business/src/components/PreviousOrders/styles.tsx +31 -3
- package/themes/business/src/components/ProductItemAccordion/index.tsx +24 -5
- package/themes/business/src/components/ReviewCustomer/index.tsx +39 -15
- package/themes/business/src/components/shared/ODropDown.tsx +42 -8
- package/themes/business/src/components/shared/ODropDownCalendar.tsx +36 -7
- package/themes/business/src/components/shared/OLink.tsx +33 -13
- package/themes/business/src/components/shared/OText.tsx +8 -2
- package/themes/business/src/types/index.tsx +29 -3
- package/themes/business/src/utils/index.tsx +26 -0
- package/themes/doordash/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/doordash/src/components/LoginForm/index.tsx +1 -2
- package/themes/instacart/src/components/BusinessesListing/index.tsx +1 -1
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/LoginForm/Otp/index.tsx +92 -0
- package/themes/kiosk/src/components/LoginForm/Otp/styles.tsx +7 -0
- package/themes/kiosk/src/components/LoginForm/index.tsx +545 -112
- package/themes/kiosk/src/components/LoginForm/styles.tsx +18 -0
- package/themes/kiosk/src/components/NavBar/index.tsx +14 -14
- package/themes/kiosk/src/components/OptionCard/index.tsx +1 -1
- package/themes/kiosk/src/components/OrderTypeCardSelector/index.tsx +8 -10
- package/themes/kiosk/src/components/PhoneInputNumber/index.tsx +1 -0
- package/themes/kiosk/src/components/PhoneInputNumber/styles.tsx +1 -3
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/kiosk/src/components/shared/OButton.tsx +5 -18
- package/themes/kiosk/src/components/shared/OModal.tsx +14 -11
- package/themes/kiosk/src/layouts/Container.tsx +7 -1
- package/themes/kiosk/src/types/index.d.ts +15 -0
- package/themes/kiosk/src/utils/index.tsx +15 -0
- package/themes/original/index.tsx +8 -0
- package/themes/original/src/components/AddressDetails/index.tsx +10 -8
- package/themes/original/src/components/AddressForm/index.tsx +155 -139
- package/themes/original/src/components/AddressList/index.tsx +18 -18
- package/themes/original/src/components/AddressList/styles.tsx +4 -2
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +47 -22
- package/themes/original/src/components/BusinessController/index.tsx +101 -70
- package/themes/original/src/components/BusinessController/styles.tsx +14 -9
- package/themes/original/src/components/BusinessInformation/index.tsx +10 -31
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -6
- package/themes/original/src/components/BusinessListingSearch/BusinessControllerSkeletons/index.tsx +57 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/index.tsx +59 -0
- package/themes/original/src/components/BusinessListingSearch/MaxSectionItem/styles.tsx +13 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +104 -155
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +10 -12
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +87 -0
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/styles.tsx +12 -0
- package/themes/original/src/components/BusinessProductsList/index.tsx +26 -52
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +563 -493
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +13 -12
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +3 -2
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +116 -81
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +1 -9
- package/themes/original/src/components/BusinessesListing/index.tsx +7 -6
- package/themes/original/src/components/Cart/index.tsx +75 -40
- package/themes/original/src/components/CartContent/index.tsx +80 -18
- package/themes/original/src/components/CartContent/styles.tsx +11 -1
- package/themes/original/src/components/Checkout/index.tsx +102 -108
- package/themes/original/src/components/Checkout/styles.tsx +4 -3
- package/themes/original/src/components/CitiesControl/index.tsx +89 -0
- package/themes/original/src/components/CitiesControl/styles.tsx +17 -0
- package/themes/original/src/components/DriverTips/index.tsx +47 -37
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/Favorite/index.tsx +7 -4
- package/themes/original/src/components/Favorite/styles.tsx +1 -1
- package/themes/original/src/components/FavoriteList/index.tsx +70 -80
- package/themes/original/src/components/FloatingButton/index.tsx +1 -2
- package/themes/original/src/components/FloatingButton/styles.tsx +1 -1
- package/themes/original/src/components/GPSButton/index.tsx +20 -19
- package/themes/original/src/components/GPSButton/styles.ts +3 -3
- package/themes/original/src/components/GoogleMap/index.tsx +10 -1
- package/themes/original/src/components/Help/index.tsx +8 -8
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +14 -20
- package/themes/original/src/components/HelpAccountAndPayment/styles.tsx +6 -0
- package/themes/original/src/components/HelpGuide/index.tsx +13 -12
- package/themes/original/src/components/HelpGuide/styles.tsx +6 -0
- package/themes/original/src/components/HelpOrder/index.tsx +12 -20
- package/themes/original/src/components/HelpOrder/styles.tsx +8 -1
- package/themes/original/src/components/LanguageSelector/index.tsx +19 -14
- package/themes/original/src/components/LastOrder/index.tsx +1 -34
- package/themes/original/src/components/LoginForm/Otp/index.tsx +89 -73
- package/themes/original/src/components/LoginForm/Otp/styles.tsx +0 -1
- package/themes/original/src/components/LoginForm/index.tsx +98 -41
- package/themes/original/src/components/LottieAnimation/index.tsx +78 -0
- package/themes/original/src/components/MessageListing/index.tsx +7 -40
- package/themes/original/src/components/Messages/index.tsx +42 -26
- package/themes/original/src/components/MomentOption/index.tsx +23 -14
- package/themes/original/src/components/MultiCart/index.tsx +50 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +92 -93
- package/themes/original/src/components/MultiCheckout/index.tsx +158 -77
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +37 -224
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +85 -34
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +1 -1
- package/themes/original/src/components/MyOrders/index.tsx +66 -17
- package/themes/original/src/components/NavBar/index.tsx +7 -6
- package/themes/original/src/components/NetworkError/index.tsx +5 -3
- package/themes/original/src/components/NotFoundSource/index.tsx +2 -1
- package/themes/original/src/components/Notifications/index.tsx +144 -0
- package/themes/original/src/components/Notifications/styles.tsx +20 -0
- package/themes/original/src/components/OrderDetails/index.tsx +108 -218
- package/themes/original/src/components/OrderDetails/styles.tsx +10 -1
- package/themes/original/src/components/OrderItAgain/index.tsx +46 -43
- package/themes/original/src/components/OrderProgress/index.tsx +81 -105
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/OrderSummary/index.tsx +2 -2
- package/themes/original/src/components/OrderTypeSelector/index.tsx +13 -6
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +93 -97
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +3 -0
- package/themes/original/src/components/OrdersOption/index.tsx +86 -92
- package/themes/original/src/components/PageBanner/index.tsx +146 -0
- package/themes/original/src/components/PageBanner/styles.tsx +11 -0
- package/themes/original/src/components/PaymentOptionStripe/styles.tsx +1 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +1 -1
- package/themes/original/src/components/PhoneInputNumber/index.tsx +1 -1
- package/themes/original/src/components/PlaceSpot/index.tsx +16 -6
- package/themes/original/src/components/PreviousOrders/index.tsx +3 -2
- package/themes/original/src/components/ProductForm/index.tsx +240 -254
- package/themes/original/src/components/ProductForm/styles.tsx +5 -8
- package/themes/original/src/components/ProductItemAccordion/index.tsx +199 -128
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +18 -10
- package/themes/original/src/components/ProductOptionSubOption/styles.tsx +1 -2
- package/themes/original/src/components/ProfessionalFilter/SingleProfessionalCard/index.tsx +108 -0
- package/themes/original/src/components/ProfessionalFilter/index.tsx +20 -49
- package/themes/original/src/components/ProfessionalProfile/index.tsx +20 -9
- package/themes/original/src/components/Promotions/index.tsx +234 -220
- package/themes/original/src/components/Promotions/styles.tsx +7 -2
- package/themes/original/src/components/ReviewDriver/index.tsx +3 -3
- package/themes/original/src/components/ReviewOrder/index.tsx +43 -11
- package/themes/original/src/components/ReviewOrder/styles.tsx +7 -0
- package/themes/original/src/components/ReviewProducts/index.tsx +8 -5
- package/themes/original/src/components/ReviewTrigger/index.tsx +27 -9
- package/themes/original/src/components/ReviewTrigger/styles.tsx +8 -1
- package/themes/original/src/components/ScheduleAccordion/index.tsx +68 -0
- package/themes/original/src/components/ScheduleAccordion/styles.tsx +14 -0
- package/themes/original/src/components/ServiceForm/index.tsx +360 -265
- package/themes/original/src/components/Sessions/index.tsx +11 -8
- package/themes/original/src/components/Sessions/styles.tsx +5 -0
- package/themes/original/src/components/SignupForm/index.tsx +150 -100
- package/themes/original/src/components/SingleOrderCard/index.tsx +125 -56
- package/themes/original/src/components/SingleOrderCard/styles.tsx +10 -8
- package/themes/original/src/components/SingleProductCard/index.tsx +116 -79
- package/themes/original/src/components/SingleProductCard/styles.tsx +14 -13
- package/themes/original/src/components/SingleProductReview/index.tsx +38 -5
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeCardsList/index.tsx +1 -1
- package/themes/original/src/components/StripeElementsForm/index.tsx +3 -0
- package/themes/original/src/components/UpsellingProducts/index.tsx +244 -215
- package/themes/original/src/components/UpsellingProducts/styles.tsx +12 -1
- package/themes/original/src/components/UserDetails/index.tsx +5 -3
- package/themes/original/src/components/UserFormDetails/index.tsx +50 -54
- package/themes/original/src/components/UserProfile/index.tsx +58 -35
- package/themes/original/src/components/UserProfile/styles.ts +17 -0
- package/themes/original/src/components/UserProfileForm/index.tsx +21 -28
- package/themes/original/src/components/UserProfileForm/styles.tsx +7 -0
- package/themes/original/src/components/WalletTransactions/index.tsx +76 -0
- package/themes/original/src/components/WalletTransactions/styles.tsx +13 -0
- package/themes/original/src/components/Wallets/index.tsx +177 -164
- package/themes/original/src/components/Wallets/styles.tsx +12 -8
- package/themes/original/src/components/shared/CardAnimation.tsx +47 -0
- package/themes/original/src/components/shared/HeaderTitle.tsx +8 -3
- package/themes/original/src/components/shared/OBottomPopup.tsx +6 -4
- package/themes/original/src/components/shared/OButton.tsx +9 -4
- package/themes/original/src/components/shared/OIcon.tsx +8 -1
- package/themes/original/src/components/shared/OInput.tsx +10 -1
- package/themes/original/src/layouts/Container.tsx +13 -9
- package/themes/original/src/types/index.tsx +42 -7
- package/themes/original/src/utils/index.tsx +322 -58
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -21,6 +21,7 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
21
21
|
customerMarkerGroups,
|
|
22
22
|
alertState,
|
|
23
23
|
setAlertState,
|
|
24
|
+
setDriverLocation,
|
|
24
25
|
onNavigationRedirect,
|
|
25
26
|
getBusinessLocations,
|
|
26
27
|
} = props;
|
|
@@ -102,7 +103,7 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
102
103
|
return () => {
|
|
103
104
|
stopFollowUserLocation();
|
|
104
105
|
};
|
|
105
|
-
}, []);
|
|
106
|
+
}, [isFocused]);
|
|
106
107
|
|
|
107
108
|
useFocusEffect(
|
|
108
109
|
useCallback(() => {
|
|
@@ -191,7 +192,7 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
191
192
|
{((customer && marker?.business?.zipcode) || (!customer && marker?.business?.zipcode)) && (
|
|
192
193
|
<OText>{customer ? marker?.customer?.zipcode : marker?.business?.zipcode}</OText>
|
|
193
194
|
)}
|
|
194
|
-
{customer && marker?.customer?.internal_number && (
|
|
195
|
+
{customer && !!marker?.customer?.internal_number && (
|
|
195
196
|
<OText>{marker?.customer?.internal_number}</OText>
|
|
196
197
|
)}
|
|
197
198
|
<OText textDecorationLine='underline' color={theme.colors.primary}>
|
|
@@ -211,6 +212,16 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
211
212
|
)
|
|
212
213
|
}
|
|
213
214
|
|
|
215
|
+
useEffect(() => {
|
|
216
|
+
if (userLocation.latitude !== 0 && userLocation.longitude !== 0) {
|
|
217
|
+
const location = {
|
|
218
|
+
lat: userLocation.latitude,
|
|
219
|
+
lng: userLocation.longitude
|
|
220
|
+
}
|
|
221
|
+
setDriverLocation({ location })
|
|
222
|
+
}
|
|
223
|
+
}, [userLocation])
|
|
224
|
+
|
|
214
225
|
return (
|
|
215
226
|
<SafeAreaView style={{ flex: 1 }}>
|
|
216
227
|
<View style={{ flex: 1 }}>
|
|
@@ -241,7 +252,7 @@ const MapViewComponent = (props: MapViewParams) => {
|
|
|
241
252
|
orderIds={marker.map((order: any) => order.id).join(', ')}
|
|
242
253
|
/>
|
|
243
254
|
))}
|
|
244
|
-
{Object.values(customerMarkerGroups).map((marker: any) =>
|
|
255
|
+
{Object.values(customerMarkerGroups).map((marker: any) => (
|
|
245
256
|
<RenderMarker
|
|
246
257
|
key={marker[0]?.customer_id}
|
|
247
258
|
marker={marker[0]}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
StyleSheet,
|
|
6
6
|
Dimensions,
|
|
7
7
|
ScrollView,
|
|
8
|
+
RefreshControl,
|
|
8
9
|
} from 'react-native';
|
|
9
10
|
import { Contacts, useLanguage } from 'ordering-components/native';
|
|
10
11
|
import { useTheme } from 'styled-components/native';
|
|
@@ -24,6 +25,7 @@ const MessagesOptionUI = (props: MessagesOptionParams) => {
|
|
|
24
25
|
messages,
|
|
25
26
|
onNavigationRedirect,
|
|
26
27
|
setSortBy,
|
|
28
|
+
getOrders
|
|
27
29
|
} = props;
|
|
28
30
|
|
|
29
31
|
const theme = useTheme();
|
|
@@ -55,6 +57,7 @@ const MessagesOptionUI = (props: MessagesOptionParams) => {
|
|
|
55
57
|
const [tabsFilter, setTabsFilter] = useState(tabs[0].tags);
|
|
56
58
|
const [activeTag, setActiveTag] = useState(tags[0].key);
|
|
57
59
|
const [reload, setReload] = useState(false);
|
|
60
|
+
const [refreshing] = useState(false);
|
|
58
61
|
const [unreadMessages, setUnreadMessages] = useState(
|
|
59
62
|
values?.reduce(
|
|
60
63
|
(total: number, order: any) => total + order.unread_count,
|
|
@@ -247,7 +250,14 @@ const MessagesOptionUI = (props: MessagesOptionParams) => {
|
|
|
247
250
|
/>
|
|
248
251
|
)}
|
|
249
252
|
|
|
250
|
-
<ScrollView
|
|
253
|
+
<ScrollView
|
|
254
|
+
showsVerticalScrollIndicator={false}
|
|
255
|
+
style={{ flex: 1 }}
|
|
256
|
+
refreshControl={<RefreshControl
|
|
257
|
+
refreshing={refreshing}
|
|
258
|
+
onRefresh={() => getOrders?.()}
|
|
259
|
+
/>}
|
|
260
|
+
>
|
|
251
261
|
{!reload &&
|
|
252
262
|
!error &&
|
|
253
263
|
values.length > 0 &&
|
|
@@ -14,6 +14,8 @@ Sound.setCategory('Playback')
|
|
|
14
14
|
|
|
15
15
|
const windowWidth = Dimensions.get('screen').width
|
|
16
16
|
|
|
17
|
+
const SOUND_LOOP = 3
|
|
18
|
+
|
|
17
19
|
const NewOrderNotificationUI = (props: any) => {
|
|
18
20
|
const { isBusinessApp } = props
|
|
19
21
|
const [events] = useEvent()
|
|
@@ -22,8 +24,7 @@ const NewOrderNotificationUI = (props: any) => {
|
|
|
22
24
|
const [{ user, token }] = useSession()
|
|
23
25
|
const [ordering] = useApi()
|
|
24
26
|
const { getCurrentLocation } = useLocation();
|
|
25
|
-
const [
|
|
26
|
-
let [currentEvent, setCurrentEvent] = useState<any>(null)
|
|
27
|
+
const [currentEvent, setCurrentEvent] = useState<any>(null)
|
|
27
28
|
|
|
28
29
|
const evtList: any = {
|
|
29
30
|
1: {
|
|
@@ -43,29 +44,27 @@ const NewOrderNotificationUI = (props: any) => {
|
|
|
43
44
|
},
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
const notificationSound = new Sound(theme.sounds.notification
|
|
47
|
+
const notificationSound = new Sound(theme.sounds.notification);
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
times = times + 1
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
setSoundTimeout(_timeout)
|
|
58
|
-
if (times === 3) {
|
|
59
|
-
clearInterval(_timeout)
|
|
60
|
-
clearInterval(soundTimeout)
|
|
61
|
-
}
|
|
62
|
-
}, 2500)
|
|
49
|
+
let _timeout: any = null
|
|
50
|
+
|
|
51
|
+
const handleCloseEvents = () => {
|
|
52
|
+
notificationSound.stop()
|
|
53
|
+
setCurrentEvent(null)
|
|
54
|
+
clearInterval(_timeout)
|
|
63
55
|
}
|
|
64
56
|
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
57
|
+
const handlePlayNotificationSound = (eventObj: any = null) => {
|
|
58
|
+
setCurrentEvent(eventObj)
|
|
59
|
+
let times = 1
|
|
60
|
+
if (times < SOUND_LOOP) {
|
|
61
|
+
_timeout = setInterval(() => {
|
|
62
|
+
notificationSound.setVolume(1).play(success => success && (times = times + 1))
|
|
63
|
+
if (times === SOUND_LOOP) {
|
|
64
|
+
clearInterval(_timeout)
|
|
65
|
+
}
|
|
66
|
+
}, 2500)
|
|
67
|
+
}
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
const handleEventNotification = async (evtType: number, value: any) => {
|
|
@@ -79,26 +78,15 @@ const NewOrderNotificationUI = (props: any) => {
|
|
|
79
78
|
}),
|
|
80
79
|
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` }
|
|
81
80
|
})
|
|
82
|
-
} catch
|
|
83
|
-
console.log(error)
|
|
84
|
-
}
|
|
81
|
+
} catch {}
|
|
85
82
|
const duration = moment.duration(moment().diff(moment.utc(value?.last_driver_assigned_at)))
|
|
86
83
|
const assignedSecondsDiff = duration.asSeconds()
|
|
87
84
|
if (assignedSecondsDiff < 5 && !isBusinessApp) {
|
|
88
|
-
handlePlayNotificationSound()
|
|
89
|
-
clearInterval(soundTimeout)
|
|
90
|
-
currentEvent = { evt: 2, orderId: value?.id }
|
|
91
|
-
setCurrentEvent({ evt: 2, orderId: value?.id })
|
|
85
|
+
handlePlayNotificationSound({ evt: 2, orderId: value?.id })
|
|
92
86
|
}
|
|
93
87
|
}
|
|
94
88
|
if (evtType === 3 || value.author_id === user.id) return
|
|
95
|
-
handlePlayNotificationSound(
|
|
96
|
-
clearInterval(soundTimeout)
|
|
97
|
-
currentEvent = {
|
|
98
|
-
evt: evtType,
|
|
99
|
-
orderId: evtList[evtType].event === 'messages' ? value?.order_id : value?.id
|
|
100
|
-
}
|
|
101
|
-
setCurrentEvent({
|
|
89
|
+
handlePlayNotificationSound({
|
|
102
90
|
evt: evtType,
|
|
103
91
|
orderId: evtList[evtType].event === 'messages' ? value?.order_id : value?.id
|
|
104
92
|
})
|
|
@@ -108,18 +96,20 @@ const NewOrderNotificationUI = (props: any) => {
|
|
|
108
96
|
events.on('message_added_notification', (o: any) => handleEventNotification(1, o))
|
|
109
97
|
events.on('order_added_notification', (o: any) => handleEventNotification(2, o))
|
|
110
98
|
events.on('order_updated_notification', (o: any) => handleEventNotification(3, o))
|
|
99
|
+
events.on('request_register_notification', (o: any) => handleEventNotification(2, o))
|
|
100
|
+
events.on('request_update_notification', (o: any) => handleEventNotification(3, o))
|
|
101
|
+
|
|
111
102
|
return () => {
|
|
112
103
|
events.off('message_added_notification', (o: any) => handleEventNotification(1, o))
|
|
113
104
|
events.off('order_added_notification', (o: any) => handleEventNotification(2, o))
|
|
114
105
|
events.off('order_updated_notification', (o: any) => handleEventNotification(3, o))
|
|
106
|
+
events.off('request_register_notification', (o: any) => handleEventNotification(2, o))
|
|
107
|
+
events.off('request_update_notification', (o: any) => handleEventNotification(3, o))
|
|
115
108
|
}
|
|
116
109
|
}, [])
|
|
117
110
|
|
|
118
111
|
useEffect(() => {
|
|
119
|
-
|
|
120
|
-
return () => {
|
|
121
|
-
notificationSound.release();
|
|
122
|
-
}
|
|
112
|
+
return () => handleCloseEvents()
|
|
123
113
|
}, [])
|
|
124
114
|
|
|
125
115
|
return (
|
|
@@ -133,7 +123,7 @@ const NewOrderNotificationUI = (props: any) => {
|
|
|
133
123
|
<View style={styles.modalView}>
|
|
134
124
|
<TouchableOpacity
|
|
135
125
|
style={styles.wrapperIcon}
|
|
136
|
-
onPress={() =>
|
|
126
|
+
onPress={() => handleCloseEvents()}
|
|
137
127
|
>
|
|
138
128
|
<Icon name="x" size={30} />
|
|
139
129
|
</TouchableOpacity>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
1
|
+
import React, { useState, useCallback } from 'react'
|
|
2
2
|
|
|
3
|
-
import { Platform, StyleSheet, View } from 'react-native';
|
|
3
|
+
import { Platform, StyleSheet, View, TouchableOpacity } from 'react-native';
|
|
4
4
|
|
|
5
5
|
import { OButton, OText, OLink, OModal } from '../shared'
|
|
6
6
|
import {
|
|
@@ -44,6 +44,9 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
44
44
|
const [{ configs }] = useConfig();
|
|
45
45
|
const [openReviewModal, setOpenReviewModal] = useState(false)
|
|
46
46
|
|
|
47
|
+
const [isReadMore, setIsReadMore] = useState(false)
|
|
48
|
+
const [lengthMore, setLengthMore] = useState(false)
|
|
49
|
+
|
|
47
50
|
const pastOrderStatuses = [1, 2, 5, 6, 10, 11, 12, 16, 17]
|
|
48
51
|
|
|
49
52
|
const walletName: any = {
|
|
@@ -91,6 +94,14 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
91
94
|
return order?.taxes?.filter((tax: any) => tax?.type === 1)?.reduce((carry: number, tax: any) => carry + (tax?.summary?.tax_after_discount ?? tax?.summary?.tax), 0)
|
|
92
95
|
}
|
|
93
96
|
|
|
97
|
+
const containsOnlyNumbers = (str: string) => {
|
|
98
|
+
return /^\d+$/.test(str);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const onTextLayout = useCallback((e: any) => {
|
|
102
|
+
setLengthMore(e.nativeEvent.lines.length >= 3); //to check the text is more than 2 lines or not
|
|
103
|
+
},[]);
|
|
104
|
+
|
|
94
105
|
return (
|
|
95
106
|
<OrderContent isOrderGroup={isOrderGroup} lastOrder={lastOrder}>
|
|
96
107
|
{isOrderGroup && (
|
|
@@ -148,7 +159,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
148
159
|
<View style={styles.linkWithIcons}>
|
|
149
160
|
<OLink
|
|
150
161
|
PressStyle={styles.linkWithIcons}
|
|
151
|
-
url={`tel:${order?.business?.cellphone}`}
|
|
162
|
+
url={`tel:${containsOnlyNumbers(order?.business?.cellphone) ? order?.business?.cellphone : 'invalid'}`}
|
|
152
163
|
shorcut={`${order?.business?.cellphone}`}
|
|
153
164
|
TextStyle={styles.textLink}
|
|
154
165
|
/>
|
|
@@ -159,7 +170,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
159
170
|
<View style={styles.linkWithIcons}>
|
|
160
171
|
<OLink
|
|
161
172
|
PressStyle={styles.linkWithIcons}
|
|
162
|
-
url={`tel:${order?.business?.phone}`}
|
|
173
|
+
url={`tel:${containsOnlyNumbers(order?.business?.cellphone) ? order?.business?.phone : 'invalid'}`}
|
|
163
174
|
shorcut={order?.business?.phone}
|
|
164
175
|
TextStyle={styles.textLink}
|
|
165
176
|
/>
|
|
@@ -176,6 +187,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
176
187
|
ios: `maps:0,0?q=${order?.business?.address}`,
|
|
177
188
|
android: `geo:0,0?q=${order?.business?.address}`,
|
|
178
189
|
})}
|
|
190
|
+
numberOfLines={2}
|
|
179
191
|
shorcut={order?.business?.address}
|
|
180
192
|
TextStyle={styles.textLink}
|
|
181
193
|
/>
|
|
@@ -274,7 +286,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
274
286
|
<View style={styles.linkWithIcons}>
|
|
275
287
|
<OLink
|
|
276
288
|
PressStyle={styles.linkWithIcons}
|
|
277
|
-
url={`tel:${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''} ${order?.customer?.cellphone}`}
|
|
289
|
+
url={`tel:${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''} ${containsOnlyNumbers(order?.customer?.cellphone) ? order?.customer?.cellphone : 'invalid'}`}
|
|
278
290
|
shorcut={`${!!order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''} ${order?.customer?.cellphone}`}
|
|
279
291
|
TextStyle={styles.textLink}
|
|
280
292
|
/>
|
|
@@ -285,7 +297,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
285
297
|
<View style={styles.linkWithIcons}>
|
|
286
298
|
<OLink
|
|
287
299
|
PressStyle={styles.linkWithIcons}
|
|
288
|
-
url={`tel:${order?.customer?.phone}`}
|
|
300
|
+
url={`tel:${containsOnlyNumbers(order?.customer?.phone) ? order?.customer?.phone : 'invalid'}`}
|
|
289
301
|
shorcut={order?.customer?.phone}
|
|
290
302
|
TextStyle={styles.textLink}
|
|
291
303
|
/>
|
|
@@ -293,17 +305,26 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
293
305
|
)}
|
|
294
306
|
|
|
295
307
|
{!!order?.customer?.address && (
|
|
296
|
-
|
|
297
|
-
<
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
308
|
+
<>
|
|
309
|
+
<View style={styles.linkWithIcons}>
|
|
310
|
+
<OLink
|
|
311
|
+
PressStyle={{ ...styles.linkWithIcons, marginBottom: 0 }}
|
|
312
|
+
url={Platform.select({
|
|
313
|
+
ios: `maps:0,0?q=${order?.customer?.address}`,
|
|
314
|
+
android: `geo:0,0?q=${order?.customer?.address}`,
|
|
315
|
+
})}
|
|
316
|
+
onTextLayout={onTextLayout}
|
|
317
|
+
numberOfLines={isReadMore ? 20 : 2}
|
|
318
|
+
shorcut={order?.customer?.address}
|
|
319
|
+
TextStyle={styles.textLink}
|
|
320
|
+
/>
|
|
321
|
+
</View>
|
|
322
|
+
{lengthMore && (
|
|
323
|
+
<TouchableOpacity onPress={() => setIsReadMore(!isReadMore)}>
|
|
324
|
+
<OText size={12} color={theme.colors.statusOrderBlue}>{isReadMore ? t('SHOW_LESS', 'Show less') : t('READ_MORE', 'Read more')}</OText>
|
|
325
|
+
</TouchableOpacity>
|
|
326
|
+
)}
|
|
327
|
+
</>
|
|
307
328
|
)}
|
|
308
329
|
|
|
309
330
|
{!!order?.customer?.internal_number && (
|
|
@@ -333,13 +354,18 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
333
354
|
<View style={{ marginTop: 10 }}>
|
|
334
355
|
{order?.delivery_option !== undefined && order?.delivery_type === 1 && (
|
|
335
356
|
<OText>
|
|
336
|
-
{order?.delivery_option?.name}
|
|
357
|
+
{t(order?.delivery_option?.name?.toUpperCase()?.replace(/ /g, '_'), order?.delivery_option?.name)}
|
|
337
358
|
</OText>
|
|
338
359
|
)}
|
|
339
360
|
{!!order?.comment && (
|
|
340
|
-
|
|
341
|
-
{
|
|
342
|
-
|
|
361
|
+
<>
|
|
362
|
+
<OText weight='500' style={{ marginBottom: 5 }}>
|
|
363
|
+
{t('ORDER_COMMENT', 'Order Comment')}
|
|
364
|
+
</OText>
|
|
365
|
+
<OText style={{ fontStyle: 'italic', opacity: 0.6, marginBottom: 20 }}>
|
|
366
|
+
{order?.comment}
|
|
367
|
+
</OText>
|
|
368
|
+
</>
|
|
343
369
|
)}
|
|
344
370
|
</View>
|
|
345
371
|
)}
|
|
@@ -364,6 +390,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
364
390
|
<ProductItemAccordion
|
|
365
391
|
key={product?.id || i}
|
|
366
392
|
product={product}
|
|
393
|
+
currency={order?.currency}
|
|
367
394
|
/>
|
|
368
395
|
))}
|
|
369
396
|
</OrderProducts>
|
|
@@ -372,7 +399,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
372
399
|
<Table>
|
|
373
400
|
<OText mBottom={4}>{t('SUBTOTAL', 'Subtotal')}</OText>
|
|
374
401
|
<OText mBottom={4}>
|
|
375
|
-
{parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()), { currency: order?.currency})}
|
|
402
|
+
{parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()), { currency: order?.currency })}
|
|
376
403
|
</OText>
|
|
377
404
|
</Table>
|
|
378
405
|
{(order?.summary?.discount > 0 ?? order?.discount > 0) && order?.offers?.length === 0 && (
|
|
@@ -385,7 +412,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
385
412
|
) : (
|
|
386
413
|
<OText mBottom={4}>{t('DISCOUNT', theme?.defaultLanguages?.DISCOUNT || 'Discount')}</OText>
|
|
387
414
|
)}
|
|
388
|
-
<OText>- {parsePrice(order?.summary?.discount ?? order?.discount, { currency: order?.currency})}</OText>
|
|
415
|
+
<OText>- {parsePrice(order?.summary?.discount ?? order?.discount, { currency: order?.currency })}</OText>
|
|
389
416
|
</Table>
|
|
390
417
|
)}
|
|
391
418
|
{
|
|
@@ -393,13 +420,13 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
393
420
|
<Table key={offer.id}>
|
|
394
421
|
<OSRow>
|
|
395
422
|
<OText mBottom={4}>
|
|
396
|
-
{offer.name}
|
|
423
|
+
{t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
|
|
397
424
|
{offer.rate_type === 1 && (
|
|
398
425
|
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
399
426
|
)}
|
|
400
427
|
</OText>
|
|
401
428
|
</OSRow>
|
|
402
|
-
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency})}</OText>
|
|
429
|
+
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}</OText>
|
|
403
430
|
</Table>
|
|
404
431
|
))
|
|
405
432
|
}
|
|
@@ -407,9 +434,9 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
407
434
|
<Table>
|
|
408
435
|
<OText mBottom={4}>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
|
|
409
436
|
{order?.tax_type === 1 ? (
|
|
410
|
-
<OText mBottom={4}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0), { currency: order?.currency})}</OText>
|
|
437
|
+
<OText mBottom={4}>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0), { currency: order?.currency })}</OText>
|
|
411
438
|
) : (
|
|
412
|
-
<OText mBottom={4}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0, { currency: order?.currency})}</OText>
|
|
439
|
+
<OText mBottom={4}>{parsePrice(order?.summary?.subtotal_with_discount ?? 0, { currency: order?.currency })}</OText>
|
|
413
440
|
)}
|
|
414
441
|
</Table>
|
|
415
442
|
)}
|
|
@@ -419,7 +446,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
419
446
|
{t('TAX', 'Tax')} {`(${verifyDecimals(order?.tax, parseNumber)}%)`}
|
|
420
447
|
</OText>
|
|
421
448
|
<OText mBottom={4}>
|
|
422
|
-
{parsePrice(order?.summary?.tax ?? 0, { currency: order?.currency})}
|
|
449
|
+
{parsePrice(order?.summary?.tax ?? 0, { currency: order?.currency })}
|
|
423
450
|
</OText>
|
|
424
451
|
</Table>
|
|
425
452
|
)}
|
|
@@ -430,7 +457,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
430
457
|
{t('SERVICE_FEE', 'Service fee')}
|
|
431
458
|
{`(${verifyDecimals(order?.service_fee, parseNumber)}%)`}
|
|
432
459
|
</OText>
|
|
433
|
-
<OText mBottom={4}>{parsePrice(order?.summary?.service_fee ?? 0, { currency: order?.currency})}</OText>
|
|
460
|
+
<OText mBottom={4}>{parsePrice(order?.summary?.service_fee ?? 0, { currency: order?.currency })}</OText>
|
|
434
461
|
</Table>
|
|
435
462
|
)
|
|
436
463
|
}
|
|
@@ -439,11 +466,11 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
439
466
|
<Table key={tax.id}>
|
|
440
467
|
<OSRow>
|
|
441
468
|
<OText mBottom={4}>
|
|
442
|
-
{tax
|
|
469
|
+
{t(tax?.name?.toUpperCase()?.replace(/ /g, '_'), tax?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
443
470
|
{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
|
|
444
471
|
</OText>
|
|
445
472
|
</OSRow>
|
|
446
|
-
<OText mBottom={4}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0, { currency: order?.currency})}</OText>
|
|
473
|
+
<OText mBottom={4}>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0, { currency: order?.currency })}</OText>
|
|
447
474
|
</Table>
|
|
448
475
|
))
|
|
449
476
|
}
|
|
@@ -452,11 +479,11 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
452
479
|
<Table key={fee.id}>
|
|
453
480
|
<OSRow>
|
|
454
481
|
<OText mBottom={4}>
|
|
455
|
-
{fee
|
|
456
|
-
({fee?.fixed > 0 && `${parsePrice(fee?.fixed, { currency: order?.currency})} + `}{fee.percentage}%){' '}
|
|
482
|
+
{t(fee?.name?.toUpperCase()?.replace(/ /g, '_'), fee?.name) || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
483
|
+
({fee?.fixed > 0 && `${parsePrice(fee?.fixed, { currency: order?.currency })} + `}{fee.percentage}%){' '}
|
|
457
484
|
</OText>
|
|
458
485
|
</OSRow>
|
|
459
|
-
<OText mBottom={4}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0, { currency: order?.currency})}</OText>
|
|
486
|
+
<OText mBottom={4}>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0, { currency: order?.currency })}</OText>
|
|
460
487
|
</Table>
|
|
461
488
|
))
|
|
462
489
|
}
|
|
@@ -465,13 +492,13 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
465
492
|
<Table key={offer.id}>
|
|
466
493
|
<OSRow>
|
|
467
494
|
<OText mBottom={4}>
|
|
468
|
-
{offer.name}
|
|
495
|
+
{t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
|
|
469
496
|
{offer.rate_type === 1 && (
|
|
470
497
|
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
471
498
|
)}
|
|
472
499
|
</OText>
|
|
473
500
|
</OSRow>
|
|
474
|
-
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency})}</OText>
|
|
501
|
+
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}</OText>
|
|
475
502
|
</Table>
|
|
476
503
|
))
|
|
477
504
|
}
|
|
@@ -483,7 +510,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
483
510
|
</OText>
|
|
484
511
|
|
|
485
512
|
<OText mBottom={4}>
|
|
486
|
-
{parsePrice(order?.summary?.delivery_price, { currency: order?.currency})}
|
|
513
|
+
{parsePrice(order?.summary?.delivery_price, { currency: order?.currency })}
|
|
487
514
|
</OText>
|
|
488
515
|
</Table>
|
|
489
516
|
)
|
|
@@ -493,13 +520,13 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
493
520
|
<Table key={offer.id}>
|
|
494
521
|
<OSRow>
|
|
495
522
|
<OText mBottom={4}>
|
|
496
|
-
{offer.name}
|
|
523
|
+
{t(offer.name?.toUpperCase()?.replace(/ /g, '_'), offer.name)}
|
|
497
524
|
{offer.rate_type === 1 && (
|
|
498
525
|
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
499
526
|
)}
|
|
500
527
|
</OText>
|
|
501
528
|
</OSRow>
|
|
502
|
-
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency})}</OText>
|
|
529
|
+
<OText mBottom={4}>- {parsePrice(offer?.summary?.discount, { currency: order?.currency })}</OText>
|
|
503
530
|
</Table>
|
|
504
531
|
))
|
|
505
532
|
}
|
|
@@ -514,7 +541,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
514
541
|
`(${verifyDecimals(order?.summary?.driver_tip, parseNumber)}%)`
|
|
515
542
|
)}
|
|
516
543
|
</OText>
|
|
517
|
-
<OText mBottom={4}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip, { currency: order?.currency})}</OText>
|
|
544
|
+
<OText mBottom={4}>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip, { currency: order?.currency })}</OText>
|
|
518
545
|
</Table>
|
|
519
546
|
)}
|
|
520
547
|
|
|
@@ -528,7 +555,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
528
555
|
mBottom={4}
|
|
529
556
|
style={styles.textBold}
|
|
530
557
|
color={theme.colors.primary}>
|
|
531
|
-
{parsePrice(order?.summary?.total ?? order?.total, { currency: order?.currency})}
|
|
558
|
+
{parsePrice(order?.summary?.total ?? order?.total, { currency: order?.currency })}
|
|
532
559
|
</OText>
|
|
533
560
|
</Table>
|
|
534
561
|
</Total>
|
|
@@ -562,7 +589,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
562
589
|
<OText>
|
|
563
590
|
{event?.wallet_event
|
|
564
591
|
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
565
|
-
: event?.paymethod?.name}
|
|
592
|
+
: t(event?.paymethod?.name?.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)}
|
|
566
593
|
</OText>
|
|
567
594
|
{event?.data?.charge_id && (
|
|
568
595
|
<OText>
|
|
@@ -571,7 +598,7 @@ export const OrderContentComponent = (props: OrderContent) => {
|
|
|
571
598
|
)}
|
|
572
599
|
</View>
|
|
573
600
|
<OText>
|
|
574
|
-
-{parsePrice(event.amount, { currency: order?.currency})}
|
|
601
|
+
-{parsePrice(event.amount, { currency: order?.currency })}
|
|
575
602
|
</OText>
|
|
576
603
|
</View>
|
|
577
604
|
))}
|
|
@@ -271,7 +271,7 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
271
271
|
{order?.delivery_option && (
|
|
272
272
|
<OText size={13}>
|
|
273
273
|
<OText size={13} weight='bold'>{`${t('DELIVERY_PREFERENCE', 'Delivery Preference')}: `}</OText>
|
|
274
|
-
{order?.delivery_option?.name}
|
|
274
|
+
{t(order?.delivery_option?.name?.toUpperCase()?.replace(/ /g, '_'), order?.delivery_option?.name)}
|
|
275
275
|
</OText>
|
|
276
276
|
)}
|
|
277
277
|
{order?.payment_events?.length > 0 && (
|
|
@@ -286,8 +286,8 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
|
|
|
286
286
|
? `${walletName[event?.wallet_event?.wallet?.type]?.name} - `
|
|
287
287
|
: walletName[event?.wallet_event?.wallet?.type]?.name
|
|
288
288
|
: idx < order?.payment_events?.length - 1
|
|
289
|
-
? `${event?.paymethod?.name} - `
|
|
290
|
-
: event?.paymethod?.name
|
|
289
|
+
? `${t(event?.paymethod?.name?.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)} - `
|
|
290
|
+
: t(event?.paymethod?.name?.toUpperCase()?.replace(/ /g, '_'), event?.paymethod?.name)
|
|
291
291
|
})}
|
|
292
292
|
</OText>
|
|
293
293
|
</View>
|