ordering-ui-react-native 0.16.12 → 0.16.13-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 -4
- package/src/DeliveryApp.tsx +43 -1
- package/src/components/ActiveOrders/index.tsx +61 -63
- package/src/components/ActiveOrders/styles.tsx +8 -14
- package/src/components/AddressForm/index.tsx +18 -2
- package/src/components/BusinessBasicInformation/index.tsx +11 -19
- package/src/components/BusinessController/index.tsx +10 -8
- package/src/components/BusinessInformation/index.tsx +22 -0
- package/src/components/BusinessProductsList/index.tsx +10 -10
- package/src/components/BusinessTypeFilter/index.tsx +1 -2
- package/src/components/BusinessesListing/index.tsx +1 -1
- package/src/components/Checkout/index.tsx +2 -1
- package/src/components/LanguageSelector/index.tsx +21 -16
- package/src/components/LoginForm/index.tsx +118 -30
- package/src/components/LoginForm/styles.tsx +6 -0
- package/src/components/Messages/index.tsx +2 -2
- package/src/components/NotificationSetting/index.tsx +85 -0
- package/src/components/OrderDetails/index.tsx +7 -21
- package/src/components/OrdersOption/index.tsx +54 -56
- package/src/components/PaymentOptions/index.tsx +335 -365
- package/src/components/PaymentOptionsWebView/index.tsx +120 -121
- package/src/components/ReviewDriver/index.tsx +1 -1
- package/src/components/ReviewOrder/index.tsx +2 -1
- package/src/components/ReviewProducts/index.tsx +11 -0
- package/src/components/SignupForm/index.tsx +143 -61
- package/src/components/SingleProductReview/index.tsx +8 -5
- package/src/components/StripeElementsForm/index.tsx +25 -16
- package/src/components/VerifyPhone/styles.tsx +1 -2
- package/src/components/shared/OBottomPopup.tsx +6 -2
- package/src/index.tsx +2 -0
- package/src/navigators/CheckoutNavigator.tsx +6 -0
- package/src/navigators/HomeNavigator.tsx +6 -0
- package/src/pages/BusinessesListing.tsx +7 -6
- package/src/pages/MultiCheckout.tsx +31 -0
- package/src/pages/MultiOrdersDetails.tsx +27 -0
- package/src/pages/OrderDetails.tsx +1 -1
- package/src/pages/ReviewDriver.tsx +2 -2
- package/src/pages/ReviewOrder.tsx +2 -2
- package/src/theme.json +0 -1
- package/src/types/@fatnlazycat/react-native-recaptcha-v3/index.d.ts +1 -0
- package/src/types/index.tsx +13 -9
- package/src/utils/index.tsx +0 -1
- package/themes/business/index.tsx +4 -0
- package/themes/business/src/components/BusinessController/index.tsx +2 -2
- package/themes/business/src/components/Chat/index.tsx +42 -34
- package/themes/business/src/components/DriverMap/index.tsx +13 -10
- package/themes/business/src/components/DriverSchedule/index.tsx +71 -0
- package/themes/business/src/components/DriverSchedule/styles.tsx +6 -0
- package/themes/business/src/components/LoginForm/index.tsx +111 -74
- package/themes/business/src/components/MapView/index.tsx +1 -1
- package/themes/business/src/components/MessagesOption/index.tsx +11 -1
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +3 -3
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +19 -18
- package/themes/business/src/components/OrdersListManager/index.tsx +10 -3
- package/themes/business/src/components/OrdersOption/index.tsx +65 -21
- 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/index.tsx +21 -23
- package/themes/business/src/components/ProductItemAccordion/index.tsx +5 -4
- package/themes/business/src/components/ReviewCustomer/index.tsx +1 -1
- package/themes/business/src/components/ScheduleBlocked/index.tsx +53 -0
- package/themes/business/src/components/UserFormDetails/index.tsx +5 -2
- package/themes/business/src/components/UserProfileForm/index.tsx +28 -4
- 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/OModal.tsx +40 -37
- package/themes/business/src/types/index.tsx +14 -9
- package/themes/business/src/utils/index.tsx +10 -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/BusinessMenu/index.tsx +2 -1
- package/themes/kiosk/src/components/CartItem/index.tsx +4 -3
- package/themes/kiosk/src/components/CategoriesMenu/index.tsx +1 -0
- package/themes/kiosk/src/components/Checkout/index.tsx +6 -0
- package/themes/kiosk/src/components/DrawerView/index.tsx +1 -0
- package/themes/kiosk/src/components/DrawerView/styles.tsx +2 -2
- package/themes/kiosk/src/components/LoginForm/index.tsx +121 -10
- package/themes/kiosk/src/components/LoginForm/styles.tsx +5 -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/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +16 -0
- package/themes/original/src/components/AddressForm/index.tsx +136 -133
- package/themes/original/src/components/AddressList/index.tsx +1 -1
- package/themes/original/src/components/AppleLogin/index.tsx +4 -4
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +302 -160
- package/themes/original/src/components/BusinessBasicInformation/styles.tsx +6 -2
- package/themes/original/src/components/BusinessController/index.tsx +173 -108
- package/themes/original/src/components/BusinessItemAccordion/index.tsx +12 -9
- package/themes/original/src/components/BusinessItemAccordion/styles.tsx +3 -1
- 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 +106 -126
- package/themes/original/src/components/BusinessListingSearch/styles.tsx +18 -13
- package/themes/original/src/components/BusinessProductsList/CategoryDescription/index.tsx +44 -0
- 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 +60 -77
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +290 -181
- package/themes/original/src/components/BusinessProductsListing/styles.tsx +18 -0
- package/themes/original/src/components/BusinessReviews/index.tsx +6 -1
- package/themes/original/src/components/BusinessTypeFilter/index.tsx +109 -40
- package/themes/original/src/components/BusinessTypeFilter/styles.tsx +2 -0
- package/themes/original/src/components/BusinessesListing/Layout/Appointment/index.tsx +561 -0
- package/themes/original/src/components/BusinessesListing/{styles.tsx → Layout/Appointment/styles.tsx} +24 -2
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +676 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +137 -0
- package/themes/original/src/components/BusinessesListing/index.tsx +100 -484
- package/themes/original/src/components/Cart/index.tsx +81 -36
- package/themes/original/src/components/Cart/styles.tsx +4 -0
- package/themes/original/src/components/CartContent/index.tsx +22 -16
- package/themes/original/src/components/Checkout/index.tsx +106 -66
- package/themes/original/src/components/Checkout/styles.tsx +0 -1
- package/themes/original/src/components/DriverTips/index.tsx +4 -4
- package/themes/original/src/components/DriverTips/styles.tsx +2 -1
- package/themes/original/src/components/Favorite/index.tsx +1 -0
- package/themes/original/src/components/Favorite/styles.tsx +1 -0
- package/themes/original/src/components/FavoriteList/index.tsx +143 -94
- package/themes/original/src/components/GPSButton/index.tsx +25 -17
- package/themes/original/src/components/GoogleMap/index.tsx +20 -12
- package/themes/original/src/components/HelpAccountAndPayment/index.tsx +8 -3
- package/themes/original/src/components/HelpGuide/index.tsx +8 -3
- package/themes/original/src/components/HelpOrder/index.tsx +8 -3
- package/themes/original/src/components/LoginForm/Otp/index.tsx +3 -2
- package/themes/original/src/components/LoginForm/index.tsx +79 -42
- package/themes/original/src/components/Messages/index.tsx +17 -17
- package/themes/original/src/components/MomentSelector/index.tsx +197 -0
- package/themes/original/src/components/MomentSelector/styles.tsx +6 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/index.tsx +243 -0
- package/themes/original/src/components/MultiCartsPaymethodsAndWallets/styles.tsx +46 -0
- package/themes/original/src/components/MultiCheckout/index.tsx +304 -0
- package/themes/original/src/components/MultiCheckout/styles.tsx +59 -0
- package/themes/original/src/components/MultiOrdersDetails/SingleOrderCard.tsx +372 -0
- package/themes/original/src/components/MultiOrdersDetails/index.tsx +262 -0
- package/themes/original/src/components/MultiOrdersDetails/styles.tsx +50 -0
- package/themes/original/src/components/MyOrders/index.tsx +177 -27
- package/themes/original/src/components/MyOrders/styles.tsx +8 -1
- package/themes/original/src/components/NavBar/index.tsx +11 -5
- 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/OrderDetails/OrderHistory.tsx +167 -0
- package/themes/original/src/components/OrderDetails/index.tsx +125 -40
- package/themes/original/src/components/OrderDetails/styles.tsx +5 -2
- package/themes/original/src/components/OrderItAgain/index.tsx +75 -0
- package/themes/original/src/components/OrderItAgain/styles.tsx +10 -0
- package/themes/original/src/components/OrderProgress/index.tsx +8 -2
- package/themes/original/src/components/OrderSummary/index.tsx +1 -34
- package/themes/original/src/components/OrderTypeSelector/index.tsx +84 -36
- package/themes/original/src/components/OrderTypeSelector/styles.tsx +19 -1
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/index.tsx +144 -0
- package/themes/original/src/components/OrdersOption/PreviousBusinessOrdered/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/index.tsx +56 -0
- package/themes/original/src/components/OrdersOption/PreviousProductsOrdered/styles.tsx +6 -0
- package/themes/original/src/components/OrdersOption/index.tsx +126 -37
- package/themes/original/src/components/OrdersOption/styles.tsx +4 -1
- package/themes/original/src/components/PaymentOptionWallet/index.tsx +56 -56
- package/themes/original/src/components/PaymentOptions/index.tsx +57 -37
- package/themes/original/src/components/PhoneInputNumber/index.tsx +4 -10
- package/themes/original/src/components/PlaceSpot/index.tsx +243 -47
- package/themes/original/src/components/PlaceSpot/styles.tsx +0 -2
- package/themes/original/src/components/ProductForm/index.tsx +712 -655
- package/themes/original/src/components/ProductForm/styles.tsx +9 -7
- package/themes/original/src/components/ProductItemAccordion/index.tsx +40 -27
- package/themes/original/src/components/ProductOption/index.tsx +1 -1
- package/themes/original/src/components/ProfessionalFilter/index.tsx +129 -0
- package/themes/original/src/components/ProfessionalFilter/styles.tsx +0 -0
- package/themes/original/src/components/ProfessionalProfile/index.tsx +309 -0
- package/themes/original/src/components/ProfessionalProfile/styles.tsx +46 -0
- package/themes/original/src/components/ReviewDriver/index.tsx +6 -6
- package/themes/original/src/components/ReviewOrder/index.tsx +18 -3
- package/themes/original/src/components/ReviewProducts/index.tsx +1 -1
- package/themes/original/src/components/ReviewTrigger/index.tsx +118 -0
- package/themes/original/src/components/ReviewTrigger/styles.tsx +34 -0
- package/themes/original/src/components/SearchBar/index.tsx +10 -5
- package/themes/original/src/components/ServiceForm/index.tsx +608 -0
- package/themes/original/src/components/ServiceForm/styles.tsx +50 -0
- package/themes/original/src/components/SignupForm/index.tsx +301 -158
- package/themes/original/src/components/SingleOrderCard/index.tsx +213 -177
- package/themes/original/src/components/SingleProductCard/index.tsx +198 -110
- package/themes/original/src/components/SingleProductCard/styles.tsx +2 -2
- package/themes/original/src/components/SingleProductReview/index.tsx +30 -3
- package/themes/original/src/components/SingleProductReview/styles.tsx +12 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +25 -9
- package/themes/original/src/components/StripeElementsForm/naked.tsx +2 -2
- package/themes/original/src/components/UpsellingProducts/index.tsx +14 -4
- package/themes/original/src/components/UserDetails/index.tsx +32 -18
- package/themes/original/src/components/UserFormDetails/index.tsx +107 -73
- package/themes/original/src/components/UserProfile/index.tsx +8 -1
- package/themes/original/src/components/UserProfileForm/index.tsx +15 -10
- 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 +174 -162
- package/themes/original/src/components/Wallets/styles.tsx +10 -8
- package/themes/original/src/components/shared/OBottomPopup.tsx +47 -14
- package/themes/original/src/components/shared/OButton.tsx +10 -3
- package/themes/original/src/components/shared/OInput.tsx +3 -2
- package/themes/original/src/layouts/FloatingBottomContainer.tsx +5 -1
- package/themes/original/src/types/index.tsx +160 -47
- package/themes/original/src/utils/index.tsx +77 -0
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -14,6 +14,8 @@ import { Container, WrappButton } from './styles'
|
|
|
14
14
|
import { OButton } from '../shared';
|
|
15
15
|
import { BusinessController } from '../BusinessController';
|
|
16
16
|
import { SingleProductCard } from '../SingleProductCard';
|
|
17
|
+
import { NotFoundSource } from '../NotFoundSource';
|
|
18
|
+
import moment from 'moment';
|
|
17
19
|
|
|
18
20
|
|
|
19
21
|
const FavoriteListUI = (props: FavoriteParams) => {
|
|
@@ -72,6 +74,17 @@ const FavoriteListUI = (props: FavoriteParams) => {
|
|
|
72
74
|
return objectStatus && objectStatus
|
|
73
75
|
}
|
|
74
76
|
|
|
77
|
+
const onProductClick = (product: any) => {
|
|
78
|
+
const categoryId = product?.category?.id
|
|
79
|
+
const businessId = product?.category?.business?.id
|
|
80
|
+
if (!categoryId || !businessId) return
|
|
81
|
+
onNavigationRedirect && onNavigationRedirect('ProductDetails', {
|
|
82
|
+
productId: product?.id,
|
|
83
|
+
categoryId: categoryId,
|
|
84
|
+
businessId: businessId
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
|
|
75
88
|
useEffect(() => {
|
|
76
89
|
const _businessId = 'businessId:' + reorderState?.result?.business_id
|
|
77
90
|
if (reorderState?.error) {
|
|
@@ -103,55 +116,91 @@ const FavoriteListUI = (props: FavoriteParams) => {
|
|
|
103
116
|
});
|
|
104
117
|
}
|
|
105
118
|
|
|
119
|
+
const BusinessSkeleton = () => {
|
|
120
|
+
return (
|
|
121
|
+
<Placeholder
|
|
122
|
+
Animation={Fade}
|
|
123
|
+
style={{ marginBottom: 20 }}>
|
|
124
|
+
<View style={{ width: '100%' }}>
|
|
125
|
+
<PlaceholderLine
|
|
126
|
+
height={200}
|
|
127
|
+
style={{ marginBottom: 20, borderRadius: 25 }}
|
|
128
|
+
/>
|
|
129
|
+
<View style={{ paddingHorizontal: 10 }}>
|
|
130
|
+
<View
|
|
131
|
+
style={{
|
|
132
|
+
flexDirection: 'row',
|
|
133
|
+
justifyContent: 'space-between',
|
|
134
|
+
}}>
|
|
135
|
+
<PlaceholderLine
|
|
136
|
+
height={25}
|
|
137
|
+
width={40}
|
|
138
|
+
style={{ marginBottom: 10 }}
|
|
139
|
+
/>
|
|
140
|
+
<PlaceholderLine
|
|
141
|
+
height={25}
|
|
142
|
+
width={20}
|
|
143
|
+
style={{ marginBottom: 10 }}
|
|
144
|
+
/>
|
|
145
|
+
</View>
|
|
146
|
+
<PlaceholderLine
|
|
147
|
+
height={20}
|
|
148
|
+
width={30}
|
|
149
|
+
style={{ marginBottom: 10 }}
|
|
150
|
+
/>
|
|
151
|
+
<PlaceholderLine
|
|
152
|
+
height={20}
|
|
153
|
+
width={80}
|
|
154
|
+
style={{ marginBottom: 10 }}
|
|
155
|
+
/>
|
|
156
|
+
</View>
|
|
157
|
+
</View>
|
|
158
|
+
</Placeholder>
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const ProductSkeleton = () => {
|
|
163
|
+
return (
|
|
164
|
+
<Placeholder style={{ padding: 5 }} Animation={Fade}>
|
|
165
|
+
<View style={{ flexDirection: 'row' }}>
|
|
166
|
+
<PlaceholderLine
|
|
167
|
+
width={24}
|
|
168
|
+
height={70}
|
|
169
|
+
style={{ marginRight: 10, marginBottom: 10 }}
|
|
170
|
+
/>
|
|
171
|
+
<Placeholder style={{ paddingVertical: 10 }}>
|
|
172
|
+
<PlaceholderLine width={60} style={{ marginBottom: 25 }} />
|
|
173
|
+
<PlaceholderLine width={20} />
|
|
174
|
+
</Placeholder>
|
|
175
|
+
</View>
|
|
176
|
+
</Placeholder>
|
|
177
|
+
)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const OrderSkeleton = () => {
|
|
181
|
+
return (
|
|
182
|
+
<Placeholder style={{ padding: 5 }} Animation={Fade}>
|
|
183
|
+
<View style={{ flexDirection: 'row' }}>
|
|
184
|
+
<PlaceholderLine
|
|
185
|
+
width={24}
|
|
186
|
+
height={70}
|
|
187
|
+
style={{ marginRight: 10, marginBottom: 10 }}
|
|
188
|
+
/>
|
|
189
|
+
<Placeholder style={{ paddingVertical: 10 }}>
|
|
190
|
+
<PlaceholderLine width={60} style={{ marginBottom: 25 }} />
|
|
191
|
+
<PlaceholderLine width={20} />
|
|
192
|
+
</Placeholder>
|
|
193
|
+
</View>
|
|
194
|
+
</Placeholder>
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
|
|
106
198
|
return (
|
|
107
199
|
<Container>
|
|
108
200
|
{isBusiness && (
|
|
109
201
|
<>
|
|
110
|
-
{favoriteList?.
|
|
111
|
-
|
|
112
|
-
<Placeholder
|
|
113
|
-
Animation={Fade}
|
|
114
|
-
key={i}
|
|
115
|
-
style={{ marginBottom: 20 }}>
|
|
116
|
-
<View style={{ width: '100%' }}>
|
|
117
|
-
<PlaceholderLine
|
|
118
|
-
height={200}
|
|
119
|
-
style={{ marginBottom: 20, borderRadius: 25 }}
|
|
120
|
-
/>
|
|
121
|
-
<View style={{ paddingHorizontal: 10 }}>
|
|
122
|
-
<View
|
|
123
|
-
style={{
|
|
124
|
-
flexDirection: 'row',
|
|
125
|
-
justifyContent: 'space-between',
|
|
126
|
-
}}>
|
|
127
|
-
<PlaceholderLine
|
|
128
|
-
height={25}
|
|
129
|
-
width={40}
|
|
130
|
-
style={{ marginBottom: 10 }}
|
|
131
|
-
/>
|
|
132
|
-
<PlaceholderLine
|
|
133
|
-
height={25}
|
|
134
|
-
width={20}
|
|
135
|
-
style={{ marginBottom: 10 }}
|
|
136
|
-
/>
|
|
137
|
-
</View>
|
|
138
|
-
<PlaceholderLine
|
|
139
|
-
height={20}
|
|
140
|
-
width={30}
|
|
141
|
-
style={{ marginBottom: 10 }}
|
|
142
|
-
/>
|
|
143
|
-
<PlaceholderLine
|
|
144
|
-
height={20}
|
|
145
|
-
width={80}
|
|
146
|
-
style={{ marginBottom: 10 }}
|
|
147
|
-
/>
|
|
148
|
-
</View>
|
|
149
|
-
</View>
|
|
150
|
-
</Placeholder>
|
|
151
|
-
))
|
|
152
|
-
)}
|
|
153
|
-
{!favoriteList?.loading && favoriteList?.favorites?.length > 0 && (
|
|
154
|
-
favoriteList.favorites.map((business: any, i:number) => (
|
|
202
|
+
{favoriteList?.favorites?.length > 0 && (
|
|
203
|
+
favoriteList.favorites?.sort((a: any, b: any) => a?.name?.toLowerCase() > b?.name?.toLowerCase()).map((business: any, i:number) => (
|
|
155
204
|
<BusinessController
|
|
156
205
|
key={`${business.id}_` + i}
|
|
157
206
|
business={business}
|
|
@@ -171,76 +220,76 @@ const FavoriteListUI = (props: FavoriteParams) => {
|
|
|
171
220
|
/>
|
|
172
221
|
))
|
|
173
222
|
)}
|
|
223
|
+
{favoriteList?.loading && (
|
|
224
|
+
[...Array(5).keys()].map(i => (
|
|
225
|
+
<BusinessSkeleton key={i} />
|
|
226
|
+
))
|
|
227
|
+
)}
|
|
228
|
+
{!favoriteList?.loading && !favoriteList?.favorites?.length && (
|
|
229
|
+
<NotFoundSource
|
|
230
|
+
content={t('NOT_FOUND_FAVORITES_LIST', 'No favorites to show at this time.')
|
|
231
|
+
}
|
|
232
|
+
/>
|
|
233
|
+
)}
|
|
174
234
|
</>
|
|
175
235
|
)}
|
|
176
236
|
|
|
177
237
|
{isOrder && (
|
|
178
238
|
<>
|
|
239
|
+
{favoriteList?.favorites?.length > 0 && (
|
|
240
|
+
favoriteList.favorites?.sort((a: any, b:any) => moment(a?.delivery_datetime_utc).valueOf() - moment(b?.delivery_datetime_utc).valueOf())
|
|
241
|
+
.map((order: any, i: number) => (
|
|
242
|
+
<SingleOrderCard
|
|
243
|
+
key={`${order?.id}_${i}`}
|
|
244
|
+
order={order}
|
|
245
|
+
getOrderStatus={getOrderStatus}
|
|
246
|
+
onNavigationRedirect={onNavigationRedirect}
|
|
247
|
+
pastOrders={pastOrders.includes(order?.status)}
|
|
248
|
+
handleUpdateOrderList={handleUpdateFavoriteList}
|
|
249
|
+
handleUpdateFavoriteList={handleUpdateFavoriteList}
|
|
250
|
+
handleReorder={handleReorder}
|
|
251
|
+
reorderLoading={reorderState?.loading}
|
|
252
|
+
/>
|
|
253
|
+
))
|
|
254
|
+
)}
|
|
179
255
|
{favoriteList?.loading && (
|
|
180
256
|
[...Array(5).keys()].map(i => (
|
|
181
|
-
<
|
|
182
|
-
<View style={{ flexDirection: 'row' }}>
|
|
183
|
-
<PlaceholderLine
|
|
184
|
-
width={24}
|
|
185
|
-
height={70}
|
|
186
|
-
style={{ marginRight: 10, marginBottom: 10 }}
|
|
187
|
-
/>
|
|
188
|
-
<Placeholder style={{ paddingVertical: 10 }}>
|
|
189
|
-
<PlaceholderLine width={60} style={{ marginBottom: 25 }} />
|
|
190
|
-
<PlaceholderLine width={20} />
|
|
191
|
-
</Placeholder>
|
|
192
|
-
</View>
|
|
193
|
-
</Placeholder>
|
|
257
|
+
<OrderSkeleton key={i} />
|
|
194
258
|
))
|
|
195
259
|
)}
|
|
196
|
-
{!favoriteList?.loading && favoriteList?.favorites?.length
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
getOrderStatus={getOrderStatus}
|
|
202
|
-
onNavigationRedirect={onNavigationRedirect}
|
|
203
|
-
pastOrders={pastOrders.includes(order?.status)}
|
|
204
|
-
handleUpdateOrderList={handleUpdateFavoriteList}
|
|
205
|
-
handleUpdateFavoriteList={handleUpdateFavoriteList}
|
|
206
|
-
handleReorder={handleReorder}
|
|
207
|
-
reorderLoading={reorderState?.loading}
|
|
208
|
-
/>
|
|
209
|
-
))
|
|
260
|
+
{!favoriteList?.loading && !favoriteList?.favorites?.length && (
|
|
261
|
+
<NotFoundSource
|
|
262
|
+
content={t('NOT_FOUND_FAVORITES_LIST', 'No favorites to show at this time.')
|
|
263
|
+
}
|
|
264
|
+
/>
|
|
210
265
|
)}
|
|
211
266
|
</>
|
|
212
267
|
)}
|
|
213
268
|
|
|
214
269
|
{isProduct && (
|
|
215
270
|
<>
|
|
216
|
-
{favoriteList?.
|
|
217
|
-
|
|
218
|
-
<Placeholder key={i} style={{ padding: 5 }} Animation={Fade}>
|
|
219
|
-
<View style={{ flexDirection: 'row' }}>
|
|
220
|
-
<PlaceholderLine
|
|
221
|
-
width={24}
|
|
222
|
-
height={70}
|
|
223
|
-
style={{ marginRight: 10, marginBottom: 10 }}
|
|
224
|
-
/>
|
|
225
|
-
<Placeholder style={{ paddingVertical: 10 }}>
|
|
226
|
-
<PlaceholderLine width={60} style={{ marginBottom: 25 }} />
|
|
227
|
-
<PlaceholderLine width={20} />
|
|
228
|
-
</Placeholder>
|
|
229
|
-
</View>
|
|
230
|
-
</Placeholder>
|
|
231
|
-
))
|
|
232
|
-
)}
|
|
233
|
-
{!favoriteList?.loading && favoriteList?.favorites?.length > 0 && (
|
|
234
|
-
favoriteList.favorites.map((product: any) => (
|
|
271
|
+
{favoriteList?.favorites?.length > 0 && (
|
|
272
|
+
favoriteList.favorites?.sort((a: any, b: any) => a?.name?.toLowerCase() > b?.name?.toLowerCase()).map((product: any, i: number) => (
|
|
235
273
|
<SingleProductCard
|
|
236
|
-
key={product?.id}
|
|
237
|
-
isSoldOut={product
|
|
274
|
+
key={`${product?.id}_${i}`}
|
|
275
|
+
isSoldOut={product?.inventoried && !product?.quantity}
|
|
238
276
|
product={product}
|
|
239
|
-
onProductClick={
|
|
277
|
+
onProductClick={onProductClick}
|
|
240
278
|
handleUpdateProducts={handleUpdateFavoriteList}
|
|
241
279
|
/>
|
|
242
280
|
))
|
|
243
281
|
)}
|
|
282
|
+
{favoriteList?.loading && (
|
|
283
|
+
[...Array(5).keys()].map(i => (
|
|
284
|
+
<ProductSkeleton key={i} />
|
|
285
|
+
))
|
|
286
|
+
)}
|
|
287
|
+
{!favoriteList?.loading && !favoriteList?.favorites?.length && (
|
|
288
|
+
<NotFoundSource
|
|
289
|
+
content={t('NOT_FOUND_FAVORITES_LIST', 'No favorites to show at this time.')
|
|
290
|
+
}
|
|
291
|
+
/>
|
|
292
|
+
)}
|
|
244
293
|
</>
|
|
245
294
|
)}
|
|
246
295
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
-
import Geolocation from '@react-native-community/geolocation'
|
|
3
2
|
import Geocoder from 'react-native-geocoding'
|
|
4
|
-
import { GpsButtonStyle } from './styles'
|
|
5
|
-
import { View } from 'react-native'
|
|
6
|
-
import { OText } from '../shared'
|
|
7
3
|
import { ActivityIndicator } from 'react-native-paper'
|
|
4
|
+
import Geolocation from '@react-native-community/geolocation'
|
|
5
|
+
import { getTrackingStatus, requestTrackingPermission } from 'react-native-tracking-transparency'
|
|
6
|
+
|
|
7
|
+
import { OText } from '../shared'
|
|
8
|
+
import { GpsButtonStyle } from './styles'
|
|
8
9
|
|
|
9
10
|
export const GPSButton = (props: any) => {
|
|
10
11
|
const {
|
|
11
12
|
handleGPS,
|
|
12
13
|
apiKey,
|
|
13
|
-
googleReady,
|
|
14
14
|
IconButton,
|
|
15
15
|
IconLoadingButton
|
|
16
16
|
} = props
|
|
@@ -55,19 +55,27 @@ export const GPSButton = (props: any) => {
|
|
|
55
55
|
})
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
const getCurrentPosition = async () => {
|
|
59
|
+
let trackingStatus = await getTrackingStatus()
|
|
60
|
+
if (trackingStatus === 'not-determined') {
|
|
61
|
+
trackingStatus = await requestTrackingPermission()
|
|
62
|
+
}
|
|
63
|
+
if (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {
|
|
64
|
+
setLoading(true)
|
|
65
|
+
Geolocation.getCurrentPosition((pos) => {
|
|
66
|
+
geoCodePosition(pos.coords)
|
|
67
|
+
}, (err) => {
|
|
68
|
+
setLoading(false);
|
|
69
|
+
console.log(`ERROR(${err.code}): ${err.message}`)
|
|
70
|
+
}, {
|
|
71
|
+
enableHighAccuracy: true, timeout: 15000, maximumAge: 10000
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
}
|
|
67
75
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
Geocoder.init(apiKey);
|
|
78
|
+
}, [])
|
|
71
79
|
|
|
72
80
|
return (
|
|
73
81
|
<GpsButtonStyle
|
|
@@ -32,6 +32,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
32
32
|
latitudeDelta: 0.0010,
|
|
33
33
|
longitudeDelta: 0.0010 * ASPECT_RATIO
|
|
34
34
|
})
|
|
35
|
+
const [MARKERS, SETMARKERS] = useState(locations)
|
|
35
36
|
let mapRef = useRef<any>(null)
|
|
36
37
|
const googleMapsApiKey = configState?.configs?.google_maps_api_key?.value
|
|
37
38
|
|
|
@@ -41,12 +42,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
41
42
|
ERROR_NOT_FOUND_ADDRESS: 'Sorry, we couldn\'t find an address',
|
|
42
43
|
ERROR_MAX_LIMIT_LOCATION: `Sorry, You can only set the position to ${maxLimitLocation}m`
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
latitude: location.lat,
|
|
47
|
-
longitude: location.lng
|
|
48
|
-
}
|
|
49
|
-
})
|
|
45
|
+
|
|
50
46
|
const geocodePosition = (pos: { latitude: number, longitude: number }) => {
|
|
51
47
|
Geocoder.from({
|
|
52
48
|
latitude: pos.latitude,
|
|
@@ -93,7 +89,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
93
89
|
return
|
|
94
90
|
}
|
|
95
91
|
|
|
96
|
-
|
|
92
|
+
const _maxLimitLocation = typeof maxLimitLocation === 'string' ? parseInt(maxLimitLocation, 10) : maxLimitLocation
|
|
93
|
+
|
|
94
|
+
if (distance <= _maxLimitLocation) {
|
|
97
95
|
setMarkerPosition(curPos)
|
|
98
96
|
setRegion({ ...region, longitude: curPos.longitude, latitude: curPos.latitude })
|
|
99
97
|
} else {
|
|
@@ -147,7 +145,7 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
147
145
|
}
|
|
148
146
|
|
|
149
147
|
const fitAllMarkers = () => {
|
|
150
|
-
mapRef.current.fitToCoordinates(MARKERS, {
|
|
148
|
+
mapRef.current.fitToCoordinates(MARKERS?.map(location => ({ latitude: location.lat, longitude: location.lng })), {
|
|
151
149
|
edgePadding: { top: 80, right: 80, bottom: 80, left: 80 },
|
|
152
150
|
animated: true,
|
|
153
151
|
});
|
|
@@ -157,6 +155,13 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
157
155
|
Geocoder.init(googleMapsApiKey)
|
|
158
156
|
}, [])
|
|
159
157
|
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
mapRef.current.animateToRegion({
|
|
160
|
+
...region,
|
|
161
|
+
latitude: location?.lat,
|
|
162
|
+
longitude: location?.lng,
|
|
163
|
+
})
|
|
164
|
+
}, [location])
|
|
160
165
|
|
|
161
166
|
useEffect(() => {
|
|
162
167
|
if (saveLocation) {
|
|
@@ -170,6 +175,9 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
170
175
|
fitAllMarkers()
|
|
171
176
|
}
|
|
172
177
|
}, 1000)
|
|
178
|
+
if (locations) {
|
|
179
|
+
SETMARKERS(locations)
|
|
180
|
+
}
|
|
173
181
|
return () => clearInterval(interval)
|
|
174
182
|
}, [locations])
|
|
175
183
|
|
|
@@ -189,16 +197,16 @@ export const GoogleMap = (props: GoogleMapsParams) => {
|
|
|
189
197
|
>
|
|
190
198
|
{locations ? (
|
|
191
199
|
<>
|
|
192
|
-
{MARKERS && MARKERS.map((location: {
|
|
200
|
+
{MARKERS && MARKERS.map((location: { lat: number, lng: number }, i: number) => (
|
|
193
201
|
<React.Fragment key={i}>
|
|
194
202
|
{
|
|
195
203
|
<Marker
|
|
196
204
|
zIndex={i}
|
|
197
|
-
coordinate={location}
|
|
198
|
-
title={
|
|
205
|
+
coordinate={{ latitude: location.lat ?? 0, longitude: location.lng ?? 0 }}
|
|
206
|
+
title={MARKERS[i]?.title}
|
|
199
207
|
>
|
|
200
208
|
<View>
|
|
201
|
-
<OIcon url={
|
|
209
|
+
<OIcon url={MARKERS[i].icon} width={50} height={50} />
|
|
202
210
|
</View>
|
|
203
211
|
</Marker>
|
|
204
212
|
}
|
|
@@ -3,7 +3,8 @@ import { useLanguage } from 'ordering-components/native'
|
|
|
3
3
|
import { HelpAccountAndPaymentParams } from '../../types'
|
|
4
4
|
import { OText, OButton, OIcon } from '../shared'
|
|
5
5
|
import { useTheme } from 'styled-components/native'
|
|
6
|
-
import { StyleSheet } from 'react-native'
|
|
6
|
+
import { StyleSheet, TouchableOpacity } from 'react-native'
|
|
7
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
10
|
Content
|
|
@@ -38,10 +39,14 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
|
|
|
38
39
|
return (
|
|
39
40
|
<>
|
|
40
41
|
<OButton
|
|
41
|
-
imgLeftSrc={theme.images.general.arrow_left}
|
|
42
42
|
imgRightSrc={null}
|
|
43
43
|
style={styles.btnBackArrow}
|
|
44
44
|
onClick={() => goToBack()}
|
|
45
|
+
icon={AntDesignIcon}
|
|
46
|
+
iconProps={{
|
|
47
|
+
name: 'arrowleft',
|
|
48
|
+
size: 26
|
|
49
|
+
}}
|
|
45
50
|
/>
|
|
46
51
|
<OText size={22} weight={600}>{t('ACCOUNT_PAYMENT_OPTIONS', 'Account and Payment Options')}</OText>
|
|
47
52
|
<Content>
|
|
@@ -65,4 +70,4 @@ export const HelpAccountAndPayment = (props: HelpAccountAndPaymentParams) => {
|
|
|
65
70
|
</Content>
|
|
66
71
|
</>
|
|
67
72
|
)
|
|
68
|
-
}
|
|
73
|
+
}
|
|
@@ -3,10 +3,11 @@ import { useLanguage } from 'ordering-components/native'
|
|
|
3
3
|
import { HelpGuideParams } from '../../types'
|
|
4
4
|
import { OText, OButton, OIcon } from '../shared'
|
|
5
5
|
import { useTheme } from 'styled-components/native'
|
|
6
|
-
import { StyleSheet } from 'react-native'
|
|
6
|
+
import { StyleSheet, TouchableOpacity } from 'react-native'
|
|
7
7
|
import {
|
|
8
8
|
Content
|
|
9
9
|
} from './styles'
|
|
10
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
10
11
|
|
|
11
12
|
export const HelpGuide = (props: HelpGuideParams) => {
|
|
12
13
|
const {
|
|
@@ -37,10 +38,14 @@ export const HelpGuide = (props: HelpGuideParams) => {
|
|
|
37
38
|
return (
|
|
38
39
|
<>
|
|
39
40
|
<OButton
|
|
40
|
-
imgLeftSrc={theme.images.general.arrow_left}
|
|
41
41
|
imgRightSrc={null}
|
|
42
42
|
style={styles.btnBackArrow}
|
|
43
43
|
onClick={() => goToBack()}
|
|
44
|
+
icon={AntDesignIcon}
|
|
45
|
+
iconProps={{
|
|
46
|
+
name: 'arrowleft',
|
|
47
|
+
size: 26
|
|
48
|
+
}}
|
|
44
49
|
/>
|
|
45
50
|
<OText size={22} weight={600}>{t('GUIDE_TO_ORDERING', 'Guide to Ordering')}</OText>
|
|
46
51
|
<Content>
|
|
@@ -64,4 +69,4 @@ export const HelpGuide = (props: HelpGuideParams) => {
|
|
|
64
69
|
</Content>
|
|
65
70
|
</>
|
|
66
71
|
)
|
|
67
|
-
}
|
|
72
|
+
}
|
|
@@ -3,8 +3,9 @@ import { useLanguage } from 'ordering-components/native'
|
|
|
3
3
|
import { HelpOrderParams } from '../../types'
|
|
4
4
|
import { OText, OButton, OIcon } from '../shared'
|
|
5
5
|
import { useTheme } from 'styled-components/native'
|
|
6
|
-
import { StyleSheet } from 'react-native'
|
|
6
|
+
import { StyleSheet, TouchableOpacity } from 'react-native'
|
|
7
7
|
import { WebView } from 'react-native-webview'
|
|
8
|
+
import AntDesignIcon from 'react-native-vector-icons/AntDesign'
|
|
8
9
|
|
|
9
10
|
import {
|
|
10
11
|
Content
|
|
@@ -42,10 +43,14 @@ export const HelpOrder = (props: HelpOrderParams) => {
|
|
|
42
43
|
return (
|
|
43
44
|
<>
|
|
44
45
|
<OButton
|
|
45
|
-
imgLeftSrc={theme.images.general.arrow_left}
|
|
46
46
|
imgRightSrc={null}
|
|
47
47
|
style={styles.btnBackArrow}
|
|
48
48
|
onClick={() => goToBack()}
|
|
49
|
+
icon={AntDesignIcon}
|
|
50
|
+
iconProps={{
|
|
51
|
+
name: 'arrowleft',
|
|
52
|
+
size: 26
|
|
53
|
+
}}
|
|
49
54
|
/>
|
|
50
55
|
<OText size={22} weight={600}>{t('HELP_WITH_ORDER', 'Help with an order')}</OText>
|
|
51
56
|
<Content>
|
|
@@ -76,4 +81,4 @@ export const HelpOrder = (props: HelpOrderParams) => {
|
|
|
76
81
|
</Content>
|
|
77
82
|
</>
|
|
78
83
|
)
|
|
79
|
-
}
|
|
84
|
+
}
|
|
@@ -15,7 +15,8 @@ export const Otp = (props: otpParams) => {
|
|
|
15
15
|
setWillVerifyOtpState,
|
|
16
16
|
onSubmit,
|
|
17
17
|
handleLoginOtp,
|
|
18
|
-
setAlertState
|
|
18
|
+
setAlertState,
|
|
19
|
+
pinCount
|
|
19
20
|
} = props
|
|
20
21
|
|
|
21
22
|
const theme = useTheme();
|
|
@@ -65,7 +66,7 @@ export const Otp = (props: otpParams) => {
|
|
|
65
66
|
</OText>
|
|
66
67
|
<OTPInputView
|
|
67
68
|
style={{ width: '100%', height: 150 }}
|
|
68
|
-
pinCount={6}
|
|
69
|
+
pinCount={pinCount || 6}
|
|
69
70
|
codeInputFieldStyle={loginStyle.underlineStyleBase}
|
|
70
71
|
codeInputHighlightStyle={loginStyle.underlineStyleHighLighted}
|
|
71
72
|
onCodeFilled={(code: string) => handleLoginOtp(code)}
|