ordering-ui-react-native 0.12.52 → 0.12.56

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.
Files changed (37) hide show
  1. package/package.json +1 -1
  2. package/src/components/Cart/index.tsx +50 -16
  3. package/src/components/OrderDetails/index.tsx +8 -0
  4. package/src/components/OrderSummary/index.tsx +38 -3
  5. package/src/layouts/Container.tsx +1 -1
  6. package/themes/business/src/components/GoogleMap/index.tsx +78 -4
  7. package/themes/business/src/components/OrderDetails/Business.tsx +11 -3
  8. package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +11 -9
  9. package/themes/business/src/layouts/Container.tsx +3 -1
  10. package/themes/doordash/src/components/Cart/index.tsx +36 -2
  11. package/themes/doordash/src/components/OrderDetails/index.tsx +8 -0
  12. package/themes/doordash/src/components/OrderSummary/index.tsx +36 -3
  13. package/themes/doordash/src/layouts/Container.tsx +1 -1
  14. package/themes/franchises/src/components/Cart/index.tsx +257 -223
  15. package/themes/franchises/src/components/OrderDetails/index.tsx +723 -715
  16. package/themes/franchises/src/components/OrderSummary/index.tsx +188 -154
  17. package/themes/franchises/src/layouts/Container.tsx +1 -1
  18. package/themes/instacart/src/components/Cart/index.tsx +37 -3
  19. package/themes/instacart/src/components/OrderDetails/index.tsx +8 -0
  20. package/themes/instacart/src/components/OrderSummary/index.tsx +37 -4
  21. package/themes/instacart/src/layouts/Container.tsx +1 -1
  22. package/themes/kiosk/src/layouts/Container.tsx +2 -1
  23. package/themes/original/src/components/Cart/index.tsx +268 -234
  24. package/themes/original/src/components/OrderDetails/index.tsx +723 -715
  25. package/themes/original/src/components/OrderSummary/index.tsx +37 -3
  26. package/themes/original/src/layouts/Container.tsx +1 -1
  27. package/themes/single-business/src/components/Cart/index.tsx +1 -1
  28. package/themes/single-business/src/components/PhoneInputNumber/index.tsx +103 -112
  29. package/themes/single-business/src/components/UserDetails/index.tsx +107 -111
  30. package/themes/single-business/src/components/UserDetails/styles.tsx +3 -8
  31. package/themes/single-business/src/components/UserFormDetails/index.tsx +279 -326
  32. package/themes/single-business/src/components/UserFormDetails/styles.tsx +7 -5
  33. package/themes/single-business/src/layouts/Container.tsx +1 -1
  34. package/themes/uber-eats/src/components/Cart/index.tsx +37 -3
  35. package/themes/uber-eats/src/components/OrderDetails/index.tsx +8 -0
  36. package/themes/uber-eats/src/components/OrderSummary/index.tsx +40 -6
  37. package/themes/uber-eats/src/layouts/Container.tsx +1 -1
@@ -16,14 +16,14 @@ import { ProductItemAccordion } from '../ProductItemAccordion';
16
16
  import { BusinessItemAccordion } from '../BusinessItemAccordion';
17
17
  import { CouponControl } from '../CouponControl';
18
18
 
19
- import { OButton, OModal, OText } from '../shared';
19
+ import { OButton, OInput, OModal, OText } from '../shared';
20
20
  import { ProductForm } from '../ProductForm';
21
21
  import { UpsellingProducts } from '../UpsellingProducts';
22
22
  import { verifyDecimals } from '../../utils';
23
23
  import { useTheme } from 'styled-components/native';
24
24
  import AntIcon from 'react-native-vector-icons/AntDesign'
25
25
  import { TaxInformation } from '../TaxInformation';
26
- import { TouchableOpacity } from 'react-native';
26
+ import { ActivityIndicator, TouchableOpacity, View } from 'react-native';
27
27
 
28
28
  const CartUI = (props: any) => {
29
29
  const {
@@ -36,7 +36,9 @@ const CartUI = (props: any) => {
36
36
  handleCartOpen,
37
37
  setIsCartsLoading,
38
38
  isForceOpenCart,
39
- isBusinessCart
39
+ isBusinessCart,
40
+ handleChangeComment,
41
+ commentState
40
42
  } = props
41
43
 
42
44
  const theme = useTheme()
@@ -235,6 +237,38 @@ const CartUI = (props: any) => {
235
237
  </OText>
236
238
  </OSTable>
237
239
  </OSTotal>
240
+ {cart?.status !== 2 && (
241
+ <OSTable>
242
+ <View style={{ width: '100%', marginTop: 20 }}>
243
+ <OText>{t('COMMENTS', 'Comments')}</OText>
244
+ <View style={{ flex: 1, width: '100%' }}>
245
+ <OInput
246
+ value={cart?.comment}
247
+ placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
248
+ onChange={(value: string) => handleChangeComment(value)}
249
+ style={{
250
+ alignItems: 'flex-start',
251
+ width: '100%',
252
+ height: 100,
253
+ borderColor: theme.colors.textSecondary,
254
+ paddingRight: 50,
255
+ marginTop: 10
256
+ }}
257
+ multiline
258
+ />
259
+ {commentState?.loading && (
260
+ <View style={{ position: 'absolute', right: 20 }}>
261
+ <ActivityIndicator
262
+ size='large'
263
+ style={{ height: 100 }}
264
+ color={theme.colors.primary}
265
+ />
266
+ </View>
267
+ )}
268
+ </View>
269
+ </View>
270
+ </OSTable>
271
+ )}
238
272
  </OSBill>
239
273
  )}
240
274
  </CartContent>
@@ -410,6 +410,14 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
410
410
  <OText style={styles.textBold} color={theme.colors.primary}>{parsePrice(order?.summary?.total || order?.total)}</OText>
411
411
  </Table>
412
412
  </Total>
413
+ {order?.comment && (
414
+ <Table>
415
+ <OText style={{ flex: 1 }}>{t('COMMENT', 'Comment')}</OText>
416
+ <OText style={{ maxWidth: '70%' }}>
417
+ {order?.comment}
418
+ </OText>
419
+ </Table>
420
+ )}
413
421
  </OrderBill>
414
422
  <OrderCustomer>
415
423
  <OText size={18} mBottom={5} style={{ textAlign: 'left' }}>{t('CUSTOMER', 'Customer')}</OText>
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react';
2
- import { TouchableOpacity, View } from 'react-native'
2
+ import { ActivityIndicator, TouchableOpacity, View } from 'react-native'
3
3
  import {
4
4
  Cart,
5
5
  useOrder,
@@ -19,7 +19,7 @@ import {
19
19
 
20
20
  import { ProductItemAccordion } from '../ProductItemAccordion';
21
21
  import { CouponControl } from '../CouponControl';
22
- import { OModal, OText } from '../shared';
22
+ import { OInput, OModal, OText } from '../shared';
23
23
  import { ProductForm } from '../ProductForm';
24
24
  import { verifyDecimals } from '../../utils';
25
25
  import { useTheme } from 'styled-components/native';
@@ -34,7 +34,9 @@ const OrderSummaryUI = (props: any) => {
34
34
  offsetDisabled,
35
35
  removeProduct,
36
36
  isCartPending,
37
- isFromCheckout
37
+ isFromCheckout,
38
+ handleChangeComment,
39
+ commentState
38
40
  } = props;
39
41
 
40
42
  const theme = useTheme();
@@ -158,9 +160,9 @@ const OrderSummaryUI = (props: any) => {
158
160
  {cart?.driver_tip_rate > 0 &&
159
161
  parseInt(configs?.driver_tip_type?.value, 10) === 2 &&
160
162
  !parseInt(configs?.driver_tip_use_custom?.value, 10) &&
161
- (
162
- `(${verifyDecimals(cart?.driver_tip_rate, parseNumber)}%)`
163
- )}
163
+ (
164
+ `(${verifyDecimals(cart?.driver_tip_rate, parseNumber)}%)`
165
+ )}
164
166
  </OText>
165
167
  <OText size={16}>{parsePrice(cart?.driver_tip)}</OText>
166
168
  </OSTable>
@@ -187,6 +189,38 @@ const OrderSummaryUI = (props: any) => {
187
189
  </OSTable>
188
190
  </View>
189
191
  )}
192
+ {cart?.status !== 2 && (
193
+ <OSTable>
194
+ <View style={{ width: '100%', marginTop: 20 }}>
195
+ <OText>{t('COMMENTS', 'Comments')}</OText>
196
+ <View style={{ flex: 1, width: '100%' }}>
197
+ <OInput
198
+ value={cart?.comment}
199
+ placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
200
+ onChange={(value: string) => handleChangeComment(value)}
201
+ style={{
202
+ alignItems: 'flex-start',
203
+ width: '100%',
204
+ height: 100,
205
+ borderColor: theme.colors.textSecondary,
206
+ paddingRight: 50,
207
+ marginTop: 10
208
+ }}
209
+ multiline
210
+ />
211
+ {commentState?.loading && (
212
+ <View style={{ position: 'absolute', right: 20 }}>
213
+ <ActivityIndicator
214
+ size='large'
215
+ style={{ height: 100 }}
216
+ color={theme.colors.primary}
217
+ />
218
+ </View>
219
+ )}
220
+ </View>
221
+ </View>
222
+ </OSTable>
223
+ )}
190
224
  </OSBill>
191
225
  )}
192
226
  <OModal
@@ -18,7 +18,7 @@ const ContentView = styled.View`
18
18
  export const Container = (props: any) => {
19
19
  return (
20
20
  <SafeAreaStyled>
21
- <ContainerStyled keyboardShouldPersistTaps='handled'>
21
+ <ContainerStyled ref={props?.forwardRef} keyboardShouldPersistTaps='handled'>
22
22
  <ContentView>
23
23
  {props.children}
24
24
  </ContentView>