ordering-ui-react-native 0.16.13 → 0.16.14-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 +7 -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 +7 -5
- 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 +1 -1
- 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 +53 -53
- 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 -495
- 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 +20 -19
- 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 +187 -49
- package/themes/original/src/components/OrderDetails/styles.tsx +15 -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 +170 -128
- 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 +631 -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 +163 -47
- package/themes/original/src/utils/index.tsx +77 -0
- package/themes/uber-eats/src/components/BusinessesListing/index.tsx +1 -1
|
@@ -49,7 +49,7 @@ export const ProductDescription = styled.View`
|
|
|
49
49
|
`
|
|
50
50
|
|
|
51
51
|
export const ProductEditions = styled.View`
|
|
52
|
-
|
|
52
|
+
padding: 0 40px;
|
|
53
53
|
`
|
|
54
54
|
|
|
55
55
|
export const SectionTitle = styled.View`
|
|
@@ -65,26 +65,24 @@ export const WrapperSubOption = styled.View`
|
|
|
65
65
|
`
|
|
66
66
|
|
|
67
67
|
export const ProductComment = styled.View`
|
|
68
|
-
padding-bottom:
|
|
68
|
+
padding-bottom: ${(props: any) => props.pb || 60}px;
|
|
69
69
|
`
|
|
70
70
|
|
|
71
71
|
export const ProductActions = styled.View`
|
|
72
72
|
position: absolute;
|
|
73
73
|
bottom: 0px;
|
|
74
|
-
min-height: 70px;
|
|
75
74
|
padding-top: ${(props: any) => props.ios ? '20px' : '0'};
|
|
76
75
|
padding-horizontal: 40px;
|
|
76
|
+
padding-vertical: 20px;
|
|
77
77
|
width: 100%;
|
|
78
|
-
flex-direction: row;
|
|
78
|
+
flex-direction: ${(props: any) => props.isColumn ? 'column' : 'row'};
|
|
79
79
|
background-color: #FFF;
|
|
80
80
|
z-index: 1000;
|
|
81
|
-
align-items: center;
|
|
82
|
-
justify-content: space-between;
|
|
83
81
|
border-top-width: 1px;
|
|
84
82
|
border-top-color: ${(props: any) => props.theme.colors.border};
|
|
85
83
|
`
|
|
86
84
|
export const ExtraOptionWrap = styled.ScrollView`
|
|
87
|
-
margin-horizontal:
|
|
85
|
+
margin-horizontal: 30px;
|
|
88
86
|
`;
|
|
89
87
|
|
|
90
88
|
export const WeightUnitSwitch = styled.View`
|
|
@@ -99,4 +97,8 @@ export const WeightUnitItem = styled.View`
|
|
|
99
97
|
`}
|
|
100
98
|
`
|
|
101
99
|
export const ProductSummary = styled.View`
|
|
100
|
+
padding: 26px 40px;
|
|
101
|
+
position: relative;
|
|
102
|
+
background-color: white;
|
|
103
|
+
z-index: 100;
|
|
102
104
|
`
|
|
@@ -4,6 +4,7 @@ import { useUtils, useLanguage, useOrder } from 'ordering-components/native'
|
|
|
4
4
|
import { useTheme } from 'styled-components/native';
|
|
5
5
|
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
|
|
6
6
|
import RNPickerSelect from 'react-native-picker-select'
|
|
7
|
+
import { ServiceForm } from '../ServiceForm';
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
10
|
Accordion,
|
|
@@ -18,7 +19,7 @@ import {
|
|
|
18
19
|
ProductSubOption,
|
|
19
20
|
ProductComment
|
|
20
21
|
} from './styles'
|
|
21
|
-
import { OIcon, OText, OAlert } from '../shared'
|
|
22
|
+
import { OIcon, OText, OAlert, OModal } from '../shared'
|
|
22
23
|
|
|
23
24
|
import { ProductItemAccordionParams } from '../../types'
|
|
24
25
|
|
|
@@ -68,9 +69,10 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
68
69
|
|
|
69
70
|
const [, t] = useLanguage()
|
|
70
71
|
const [orderState] = useOrder()
|
|
71
|
-
const [{ parsePrice, optimizeImage }] = useUtils()
|
|
72
|
+
const [{ parsePrice, optimizeImage, parseDate }] = useUtils()
|
|
72
73
|
|
|
73
74
|
const [isActive, setActiveState] = useState(false)
|
|
75
|
+
const [isServiceOpen, setIsServiceOpen] = useState(false)
|
|
74
76
|
// const [setHeight, setHeightState] = useState({ height: new Animated.Value(0) })
|
|
75
77
|
// const [setRotate, setRotateState] = useState({ angle: new Animated.Value(0) })
|
|
76
78
|
|
|
@@ -92,6 +94,14 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
92
94
|
return product
|
|
93
95
|
}
|
|
94
96
|
|
|
97
|
+
const handleEditProduct = (curProduct: any) => {
|
|
98
|
+
if (!curProduct?.calendar_event) {
|
|
99
|
+
onEditProduct && onEditProduct(curProduct)
|
|
100
|
+
return
|
|
101
|
+
}
|
|
102
|
+
setIsServiceOpen(true)
|
|
103
|
+
}
|
|
104
|
+
|
|
95
105
|
/* const toggleAccordion = () => {
|
|
96
106
|
if ((!product?.valid_menu && isCartProduct)) return
|
|
97
107
|
if (isActive) {
|
|
@@ -133,135 +143,167 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
133
143
|
})
|
|
134
144
|
|
|
135
145
|
return (
|
|
136
|
-
|
|
137
|
-
<
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
<
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
style={
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
146
|
+
<>
|
|
147
|
+
<AccordionSection>
|
|
148
|
+
<Accordion
|
|
149
|
+
isValid={product?.valid ?? true}
|
|
150
|
+
onPress={() => (!product?.valid_menu && isCartProduct)
|
|
151
|
+
? {}
|
|
152
|
+
: setActiveState(!isActive)}
|
|
153
|
+
activeOpacity={1}
|
|
154
|
+
>
|
|
155
|
+
<View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>
|
|
156
|
+
<ContentInfo>
|
|
157
|
+
{(product?.images || theme?.images?.dummies?.product) && (
|
|
158
|
+
<ProductImage>
|
|
159
|
+
{isFromCheckout ? (
|
|
160
|
+
<OIcon url={optimizeImage(product?.images || theme?.images?.dummies?.product, 'h_100,c_limit')} style={{ ...styles.productImage, ...{ width: 82, height: 82 } }} />
|
|
161
|
+
) : (
|
|
162
|
+
<OIcon url={optimizeImage(product?.images || theme?.images?.dummies?.product, 'h_100,c_limit')} style={styles.productImage} />
|
|
163
|
+
)}
|
|
164
|
+
</ProductImage>
|
|
165
|
+
)}
|
|
166
|
+
{!!product?.calendar_event ? (
|
|
167
|
+
<View style={{ flex: 1, marginLeft: 10, flexDirection: 'column' }}>
|
|
168
|
+
<View>
|
|
169
|
+
<OText size={12} lineHeight={18} weight={'400'} numberOfLines={1}>{product?.name}</OText>
|
|
170
|
+
</View>
|
|
171
|
+
<OText size={10} color={theme.colors.textSecondary} style={{ marginTop: 3 }}>
|
|
172
|
+
{parseDate(product?.calendar_event?.start, { outputFormat: 'hh:mm a' })} - {parseDate(product?.calendar_event?.end, { outputFormat: 'hh:mm a' })}
|
|
173
|
+
</OText>
|
|
174
|
+
</View>
|
|
175
|
+
): (
|
|
176
|
+
<>
|
|
177
|
+
{isCartProduct && !isCartPending && getProductMax && (
|
|
178
|
+
<ProductInfo>
|
|
179
|
+
<RNPickerSelect
|
|
180
|
+
items={productOptions}
|
|
181
|
+
onValueChange={handleChangeQuantity}
|
|
182
|
+
value={product.quantity.toString()}
|
|
183
|
+
style={pickerStyle}
|
|
184
|
+
useNativeAndroidPickerStyle={false}
|
|
185
|
+
placeholder={{}}
|
|
186
|
+
Icon={() => <View style={pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} /></View>}
|
|
187
|
+
disabled={orderState.loading}
|
|
188
|
+
/>
|
|
189
|
+
</ProductInfo>
|
|
190
|
+
)}
|
|
191
|
+
{isFromCheckout && (
|
|
192
|
+
<ProductQuantity>
|
|
193
|
+
<OText size={12} lineHeight={18}>
|
|
194
|
+
{product?.quantity}
|
|
195
|
+
</OText>
|
|
196
|
+
</ProductQuantity>
|
|
197
|
+
)}
|
|
198
|
+
<View style={{ flex: 1 }}>
|
|
199
|
+
<OText size={12} lineHeight={18} weight={'400'}>{product.name}</OText>
|
|
200
|
+
</View>
|
|
201
|
+
</>
|
|
202
|
+
)}
|
|
203
|
+
<View style={{ display: 'flex', flexDirection: 'column', flex: 1, alignItems: 'flex-end', maxWidth: 100 }}>
|
|
204
|
+
<View style={{ flexDirection: 'row' }}>
|
|
205
|
+
<OText size={12} lineHeight={18} weight={'400'}>{parsePrice(product.total || product.price)}</OText>
|
|
206
|
+
{(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || product.comment) && (
|
|
207
|
+
<MaterialCommunityIcon name='chevron-down' size={18} />
|
|
208
|
+
)}
|
|
209
|
+
</View>
|
|
210
|
+
<View style={{ display: 'flex', flexDirection: 'row', justifyContent: 'flex-start' }}>
|
|
211
|
+
{onEditProduct && isCartProduct && !isCartPending && product?.valid_menu && (
|
|
212
|
+
<TouchableOpacity onPress={() => handleEditProduct(product)} style={{ marginEnd: 7 }}>
|
|
213
|
+
<OIcon
|
|
214
|
+
src={theme.images.general.pencil}
|
|
215
|
+
width={16}
|
|
216
|
+
color={theme.colors.textSecondary}
|
|
217
|
+
/>
|
|
218
|
+
</TouchableOpacity>
|
|
219
|
+
)}
|
|
220
|
+
{onDeleteProduct && isCartProduct && !isCartPending && (
|
|
221
|
+
<OAlert
|
|
222
|
+
title={t('DELETE_PRODUCT', 'Delete Product')}
|
|
223
|
+
message={t('QUESTION_DELETE_PRODUCT', 'Are you sure that you want to delete the product?')}
|
|
224
|
+
onAccept={() => onDeleteProduct(product)}
|
|
225
|
+
>
|
|
226
|
+
<OIcon
|
|
227
|
+
src={theme.images.general.trash}
|
|
228
|
+
width={17}
|
|
229
|
+
color={theme.colors.textSecondary}
|
|
230
|
+
/>
|
|
231
|
+
</OAlert>
|
|
232
|
+
)}
|
|
233
|
+
</View>
|
|
185
234
|
</View>
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
</TouchableOpacity>
|
|
195
|
-
)}
|
|
196
|
-
{onDeleteProduct && isCartProduct && !isCartPending && (
|
|
197
|
-
<OAlert
|
|
198
|
-
title={t('DELETE_PRODUCT', 'Delete Product')}
|
|
199
|
-
message={t('QUESTION_DELETE_PRODUCT', 'Are you sure that you want to delete the product?')}
|
|
200
|
-
onAccept={() => onDeleteProduct(product)}
|
|
201
|
-
>
|
|
202
|
-
<OIcon
|
|
203
|
-
src={theme.images.general.trash}
|
|
204
|
-
width={17}
|
|
205
|
-
color={theme.colors.textSecondary}
|
|
206
|
-
/>
|
|
207
|
-
</OAlert>
|
|
208
|
-
)}
|
|
235
|
+
</ContentInfo>
|
|
236
|
+
</View>
|
|
237
|
+
{((isCartProduct && !isCartPending && product?.valid_menu && !product?.valid_quantity) ||
|
|
238
|
+
(!product?.valid_menu && isCartProduct && !isCartPending)) && (
|
|
239
|
+
<View style={{ alignItems: 'flex-end', width: '100%', }}>
|
|
240
|
+
<OText size={14} color={theme.colors.red} style={{ textAlign: 'right', marginTop: 5 }}>
|
|
241
|
+
{t('NOT_AVAILABLE', 'Not available')}
|
|
242
|
+
</OText>
|
|
209
243
|
</View>
|
|
210
|
-
</View>
|
|
211
|
-
</ContentInfo>
|
|
212
|
-
</View>
|
|
213
|
-
{((isCartProduct && !isCartPending && product?.valid_menu && !product?.valid_quantity) ||
|
|
214
|
-
(!product?.valid_menu && isCartProduct && !isCartPending)) && (
|
|
215
|
-
<View style={{ alignItems: 'flex-end', width: '100%', }}>
|
|
216
|
-
<OText size={14} color={theme.colors.red} style={{ textAlign: 'right', marginTop: 5 }}>
|
|
217
|
-
{t('NOT_AVAILABLE', 'Not available')}
|
|
218
|
-
</OText>
|
|
219
|
-
</View>
|
|
220
|
-
)}
|
|
221
|
-
</Accordion>
|
|
222
|
-
|
|
223
|
-
<View style={{ display: isActive ? 'flex' : 'none', paddingStart: 40 }}>
|
|
224
|
-
<Animated.View>
|
|
225
|
-
<AccordionContent>
|
|
226
|
-
{productInfo().ingredients.length > 0 && productInfo().ingredients.some((ingredient: any) => !ingredient.selected) && (
|
|
227
|
-
<ProductOptionsList>
|
|
228
|
-
<OText size={10} color={theme.colors.textSecondary}>{t('INGREDIENTS', 'Ingredients')}</OText>
|
|
229
|
-
{productInfo().ingredients.map((ingredient: any) => !ingredient.selected && (
|
|
230
|
-
<OText size={10} color={theme.colors.textThird} key={ingredient.id} style={{ marginLeft: 10 }}>{t('NO', 'No')} {ingredient.name}</OText>
|
|
231
|
-
))}
|
|
232
|
-
</ProductOptionsList>
|
|
233
|
-
)}
|
|
234
|
-
{productInfo().options.length > 0 && (
|
|
235
|
-
<ProductOptionsList>
|
|
236
|
-
{productInfo().options.map((option: any, i: number) => (
|
|
237
|
-
<ProductOption key={option.id + i}>
|
|
238
|
-
<OText size={10} color={theme.colors.textSecondary}>{option.name}</OText>
|
|
239
|
-
{option.suboptions.map((suboption: any) => (
|
|
240
|
-
<ProductSubOption key={suboption.id}>
|
|
241
|
-
<OText size={10} color={theme.colors.textThird}>
|
|
242
|
-
{getFormattedSubOptionName({
|
|
243
|
-
quantity: suboption.quantity,
|
|
244
|
-
name: suboption.name,
|
|
245
|
-
position: (suboption.position !== 'whole') ? t(suboption.position.toUpperCase(), suboption.position) : '',
|
|
246
|
-
price: parsePrice(suboption.price)
|
|
247
|
-
})}
|
|
248
|
-
</OText>
|
|
249
|
-
</ProductSubOption>
|
|
250
|
-
))}
|
|
251
|
-
</ProductOption>
|
|
252
|
-
))}
|
|
253
|
-
</ProductOptionsList>
|
|
254
244
|
)}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
245
|
+
</Accordion>
|
|
246
|
+
|
|
247
|
+
<View style={{ display: isActive ? 'flex' : 'none', paddingStart: 40 }}>
|
|
248
|
+
<Animated.View>
|
|
249
|
+
<AccordionContent>
|
|
250
|
+
{productInfo().ingredients.length > 0 && productInfo().ingredients.some((ingredient: any) => !ingredient.selected) && (
|
|
251
|
+
<ProductOptionsList>
|
|
252
|
+
<OText size={10} color={theme.colors.textSecondary}>{t('INGREDIENTS', 'Ingredients')}</OText>
|
|
253
|
+
{productInfo().ingredients.map((ingredient: any) => !ingredient.selected && (
|
|
254
|
+
<OText size={10} color={theme.colors.textThird} key={ingredient.id} style={{ marginLeft: 10 }}>{t('NO', 'No')} {ingredient.name}</OText>
|
|
255
|
+
))}
|
|
256
|
+
</ProductOptionsList>
|
|
257
|
+
)}
|
|
258
|
+
{productInfo().options.length > 0 && (
|
|
259
|
+
<ProductOptionsList>
|
|
260
|
+
{productInfo().options.map((option: any, i: number) => (
|
|
261
|
+
<ProductOption key={option.id + i}>
|
|
262
|
+
<OText size={10} color={theme.colors.textSecondary}>{option.name}</OText>
|
|
263
|
+
{option.suboptions.map((suboption: any) => (
|
|
264
|
+
<ProductSubOption key={suboption.id}>
|
|
265
|
+
<OText size={10} color={theme.colors.textThird}>
|
|
266
|
+
{getFormattedSubOptionName({
|
|
267
|
+
quantity: suboption.quantity,
|
|
268
|
+
name: suboption.name,
|
|
269
|
+
position: (suboption.position !== 'whole') ? t(suboption.position.toUpperCase(), suboption.position) : '',
|
|
270
|
+
price: parsePrice(suboption.price)
|
|
271
|
+
})}
|
|
272
|
+
</OText>
|
|
273
|
+
</ProductSubOption>
|
|
274
|
+
))}
|
|
275
|
+
</ProductOption>
|
|
276
|
+
))}
|
|
277
|
+
</ProductOptionsList>
|
|
278
|
+
)}
|
|
279
|
+
{product.comment && (
|
|
280
|
+
<ProductComment>
|
|
281
|
+
<OText size={10} color={theme.colors.textSecondary}>{t('SPECIAL_COMMENT', 'Special Comment')}</OText>
|
|
282
|
+
<OText size={10} color={theme.colors.textThird}>{product.comment}</OText>
|
|
283
|
+
</ProductComment>
|
|
284
|
+
)}
|
|
285
|
+
</AccordionContent>
|
|
286
|
+
</Animated.View>
|
|
287
|
+
</View>
|
|
288
|
+
</AccordionSection>
|
|
289
|
+
<OModal
|
|
290
|
+
open={isServiceOpen}
|
|
291
|
+
onClose={() => setIsServiceOpen(false)}
|
|
292
|
+
entireModal
|
|
293
|
+
>
|
|
294
|
+
<ServiceForm
|
|
295
|
+
isCartProduct
|
|
296
|
+
isService
|
|
297
|
+
businessId={product?.business_id}
|
|
298
|
+
categoryId={product?.category_id}
|
|
299
|
+
productId={product?.id}
|
|
300
|
+
productCart={product}
|
|
301
|
+
onSave={() => setIsServiceOpen(false)}
|
|
302
|
+
onClose={() => setIsServiceOpen(false)}
|
|
303
|
+
professionalSelected={product?.calendar_event?.professional}
|
|
304
|
+
/>
|
|
305
|
+
</OModal>
|
|
306
|
+
</>
|
|
265
307
|
)
|
|
266
308
|
}
|
|
267
309
|
|
|
@@ -30,7 +30,7 @@ const ProductOptionUI = (props: any) => {
|
|
|
30
30
|
return (
|
|
31
31
|
<Container style={{ color: error ? 'orange' : theme.colors.white }}>
|
|
32
32
|
<WrapHeader>
|
|
33
|
-
<OText size={16} lineHeight={24} weight={'600'}>{option.name}</OText>
|
|
33
|
+
<OText size={16} lineHeight={24} weight={'600'} style={{ flex: 1 }}>{option.name}</OText>
|
|
34
34
|
<OText color={theme.colors.red}>{maxMin}</OText>
|
|
35
35
|
</WrapHeader>
|
|
36
36
|
{children}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { ScrollView, TouchableOpacity, View, StyleSheet, Platform } from 'react-native'
|
|
3
|
+
import { useUtils, useLanguage } from 'ordering-components/native'
|
|
4
|
+
import { useTheme } from 'styled-components/native'
|
|
5
|
+
import FastImage from 'react-native-fast-image'
|
|
6
|
+
import { OIcon, OText, OModal } from '../shared'
|
|
7
|
+
import { ProfessionalProfile } from '../ProfessionalProfile'
|
|
8
|
+
import { ProfessionalFilterParams } from '../../types'
|
|
9
|
+
|
|
10
|
+
export const ProfessionalFilter = (props: ProfessionalFilterParams) => {
|
|
11
|
+
const {
|
|
12
|
+
professionals,
|
|
13
|
+
professionalSelected,
|
|
14
|
+
handleChangeProfessionalSelected
|
|
15
|
+
} = props
|
|
16
|
+
|
|
17
|
+
const theme = useTheme()
|
|
18
|
+
const [{ optimizeImage }] = useUtils()
|
|
19
|
+
const [, t] = useLanguage()
|
|
20
|
+
const [open, setOpen] = useState(false)
|
|
21
|
+
const [currentProfessional, setCurrentProfessional] = useState(null)
|
|
22
|
+
|
|
23
|
+
const handleOpenProfile = (professional: any) => {
|
|
24
|
+
setCurrentProfessional(professional)
|
|
25
|
+
setOpen(true)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const handleCloseProfile = () => {
|
|
29
|
+
setCurrentProfessional(null)
|
|
30
|
+
setOpen(false)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const styles = StyleSheet.create({
|
|
34
|
+
professionalItem: {
|
|
35
|
+
flexDirection: 'row',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
borderRadius: 7.6,
|
|
38
|
+
padding: 11,
|
|
39
|
+
borderWidth: 1,
|
|
40
|
+
marginRight: 12,
|
|
41
|
+
minHeight: 64
|
|
42
|
+
},
|
|
43
|
+
photoStyle: {
|
|
44
|
+
width: 42,
|
|
45
|
+
height: 42,
|
|
46
|
+
borderRadius: 7.6
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<>
|
|
52
|
+
<ScrollView
|
|
53
|
+
horizontal
|
|
54
|
+
showsVerticalScrollIndicator={false}
|
|
55
|
+
showsHorizontalScrollIndicator={false}
|
|
56
|
+
>
|
|
57
|
+
<TouchableOpacity
|
|
58
|
+
onPress={() => handleChangeProfessionalSelected(null)}
|
|
59
|
+
>
|
|
60
|
+
<View
|
|
61
|
+
style={{
|
|
62
|
+
...styles.professionalItem,
|
|
63
|
+
borderColor: !professionalSelected
|
|
64
|
+
? theme.colors.primary
|
|
65
|
+
: theme.colors.border
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
<OText
|
|
69
|
+
size={12}
|
|
70
|
+
weight={'400'}
|
|
71
|
+
>
|
|
72
|
+
{t('ANY_PROFESSIONAL_MEMBER', 'Any professional member')}
|
|
73
|
+
</OText>
|
|
74
|
+
</View>
|
|
75
|
+
</TouchableOpacity>
|
|
76
|
+
{professionals.map((professional: any, i: number) => (
|
|
77
|
+
<TouchableOpacity
|
|
78
|
+
key={i}
|
|
79
|
+
onPress={() => handleOpenProfile(professional)}
|
|
80
|
+
>
|
|
81
|
+
<View
|
|
82
|
+
style={{
|
|
83
|
+
...styles.professionalItem,
|
|
84
|
+
borderColor: (professional?.id === professionalSelected?.id)
|
|
85
|
+
? theme.colors.primary
|
|
86
|
+
: theme.colors.border
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
{professional?.photo ? (
|
|
90
|
+
<FastImage
|
|
91
|
+
style={styles.photoStyle}
|
|
92
|
+
source={{
|
|
93
|
+
uri: optimizeImage(professional?.photo, 'h_250,c_limit'),
|
|
94
|
+
priority: FastImage.priority.normal,
|
|
95
|
+
}}
|
|
96
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
97
|
+
/>
|
|
98
|
+
) : (
|
|
99
|
+
<OIcon
|
|
100
|
+
src={theme?.images?.general?.user}
|
|
101
|
+
cover={false}
|
|
102
|
+
style={styles.photoStyle}
|
|
103
|
+
/>
|
|
104
|
+
)}
|
|
105
|
+
<OText
|
|
106
|
+
size={12}
|
|
107
|
+
style={{ marginLeft: 12 }}
|
|
108
|
+
weight={'400'}
|
|
109
|
+
>
|
|
110
|
+
{professional?.name} {professional?.lastname}
|
|
111
|
+
</OText>
|
|
112
|
+
</View>
|
|
113
|
+
</TouchableOpacity>
|
|
114
|
+
))}
|
|
115
|
+
</ScrollView>
|
|
116
|
+
<OModal
|
|
117
|
+
open={open}
|
|
118
|
+
onClose={() => handleCloseProfile()}
|
|
119
|
+
entireModal
|
|
120
|
+
>
|
|
121
|
+
<ProfessionalProfile
|
|
122
|
+
professional={currentProfessional}
|
|
123
|
+
onClose={() => handleCloseProfile()}
|
|
124
|
+
handleChangeProfessionalSelected={handleChangeProfessionalSelected}
|
|
125
|
+
/>
|
|
126
|
+
</OModal>
|
|
127
|
+
</>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
File without changes
|