ordering-ui-react-native 0.21.53 → 0.21.54-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 +8 -8
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/PaymentOptionsWebView/index.tsx +1 -0
- package/src/components/StripeMethodForm/index.tsx +6 -4
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/types/index.tsx +3 -1
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +4 -3
- package/themes/business/src/components/BusinessProductList/ProductList.tsx +72 -27
- package/themes/business/src/components/BusinessProductList/index.tsx +57 -25
- package/themes/business/src/components/DriverMap/index.tsx +36 -23
- package/themes/business/src/components/GoogleMap/index.tsx +15 -8
- package/themes/business/src/components/Home/index.tsx +5 -1
- package/themes/business/src/components/LanguageSelector/index.tsx +1 -2
- package/themes/business/src/components/LanguageSelector/lang_country.json +515 -70
- package/themes/business/src/components/LogoutButton/index.tsx +1 -1
- package/themes/business/src/components/MapView/index.tsx +30 -15
- package/themes/business/src/components/NewOrderNotification/index.tsx +66 -26
- package/themes/business/src/components/OrderDetails/Business.tsx +52 -2
- package/themes/business/src/components/OrderDetails/Delivery.tsx +42 -23
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +68 -61
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +36 -22
- package/themes/business/src/components/OrderDetails/usePrinterCommands.tsx +220 -0
- package/themes/business/src/components/OrderSummary/index.tsx +240 -76
- package/themes/business/src/components/OrdersOption/index.tsx +245 -112
- package/themes/business/src/components/PhoneInputNumber/index.tsx +8 -5
- package/themes/business/src/components/PreviousOrders/OrderItem.tsx +29 -19
- package/themes/business/src/components/PreviousOrders/index.tsx +5 -3
- package/themes/business/src/components/PrinterEdition/index.tsx +363 -0
- package/themes/business/src/components/PrinterEdition/styles.tsx +61 -0
- package/themes/business/src/components/PrinterSettings/index.tsx +267 -0
- package/themes/business/src/components/PrinterSettings/styles.tsx +30 -0
- package/themes/business/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/business/src/components/ReviewCustomer/index.tsx +2 -0
- package/themes/business/src/components/SearchBar/index.tsx +2 -1
- package/themes/business/src/components/Sessions/index.tsx +187 -0
- package/themes/business/src/components/Sessions/styles.tsx +20 -0
- package/themes/business/src/components/StoresList/index.tsx +4 -3
- package/themes/business/src/components/UserFormDetails/index.tsx +111 -107
- package/themes/business/src/components/UserProfileForm/index.tsx +106 -54
- package/themes/business/src/components/WebsocketStatus/index.tsx +2 -2
- package/themes/business/src/components/shared/OInput.tsx +2 -0
- package/themes/business/src/components/shared/OTextarea.tsx +8 -9
- package/themes/business/src/hooks/useLocation.tsx +5 -4
- package/themes/business/src/types/index.tsx +22 -5
- package/themes/business/src/utils/index.tsx +5 -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/Checkout/index.tsx +6 -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/shared/OButton.tsx +5 -18
- package/themes/original/index.tsx +6 -2
- package/themes/original/src/components/AddressDetails/index.tsx +20 -10
- package/themes/original/src/components/AddressForm/index.tsx +32 -17
- package/themes/original/src/components/AddressList/index.tsx +8 -7
- package/themes/original/src/components/AnalyticsSegment/index.tsx +6 -6
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +6 -9
- package/themes/original/src/components/BusinessController/index.tsx +18 -10
- package/themes/original/src/components/BusinessController/styles.tsx +8 -7
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +15 -7
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchFooter.tsx +316 -0
- package/themes/original/src/components/BusinessListingSearch/BusinessSearchHeader.tsx +94 -0
- package/themes/original/src/components/BusinessListingSearch/index.tsx +48 -359
- package/themes/original/src/components/BusinessPreorder/index.tsx +20 -16
- package/themes/original/src/components/BusinessProductsList/SubcategoriesComponent/index.tsx +5 -5
- package/themes/original/src/components/BusinessProductsList/index.tsx +3 -3
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +29 -14
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +9 -8
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +2 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +1 -1
- package/themes/original/src/components/BusinessesListing/index.tsx +0 -1
- package/themes/original/src/components/Cart/index.tsx +26 -9
- package/themes/original/src/components/CartContent/index.tsx +60 -45
- package/themes/original/src/components/Checkout/index.tsx +106 -64
- package/themes/original/src/components/CitiesControl/index.tsx +0 -3
- package/themes/original/src/components/CouponControl/index.tsx +1 -3
- package/themes/original/src/components/DatePicker/index.tsx +18 -2
- package/themes/original/src/components/DriverTips/index.tsx +1 -3
- package/themes/original/src/components/Favorite/index.tsx +1 -5
- package/themes/original/src/components/FavoriteList/index.tsx +0 -1
- package/themes/original/src/components/ForgotPasswordForm/index.tsx +5 -7
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/index.tsx +64 -0
- package/themes/original/src/components/GiftCard/GiftCardOrdersList/styles.tsx +8 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +15 -17
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +3 -7
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +24 -32
- package/themes/original/src/components/GiftCard/SendGiftCard/index.tsx +9 -11
- package/themes/original/src/components/GiftCard/SingleGiftCard/index.tsx +101 -0
- package/themes/original/src/components/GiftCard/SingleGiftCard/styles.tsx +4 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.tsx +82 -0
- package/themes/original/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.tsx +9 -0
- package/themes/original/src/components/GoogleMap/index.tsx +39 -18
- package/themes/original/src/components/Help/index.tsx +2 -0
- package/themes/original/src/components/HighestRatedBusinesses/index.tsx +2 -2
- package/themes/original/src/components/Home/index.tsx +2 -10
- package/themes/original/src/components/LoginForm/Otp/index.tsx +4 -19
- package/themes/original/src/components/LoginForm/index.tsx +4 -7
- package/themes/original/src/components/MessageListing/index.tsx +1 -0
- package/themes/original/src/components/Messages/index.tsx +8 -7
- package/themes/original/src/components/MomentOption/index.tsx +13 -2
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +7 -3
- package/themes/original/src/components/MultiCheckout/index.tsx +124 -63
- package/themes/original/src/components/MultiCheckout/styles.tsx +17 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +20 -14
- package/themes/original/src/components/MyOrders/index.tsx +21 -26
- package/themes/original/src/components/NavBar/index.tsx +4 -2
- package/themes/original/src/components/NetworkError/index.tsx +2 -8
- package/themes/original/src/components/NotFoundSource/index.tsx +0 -3
- package/themes/original/src/components/Notifications/index.tsx +2 -4
- package/themes/original/src/components/OrderDetails/OrderHistory.tsx +5 -7
- package/themes/original/src/components/OrderDetails/index.tsx +5 -7
- package/themes/original/src/components/OrderDetails/styles.tsx +0 -1
- package/themes/original/src/components/OrderProgress/index.tsx +22 -3
- package/themes/original/src/components/OrderTypeSelector/index.tsx +7 -6
- package/themes/original/src/components/OrdersOption/index.tsx +2 -4
- package/themes/original/src/components/PaymentOptionCard/index.tsx +4 -2
- package/themes/original/src/components/PaymentOptionStripe/index.tsx +0 -5
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +47 -6
- package/themes/original/src/components/PlaceSpot/index.tsx +1 -3
- package/themes/original/src/components/PreviousOrders/index.tsx +1 -2
- package/themes/original/src/components/ProductForm/ActionButton.tsx +16 -19
- package/themes/original/src/components/ProductForm/index.tsx +123 -112
- package/themes/original/src/components/ProductItemAccordion/index.tsx +55 -49
- package/themes/original/src/components/ProductItemAccordion/styles.tsx +3 -4
- package/themes/original/src/components/ProductOptionSubOption/index.tsx +112 -91
- package/themes/original/src/components/ProfessionalProfile/index.tsx +4 -5
- package/themes/original/src/components/Promotions/index.tsx +6 -9
- package/themes/original/src/components/ReviewDriver/index.tsx +1 -1
- package/themes/original/src/components/ReviewOrder/index.tsx +2 -2
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/ReviewTrigger/index.tsx +2 -2
- package/themes/original/src/components/ServiceForm/index.tsx +52 -54
- package/themes/original/src/components/Sessions/index.tsx +3 -3
- package/themes/original/src/components/SignupForm/index.tsx +65 -67
- package/themes/original/src/components/SingleOrderCard/index.tsx +1 -2
- package/themes/original/src/components/SingleProductCard/index.tsx +5 -6
- package/themes/original/src/components/SingleProductCard/styles.tsx +0 -3
- package/themes/original/src/components/StripeCardForm/index.tsx +0 -3
- package/themes/original/src/components/StripeCardsList/index.tsx +12 -36
- package/themes/original/src/components/StripeElementsForm/index.tsx +78 -59
- package/themes/original/src/components/StripeElementsForm/naked.tsx +48 -1
- package/themes/original/src/components/StripeRedirectForm/index.tsx +0 -3
- package/themes/original/src/components/UpsellingProducts/UpsellingContent.tsx +10 -7
- package/themes/original/src/components/UpsellingProducts/UpsellingLayout.tsx +8 -3
- package/themes/original/src/components/UserFormDetails/index.tsx +88 -91
- package/themes/original/src/components/UserFormDetails/styles.tsx +7 -0
- package/themes/original/src/components/UserProfile/index.tsx +11 -2
- package/themes/original/src/components/Wallets/index.tsx +7 -4
- package/themes/original/src/components/Wallets/styles.tsx +1 -1
- package/themes/original/src/components/WebsocketStatus/index.tsx +169 -0
- package/themes/original/src/components/WebsocketStatus/styles.tsx +28 -0
- package/themes/original/src/components/shared/OAlert.tsx +2 -1
- package/themes/original/src/components/shared/OButton.tsx +8 -7
- package/themes/original/src/components/shared/OInput.tsx +1 -4
- package/themes/original/src/layouts/Container.tsx +4 -2
- package/themes/original/src/types/index.tsx +5 -1
- package/themes/original/src/utils/index.tsx +12 -1
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-react-native",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.54-release",
|
|
4
4
|
"description": "Reusable components made in react native",
|
|
5
5
|
"main": "src/index.tsx",
|
|
6
6
|
"author": "ordering.inc",
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
"@segment/analytics-react-native": "2.1.11",
|
|
53
53
|
"@segment/sovran-react-native": "0.2.6",
|
|
54
54
|
"@sentry/react-native": "^2.6.0",
|
|
55
|
-
|
|
55
|
+
"@stripe/stripe-react-native": "0.23.0",
|
|
56
56
|
"@types/react-native-loading-spinner-overlay": "^0.5.2",
|
|
57
57
|
"@types/react-native-snap-carousel": "^3.8.4",
|
|
58
58
|
"@types/styled-components": "^5.1.3",
|
|
59
59
|
"axios": "^0.21.0",
|
|
60
60
|
"moment": "^2.29.1",
|
|
61
|
-
"ordering-components": "github:Ordering-Inc/ordering-components#
|
|
61
|
+
"ordering-components": "github:Ordering-Inc/ordering-components#release",
|
|
62
62
|
"patch-package": "^6.4.7",
|
|
63
63
|
"postinstall-postinstall": "^2.1.0",
|
|
64
64
|
"prop-types": "^15.7.2",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"react-native-color-matrix-image-filters": "^5.2.10",
|
|
77
77
|
"react-native-country-picker-modal": "^2.0.0",
|
|
78
78
|
"react-native-credit-card-input": "^0.4.1",
|
|
79
|
-
"react-native-date-picker": "
|
|
79
|
+
"react-native-date-picker": "4.2.14",
|
|
80
80
|
"react-native-device-info": "^8.7.1",
|
|
81
81
|
"react-native-document-picker": "^5.2.0",
|
|
82
82
|
"react-native-elements": "^3.0.0-alpha.1",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"react-native-gesture-handler": "^1.8.0",
|
|
87
87
|
"react-native-get-random-values": "1.8.0",
|
|
88
88
|
"react-native-gifted-chat": "^0.16.3",
|
|
89
|
-
"react-native-google-places-autocomplete": "
|
|
89
|
+
"react-native-google-places-autocomplete": "2.1.3",
|
|
90
90
|
"react-native-html-to-pdf": "^0.10.0",
|
|
91
91
|
"react-native-image-picker": "^4.0.6",
|
|
92
92
|
"react-native-intersection-observer": "^0.0.9",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"react-native-tracking-transparency": "^0.1.1",
|
|
117
117
|
"react-native-uuid": "^2.0.1",
|
|
118
118
|
"react-native-vector-icons": "^7.1.0",
|
|
119
|
-
"react-native-webview": "^11.
|
|
119
|
+
"react-native-webview": "^11.6.4",
|
|
120
120
|
"react-native-youtube-iframe": "^2.2.2",
|
|
121
121
|
"rn-placeholder": "^3.0.3",
|
|
122
122
|
"styled-components": "^5.1.1",
|
|
@@ -128,8 +128,8 @@
|
|
|
128
128
|
"@babel/core": "^7.11.6",
|
|
129
129
|
"@babel/runtime": "^7.11.2",
|
|
130
130
|
"@react-native-community/eslint-config": "^2.0.0",
|
|
131
|
-
"@types/react": "^18.0.
|
|
132
|
-
"@types/react-dom": "^18.0.
|
|
131
|
+
"@types/react": "^18.0.15",
|
|
132
|
+
"@types/react-dom": "^18.0.6",
|
|
133
133
|
"@types/react-native": "^0.63.25",
|
|
134
134
|
"@types/react-native-calendar-picker": "^7.0.2",
|
|
135
135
|
"babel-jest": "^26.3.0",
|
package/src/DeliveryApp.tsx
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import * as React from 'react';
|
|
10
|
-
import { LogBox } from 'react-native';
|
|
10
|
+
import { LogBox, Platform } from 'react-native';
|
|
11
|
+
import * as Sentry from "@sentry/react-native";
|
|
11
12
|
import { OrderingProvider } from 'ordering-components/native';
|
|
12
13
|
import RNBootSplash from "react-native-bootsplash";
|
|
13
14
|
|
|
@@ -22,6 +23,47 @@ import theme from './theme.json';
|
|
|
22
23
|
import AppContainer from './AppContainer';
|
|
23
24
|
import { FacebookPixel } from './components/FacebookPixel';
|
|
24
25
|
|
|
26
|
+
Sentry.init({
|
|
27
|
+
environment: Platform.OS === 'ios' ? 'ios' : 'android',
|
|
28
|
+
dsn: 'https://e5e1115dc93b49109f4ab65f2098bef9@o460529.ingest.sentry.io/5722123',
|
|
29
|
+
release: 'ordering-ui-native@' + process.env.npm_package_version,
|
|
30
|
+
ignoreErrors: [
|
|
31
|
+
'is not defined',
|
|
32
|
+
'is not a function',
|
|
33
|
+
'can\'t find variable',
|
|
34
|
+
'objects are not valid',
|
|
35
|
+
'element type is invalid',
|
|
36
|
+
'requiring module',
|
|
37
|
+
'has not been registered',
|
|
38
|
+
'failed to connect to debugger!',
|
|
39
|
+
'rendered more hooks than',
|
|
40
|
+
'rendered fewer hooks than',
|
|
41
|
+
'should have a queue',
|
|
42
|
+
'the OS most likely terminated',
|
|
43
|
+
'Connection timed out',
|
|
44
|
+
'java.io.EOFException',
|
|
45
|
+
'Abort',
|
|
46
|
+
'Segfault',
|
|
47
|
+
'Failed to allocate a',
|
|
48
|
+
'Application Not Responding',
|
|
49
|
+
'connection no longer valid',
|
|
50
|
+
'IllegalInstruction',
|
|
51
|
+
'React.Children.only expected to receive a single React element child.',
|
|
52
|
+
'unrecognized selector sent to instance'
|
|
53
|
+
],
|
|
54
|
+
tracesSampleRate: 0.2,
|
|
55
|
+
// Release health
|
|
56
|
+
enableAutoSessionTracking: true,
|
|
57
|
+
// Sessions close after app is 10 seconds in the background.
|
|
58
|
+
sessionTrackingIntervalMillis: 10000,
|
|
59
|
+
|
|
60
|
+
integrations: [
|
|
61
|
+
new Sentry.ReactNativeTracing({
|
|
62
|
+
routingInstrumentation: reactNavigationV5Instrumentation,
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
});
|
|
66
|
+
|
|
25
67
|
LogBox.ignoreLogs([
|
|
26
68
|
'Sending \`onAnimatedValueUpdate` with no listeners registered.',
|
|
27
69
|
'Non-serializable values were found in the navigation state.',
|
|
@@ -191,7 +191,7 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
191
191
|
{isFarAway && (
|
|
192
192
|
<FarAwayMessage style={styles.farAwayMsg}>
|
|
193
193
|
<Ionicons name='md-warning-outline' style={styles.iconStyle} />
|
|
194
|
-
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', '
|
|
194
|
+
<OText size={12} numberOfLines={1} ellipsizeMode={'tail'} color={theme.colors.textNormal}>{t('YOU_ARE_FAR_FROM_ADDRESS', 'Your are far from this address')}</OText>
|
|
195
195
|
</FarAwayMessage>
|
|
196
196
|
)}
|
|
197
197
|
</OrderControlContainer>
|
|
@@ -156,6 +156,7 @@ export const PaymentOptionsWebView = (props: PaymentOptionsWebViewParams) => {
|
|
|
156
156
|
user_id: user?.id,
|
|
157
157
|
user_name: user?.name
|
|
158
158
|
},
|
|
159
|
+
xappx: ordering?.appId,
|
|
159
160
|
currency: configs?.stripe_currency?.value || currency,
|
|
160
161
|
userToken: token,
|
|
161
162
|
clientId: webviewPaymethod?.credentials?.client_id,
|
|
@@ -3,7 +3,6 @@ import { useLanguage, useConfig, useOrder } from 'ordering-components/native'
|
|
|
3
3
|
import { useGooglePay, useApplePay } from '@stripe/stripe-react-native'
|
|
4
4
|
import { Platform } from 'react-native';
|
|
5
5
|
import { StripeMethodFormParams } from '../../types';
|
|
6
|
-
import { android_app_id } from '../../config.json'
|
|
7
6
|
|
|
8
7
|
export const StripeMethodForm = (props: StripeMethodFormParams) => {
|
|
9
8
|
const {
|
|
@@ -17,7 +16,9 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
|
|
|
17
16
|
placeByMethodPay,
|
|
18
17
|
methodPaySupported,
|
|
19
18
|
setPlaceByMethodPay,
|
|
20
|
-
cartTotal
|
|
19
|
+
cartTotal,
|
|
20
|
+
androidAppId,
|
|
21
|
+
businessNames
|
|
21
22
|
} = props
|
|
22
23
|
const { initGooglePay, createGooglePayPaymentMethod, loading } = useGooglePay();
|
|
23
24
|
const { presentApplePay, isApplePaySupported } = useApplePay();
|
|
@@ -61,7 +62,7 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
|
|
|
61
62
|
})
|
|
62
63
|
const { error } = await initGooglePay({
|
|
63
64
|
testEnv: devMode,
|
|
64
|
-
merchantName:
|
|
65
|
+
merchantName: androidAppId,
|
|
65
66
|
countryCode: 'US',
|
|
66
67
|
billingAddressConfig: {
|
|
67
68
|
format: 'FULL',
|
|
@@ -152,7 +153,8 @@ export const StripeMethodForm = (props: StripeMethodFormParams) => {
|
|
|
152
153
|
|
|
153
154
|
const { error, paymentMethod } = await presentApplePay({
|
|
154
155
|
cartItems: [{
|
|
155
|
-
label: t('
|
|
156
|
+
label: businessNames ? `${businessNames.join(', ')} ${t('VIA_CHEW_APP', 'via Chew App')}`
|
|
157
|
+
: `${cart?.business?.name} ${t('VIA_CHEW_APP', 'via Chew App')}`,
|
|
156
158
|
amount: cartTotal?.toString?.() ?? cart?.balance?.toString() ?? cart?.total?.toString?.(),
|
|
157
159
|
paymentType: 'Immediate'
|
|
158
160
|
}],
|
|
@@ -2,7 +2,7 @@ import styled from 'styled-components/native';
|
|
|
2
2
|
|
|
3
3
|
export const Container = styled.View`
|
|
4
4
|
width: 100%;
|
|
5
|
-
padding: 0
|
|
5
|
+
padding: 0 30px;
|
|
6
6
|
`
|
|
7
7
|
|
|
8
8
|
export const CountDownContainer = styled.View`
|
|
@@ -20,7 +20,6 @@ export const ResendSection = styled.View`
|
|
|
20
20
|
display: flex;
|
|
21
21
|
flex-direction: row;
|
|
22
22
|
justify-content: center;
|
|
23
|
-
flex-wrap: wrap;
|
|
24
23
|
`
|
|
25
24
|
|
|
26
25
|
export const WrappCountdown = styled.View`
|
package/src/types/index.tsx
CHANGED
|
@@ -29,6 +29,7 @@ import { OrderSummary } from './src/components/OrderSummary';
|
|
|
29
29
|
import { PhoneInputNumber } from './src/components/PhoneInputNumber';
|
|
30
30
|
import { PreviousMessages } from './src/components/PreviousMessages';
|
|
31
31
|
import { PreviousOrders } from './src/components/PreviousOrders';
|
|
32
|
+
import { PrinterSettings } from './src/components/PrinterSettings';
|
|
32
33
|
import { ProductItemAccordion } from './src/components/ProductItemAccordion';
|
|
33
34
|
import { ReviewCustomer } from './src/components/ReviewCustomer'
|
|
34
35
|
import { SearchBar } from './src/components/SearchBar';
|
|
@@ -43,6 +44,7 @@ import { NewOrderNotification } from './src/components/NewOrderNotification';
|
|
|
43
44
|
import { DriverSchedule } from './src/components/DriverSchedule';
|
|
44
45
|
import { ScheduleBlocked } from './src/components/ScheduleBlocked';
|
|
45
46
|
import { OrderDetailsLogistic } from './src/components/OrderDetailsLogistic'
|
|
47
|
+
import { Sessions } from './src/components/Sessions';
|
|
46
48
|
//OComponents
|
|
47
49
|
import {
|
|
48
50
|
OText,
|
|
@@ -102,10 +104,12 @@ export {
|
|
|
102
104
|
PhoneInputNumber,
|
|
103
105
|
PreviousMessages,
|
|
104
106
|
PreviousOrders,
|
|
107
|
+
PrinterSettings,
|
|
105
108
|
ProductItemAccordion,
|
|
106
109
|
ReviewCustomer,
|
|
107
110
|
SafeAreaContainerLayout,
|
|
108
111
|
SearchBar,
|
|
112
|
+
Sessions,
|
|
109
113
|
SignupForm,
|
|
110
114
|
StoresList,
|
|
111
115
|
UserFormDetailsUI,
|
|
@@ -31,6 +31,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
31
31
|
notShowCustomerPhone,
|
|
32
32
|
orderTitle,
|
|
33
33
|
appTitle,
|
|
34
|
+
isLoadingOrder
|
|
34
35
|
} = props;
|
|
35
36
|
|
|
36
37
|
const [, t] = useLanguage();
|
|
@@ -277,7 +278,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
277
278
|
}
|
|
278
279
|
|
|
279
280
|
bodyToSend.id = orderId;
|
|
280
|
-
handleUpdateOrder
|
|
281
|
+
handleUpdateOrder?.(bodyToSend.status, bodyToSend);
|
|
281
282
|
};
|
|
282
283
|
|
|
283
284
|
useEffect(() => {
|
|
@@ -517,7 +518,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
517
518
|
...styles.bottomParent,
|
|
518
519
|
marginBottom: Platform.OS === 'ios'
|
|
519
520
|
? 30 : (keyboardState.height === 0)
|
|
520
|
-
? isPage ? 0 :
|
|
521
|
+
? isPage ? 0 : 40
|
|
521
522
|
: keyboardState.height - (isPage ? 20 : -10)
|
|
522
523
|
}}
|
|
523
524
|
>
|
|
@@ -529,7 +530,7 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
|
|
|
529
530
|
style={{ borderRadius: 7, height: 45 }}
|
|
530
531
|
parentStyle={{ width: '100%' }}
|
|
531
532
|
textStyle={{ color: '#FFF', fontSize: 18 }}
|
|
532
|
-
isDisabled={showTextArea && !comments}
|
|
533
|
+
isDisabled={(showTextArea && !comments) || isLoadingOrder}
|
|
533
534
|
onClick={() => handleAcceptOrReject()}
|
|
534
535
|
/>
|
|
535
536
|
</View>
|
|
@@ -1,45 +1,56 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import {
|
|
1
|
+
import React, { useCallback } from 'react'
|
|
2
|
+
import { StyleSheet, View, TouchableOpacity } from 'react-native'
|
|
3
3
|
import { useTheme } from 'styled-components/native';
|
|
4
|
-
import { OIcon, OText
|
|
4
|
+
import { OIcon, OText } from '../shared';
|
|
5
5
|
import { NotFoundSource } from '../NotFoundSource';
|
|
6
6
|
import ToggleSwitch from 'toggle-switch-react-native';
|
|
7
7
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
8
|
+
import { SearchBar } from '../SearchBar';
|
|
9
|
+
import { IOScrollView } from 'react-native-intersection-observer';
|
|
8
10
|
import {
|
|
9
11
|
useLanguage,
|
|
10
|
-
useUtils
|
|
12
|
+
useUtils,
|
|
13
|
+
ToastType,
|
|
14
|
+
useToast,
|
|
11
15
|
} from 'ordering-components/native'
|
|
12
16
|
|
|
17
|
+
const PIXELS_TO_SCROLL = 2000
|
|
18
|
+
|
|
13
19
|
export const ProductList = (props: any) => {
|
|
14
|
-
const {
|
|
20
|
+
const { productsList, onClose, updateProduct, searchValue, handleChangeSearch, getCategoryProducts } = props
|
|
15
21
|
|
|
16
|
-
const { loading, products, error } =
|
|
22
|
+
const { loading, products, error } = productsList
|
|
17
23
|
|
|
18
24
|
const theme = useTheme()
|
|
19
25
|
const [{ optimizeImage }] = useUtils();
|
|
26
|
+
const [, { showToast }] = useToast()
|
|
20
27
|
const [, t] = useLanguage()
|
|
21
28
|
|
|
22
29
|
const styles = StyleSheet.create({
|
|
23
30
|
container: {
|
|
24
|
-
paddingBottom: 20,
|
|
25
|
-
marginBottom: 0,
|
|
26
31
|
flex: 1,
|
|
32
|
+
marginBottom: 0
|
|
27
33
|
},
|
|
28
34
|
header: {
|
|
29
35
|
flexDirection: 'row',
|
|
30
36
|
justifyContent: 'space-between',
|
|
31
37
|
marginBottom: 10,
|
|
32
38
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
btnBackArrow: {
|
|
40
|
+
borderWidth: 0,
|
|
41
|
+
width: 32,
|
|
42
|
+
height: 32,
|
|
43
|
+
tintColor: theme.colors.textGray,
|
|
44
|
+
backgroundColor: theme.colors.clear,
|
|
45
|
+
borderColor: theme.colors.clear,
|
|
46
|
+
shadowColor: theme.colors.clear,
|
|
47
|
+
paddingLeft: 0,
|
|
48
|
+
paddingRight: 0
|
|
38
49
|
},
|
|
39
50
|
sectionTitle: {
|
|
40
51
|
fontStyle: 'normal',
|
|
41
52
|
fontWeight: '600',
|
|
42
|
-
fontSize:
|
|
53
|
+
fontSize: 20,
|
|
43
54
|
color: theme.colors.textGray,
|
|
44
55
|
},
|
|
45
56
|
logo: {
|
|
@@ -60,27 +71,61 @@ export const ProductList = (props: any) => {
|
|
|
60
71
|
height: 35,
|
|
61
72
|
marginRight: 5
|
|
62
73
|
},
|
|
74
|
+
borderStyle: {
|
|
75
|
+
borderColor: theme.colors.red,
|
|
76
|
+
borderWidth: 0,
|
|
77
|
+
borderRadius: 10,
|
|
78
|
+
},
|
|
63
79
|
});
|
|
64
80
|
|
|
65
81
|
const handleSwitch = (enabled: boolean, categoryId: any, productId: any) => {
|
|
66
82
|
updateProduct && updateProduct(categoryId, productId, { enabled })
|
|
67
83
|
};
|
|
68
84
|
|
|
85
|
+
const handleScroll = ({ nativeEvent }: any) => {
|
|
86
|
+
const y = nativeEvent.contentOffset.y;
|
|
87
|
+
const height = nativeEvent.contentSize.height;
|
|
88
|
+
const hasMore = !(
|
|
89
|
+
productsList.pagination.totalPages === productsList.pagination.currentPage
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
if (y + PIXELS_TO_SCROLL > height && !productsList.loading && hasMore && productsList?.products?.length > 0) {
|
|
93
|
+
getCategoryProducts(false)
|
|
94
|
+
showToast(ToastType.Info, t('LOADING_MORE_PRODUCTS', 'Loading more products'))
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
69
98
|
return (
|
|
70
99
|
<View style={{ flex: 1, paddingHorizontal: 20, paddingVertical: 20 }}>
|
|
71
100
|
<View style={styles.header}>
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
101
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
102
|
+
<TouchableOpacity
|
|
103
|
+
onPress={onClose}
|
|
104
|
+
style={styles.btnBackArrow}
|
|
105
|
+
>
|
|
106
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
|
|
107
|
+
</TouchableOpacity>
|
|
108
|
+
<OText style={styles.sectionTitle}>{t('PRODUCTS', 'Products')}</OText>
|
|
109
|
+
</View>
|
|
110
|
+
<View style={{ flexDirection: 'row', justifyContent: 'flex-end' }}>
|
|
111
|
+
<SearchBar
|
|
112
|
+
borderStyle={styles.borderStyle}
|
|
113
|
+
onSearch={handleChangeSearch}
|
|
114
|
+
searchValue={searchValue}
|
|
115
|
+
lazyLoad
|
|
116
|
+
isCancelXButtonShow={!!searchValue}
|
|
117
|
+
onCancel={() => handleChangeSearch('')}
|
|
118
|
+
placeholder={t('SEARCH', 'Search')}
|
|
119
|
+
containerStyle={{ width: 180 }}
|
|
120
|
+
/>
|
|
121
|
+
</View>
|
|
80
122
|
</View>
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
123
|
+
<IOScrollView
|
|
124
|
+
style={styles.container}
|
|
125
|
+
onScroll={handleScroll}
|
|
126
|
+
scrollEventThrottle={16}
|
|
127
|
+
bounces={false}
|
|
128
|
+
>
|
|
84
129
|
{!loading && products?.length === 0 && (
|
|
85
130
|
<NotFoundSource
|
|
86
131
|
content={t('NO_RESULTS_FOUND', 'Sorry, no results found')}
|
|
@@ -98,7 +143,7 @@ export const ProductList = (props: any) => {
|
|
|
98
143
|
justifyContent: 'space-between',
|
|
99
144
|
borderBottomColor: theme.colors.borderTops,
|
|
100
145
|
borderBottomWidth: 1,
|
|
101
|
-
paddingVertical:
|
|
146
|
+
paddingVertical: 15
|
|
102
147
|
}}
|
|
103
148
|
>
|
|
104
149
|
<View style={{ flex: 1, flexDirection: 'row', alignItems: 'center', marginRight: 36 }}>
|
|
@@ -145,7 +190,7 @@ export const ProductList = (props: any) => {
|
|
|
145
190
|
))}
|
|
146
191
|
</View>
|
|
147
192
|
)}
|
|
148
|
-
</
|
|
193
|
+
</IOScrollView>
|
|
149
194
|
</View>
|
|
150
195
|
)
|
|
151
196
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { View, StyleSheet, ScrollView, Dimensions } from 'react-native';
|
|
2
|
+
import { View, StyleSheet, ScrollView, Dimensions, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
|
|
4
4
|
import { useTheme } from 'styled-components/native';
|
|
5
|
+
import { SearchBar } from '../SearchBar';
|
|
5
6
|
import {
|
|
6
7
|
ToastType,
|
|
7
8
|
useToast,
|
|
8
9
|
useLanguage,
|
|
9
|
-
|
|
10
|
+
StoreProductList
|
|
10
11
|
} from 'ordering-components/native';
|
|
11
12
|
import { NotFoundSource } from '../NotFoundSource';
|
|
12
|
-
import { OText,
|
|
13
|
+
import { OText, OIcon } from '../shared';
|
|
13
14
|
import { IterateCategories } from './IterateCategories';
|
|
14
15
|
import { ProductList } from './ProductList'
|
|
15
16
|
|
|
@@ -17,10 +18,16 @@ const BusinessProductListUI = (props: any) => {
|
|
|
17
18
|
const {
|
|
18
19
|
navigation,
|
|
19
20
|
businessState,
|
|
20
|
-
|
|
21
|
-
categoryState,
|
|
21
|
+
productsList,
|
|
22
22
|
updateStoreCategory,
|
|
23
|
-
updateStoreProduct
|
|
23
|
+
updateStoreProduct,
|
|
24
|
+
productSearch,
|
|
25
|
+
categorySearch,
|
|
26
|
+
handleChangeCategory,
|
|
27
|
+
handleChangeProductSearch,
|
|
28
|
+
handleChangeCategorySearch,
|
|
29
|
+
getCategoryProducts,
|
|
30
|
+
categories
|
|
24
31
|
} = props;
|
|
25
32
|
|
|
26
33
|
const { loading, error, business } = businessState;
|
|
@@ -59,28 +66,51 @@ const BusinessProductListUI = (props: any) => {
|
|
|
59
66
|
sectionTitle: {
|
|
60
67
|
fontStyle: 'normal',
|
|
61
68
|
fontWeight: '600',
|
|
62
|
-
fontSize:
|
|
69
|
+
fontSize: 20,
|
|
63
70
|
color: theme.colors.textGray,
|
|
64
71
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
borderStyle: {
|
|
73
|
+
borderColor: theme.colors.red,
|
|
74
|
+
borderWidth: 0,
|
|
75
|
+
borderRadius: 10,
|
|
76
|
+
},
|
|
77
|
+
btnBackArrow: {
|
|
78
|
+
borderWidth: 0,
|
|
79
|
+
width: 32,
|
|
80
|
+
height: 32,
|
|
81
|
+
tintColor: theme.colors.textGray,
|
|
82
|
+
backgroundColor: theme.colors.clear,
|
|
83
|
+
borderColor: theme.colors.clear,
|
|
84
|
+
shadowColor: theme.colors.clear,
|
|
85
|
+
paddingLeft: 0,
|
|
86
|
+
paddingRight: 0
|
|
70
87
|
},
|
|
71
88
|
});
|
|
72
89
|
|
|
73
90
|
return (
|
|
74
91
|
<>
|
|
75
92
|
<View style={styles.header}>
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
93
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
94
|
+
<TouchableOpacity
|
|
95
|
+
onPress={() => navigation?.canGoBack() && navigation.goBack()}
|
|
96
|
+
style={styles.btnBackArrow}
|
|
97
|
+
>
|
|
98
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textGray} />
|
|
99
|
+
</TouchableOpacity>
|
|
100
|
+
<OText style={styles.sectionTitle}>{t('CATEGORIES', 'Categories')}</OText>
|
|
101
|
+
</View>
|
|
102
|
+
<View style={{ flexDirection: 'row', justifyContent: 'flex-end' }}>
|
|
103
|
+
<SearchBar
|
|
104
|
+
borderStyle={styles.borderStyle}
|
|
105
|
+
onSearch={handleChangeCategorySearch}
|
|
106
|
+
searchValue={categorySearch}
|
|
107
|
+
lazyLoad
|
|
108
|
+
isCancelXButtonShow={!!categorySearch}
|
|
109
|
+
onCancel={() => handleChangeCategorySearch('')}
|
|
110
|
+
placeholder={t('SEARCH', 'Search')}
|
|
111
|
+
containerStyle={{ width: 180 }}
|
|
112
|
+
/>
|
|
113
|
+
</View>
|
|
84
114
|
</View>
|
|
85
115
|
<ScrollView
|
|
86
116
|
showsVerticalScrollIndicator={false}
|
|
@@ -92,7 +122,7 @@ const BusinessProductListUI = (props: any) => {
|
|
|
92
122
|
conditioned={false}
|
|
93
123
|
/>
|
|
94
124
|
)}
|
|
95
|
-
{!error && !loading &&
|
|
125
|
+
{!error && !loading && categories?.length > 0 && (
|
|
96
126
|
<View
|
|
97
127
|
style={{
|
|
98
128
|
borderTopColor: theme.colors.borderTops,
|
|
@@ -100,7 +130,7 @@ const BusinessProductListUI = (props: any) => {
|
|
|
100
130
|
}}
|
|
101
131
|
>
|
|
102
132
|
<IterateCategories
|
|
103
|
-
list={
|
|
133
|
+
list={categories}
|
|
104
134
|
handlerClickCategory={handleOpenProducts}
|
|
105
135
|
updateCategory={updateStoreCategory}
|
|
106
136
|
/>
|
|
@@ -143,8 +173,11 @@ const BusinessProductListUI = (props: any) => {
|
|
|
143
173
|
}}
|
|
144
174
|
>
|
|
145
175
|
<ProductList
|
|
146
|
-
|
|
176
|
+
productsList={productsList}
|
|
147
177
|
updateProduct={updateStoreProduct}
|
|
178
|
+
searchValue={productSearch}
|
|
179
|
+
handleChangeSearch={handleChangeProductSearch}
|
|
180
|
+
getCategoryProducts={getCategoryProducts}
|
|
148
181
|
onClose={() => setShowModal(false)}
|
|
149
182
|
/>
|
|
150
183
|
</View>
|
|
@@ -156,9 +189,8 @@ const BusinessProductListUI = (props: any) => {
|
|
|
156
189
|
export const BusinessProductList = (props: any) => {
|
|
157
190
|
const businessProductListProps = {
|
|
158
191
|
...props,
|
|
159
|
-
isFetchAllProducts: true,
|
|
160
192
|
UIComponent: BusinessProductListUI,
|
|
161
193
|
};
|
|
162
194
|
|
|
163
|
-
return <
|
|
195
|
+
return <StoreProductList {...businessProductListProps} />;
|
|
164
196
|
};
|