ordering-ui-react-native 0.22.78 → 0.22.80

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.22.78",
3
+ "version": "0.22.80",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -102,7 +102,6 @@
102
102
  "react-native-phone-number-input": "^2.0.0",
103
103
  "react-native-picker-select": "^8.0.4",
104
104
  "react-native-print": "^0.9.0",
105
- "react-native-reanimated": "^1.13.1",
106
105
  "react-native-recaptcha-that-works": "^1.2.0",
107
106
  "react-native-restart": "^0.0.22",
108
107
  "react-native-safe-area-context": "^3.1.8",
@@ -428,13 +428,19 @@ export const AcceptOrRejectOrder = (props: AcceptOrRejectOrderParams) => {
428
428
  {action === 'accept' && (
429
429
  <View style={{ height: 300, justifyContent: 'center' }}>
430
430
  <Timer onPress={() => openTimerIOnput()}>
431
- <OText weight="600" style={{ textAlign: 'center' }} size={55}>
432
- {hour}
433
- </OText>
434
- {hour.length > 0 && <OText size={55}>:</OText>}
435
- <OText weight="600" style={{ textAlign: 'center' }} size={55}>
436
- {min}
437
- </OText>
431
+ <View>
432
+ <OText weight="600" size={55}>
433
+ {hour}
434
+ </OText>
435
+ <OText style={{ marginLeft: 10 }}>{t('HOURS', 'Hours')}</OText>
436
+ </View>
437
+ {hour.length > 0 && <OText size={55} style={{ marginBottom: 30 }}>:</OText>}
438
+ <View>
439
+ <OText weight="600" size={55}>
440
+ {min}
441
+ </OText>
442
+ <OText style={{ marginLeft: 10 }}>{t('MINUTES', 'Minutes')}</OText>
443
+ </View>
438
444
  </Timer>
439
445
  </View>
440
446
  )}
@@ -53,6 +53,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
53
53
  actions,
54
54
  orderTitle,
55
55
  appTitle,
56
+ loadMessages
56
57
  } = props;
57
58
 
58
59
  const theme = useTheme();
@@ -77,7 +78,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
77
78
  const [printerSettings, setPrinterSettings] = useState<any>('')
78
79
  const [autoPrintEnabled, setAutoPrintEnabled] = useState<boolean>(false)
79
80
 
80
- const orderToComplete = [4,20,21]
81
+ const orderToComplete = [4, 7, 14, 20, 21]
81
82
 
82
83
  if (order?.status === 7 || order?.status === 4) {
83
84
  if (drivers?.length > 0 && drivers) {
@@ -297,7 +298,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
297
298
 
298
299
  const handleOpenMessagesForBusiness = () => {
299
300
  setOpenModalForBusiness(true);
300
- readMessages && readMessages();
301
+ readMessages && readMessages()
302
+ loadMessages && loadMessages()
301
303
  setUnreadAlert({ ...unreadAlert, business: false });
302
304
  };
303
305
 
@@ -379,7 +381,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
379
381
  },
380
382
  {
381
383
  ...order?.customer?.location,
382
- title: order?.customer?.name ?? t('CUSTOMER', 'Customer'),
384
+ title: order?.customer?.name ?? t('CUSTOMER', 'Customer'),
383
385
  address: {
384
386
  addressName: order?.customer?.address,
385
387
  zipcode: order?.customer?.zipcode
@@ -413,7 +415,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
413
415
 
414
416
  useEffect(() => {
415
417
  const getStorageData = async () => {
416
- const printers = await _retrieveStoreData('printers')
418
+ const printers = await _retrieveStoreData('printers')
417
419
  const autoPrint = await _retrieveStoreData('auto_print_after_accept_order')
418
420
  setPrinterSettings(printers?.length && printers)
419
421
  setAutoPrintEnabled(!!autoPrint)
@@ -482,6 +484,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
482
484
  handleCopyClipboard={handleCopyClipboard}
483
485
  handleArrowBack={handleArrowBack}
484
486
  isCustomView={props.isCustomView}
487
+ messages={messages}
485
488
  />
486
489
  <OrderDetailsContainer
487
490
  keyboardShouldPersistTaps="handled"
@@ -668,7 +671,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
668
671
  secondButtonClick={() => handleChangeOrderStatus?.(15)}
669
672
  firstButtonClick={() => handleChangeOrderStatus?.(17)}
670
673
  secondBtnText={t(
671
- 'PICKUP_COMPLETED_BY_CUSTOMER',
674
+ 'ORDER_PICKUP_COMPLETED_BY_CUSTOMER',
672
675
  'Pickup completed by customer',
673
676
  )}
674
677
  secondButton={true}
@@ -13,6 +13,7 @@ import {
13
13
  OrderBill,
14
14
  Total,
15
15
  OSRow,
16
+ OrderVehicle,
16
17
  } from './styles';
17
18
 
18
19
  import { ProductItemAccordion } from '../ProductItemAccordion';
@@ -449,7 +450,7 @@ export const OrderContentComponent = (props: OrderContent) => {
449
450
  ))}
450
451
  </OrderProducts>
451
452
 
452
- <OrderBill>
453
+ <OrderBill vehicleExists={!!order?.vehicle}>
453
454
  <Table>
454
455
  <OText mBottom={4}>{t('SUBTOTAL', 'Subtotal')}</OText>
455
456
  <OText mBottom={4}>
@@ -659,7 +660,51 @@ export const OrderContentComponent = (props: OrderContent) => {
659
660
  </View>
660
661
  </View>
661
662
  )}
663
+
662
664
  </OrderBill >
665
+ {!!order?.vehicle && (
666
+ <OrderVehicle>
667
+ <OText
668
+ style={{ marginBottom: 5 }}
669
+ size={16}
670
+ weight="600"
671
+ color={theme.colors.textGray}>
672
+ {t('VEHICLE', 'Vehicle')}
673
+ </OText>
674
+ <Table>
675
+ <OText style={{ marginBottom: 5 }}>
676
+ {t('CAR_REGISTRATION', 'Car registration')}
677
+ </OText>
678
+ <OText style={{ marginBottom: 5 }}>
679
+ {order?.vehicle?.car_registration}
680
+ </OText>
681
+ </Table>
682
+ <Table>
683
+ <OText style={{ marginBottom: 5 }}>
684
+ {t('COLOR', 'Color')}
685
+ </OText>
686
+ <OText style={{ marginBottom: 5 }}>
687
+ {order?.vehicle?.color}
688
+ </OText>
689
+ </Table>
690
+ <Table>
691
+ <OText style={{ marginBottom: 5 }}>
692
+ {t('MODEL', 'Model')}
693
+ </OText>
694
+ <OText style={{ marginBottom: 5 }}>
695
+ {order?.vehicle?.model}
696
+ </OText>
697
+ </Table>
698
+ <Table>
699
+ <OText style={{ marginBottom: 5 }}>
700
+ {t('TYPE', 'Type')}
701
+ </OText>
702
+ <OText style={{ marginBottom: 5 }}>
703
+ {order?.vehicle?.type}
704
+ </OText>
705
+ </Table>
706
+ </OrderVehicle>
707
+ )}
663
708
  <OModal
664
709
  open={openReviewModal}
665
710
  onClose={() => setOpenReviewModal(false)}
@@ -3,7 +3,9 @@ import React from 'react';
3
3
  //Styles
4
4
  import {
5
5
  Actions,
6
+ Dot,
6
7
  Header,
8
+ Messages,
7
9
  OrderHeader,
8
10
  } from './styles';
9
11
 
@@ -35,6 +37,7 @@ interface OrderHeader {
35
37
  handleViewSummaryOrder?: any;
36
38
  handleCopyClipboard?: any
37
39
  isCustomView?: any
40
+ messages?: any
38
41
  }
39
42
 
40
43
  export const OrderHeaderComponent = (props: OrderHeader) => {
@@ -46,7 +49,8 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
46
49
  getOrderStatus,
47
50
  logisticOrderStatus,
48
51
  handleViewSummaryOrder,
49
- handleCopyClipboard
52
+ handleCopyClipboard,
53
+ messages,
50
54
  } = props
51
55
  const theme = useTheme();
52
56
  const [, t] = useLanguage();
@@ -191,18 +195,20 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
191
195
  style={styles.icons}
192
196
  onClick={() => handleOpenMapView()}
193
197
  />
194
-
195
- <OIconButton
196
- icon={theme.images.general.messages}
197
- iconStyle={{
198
- width: 20,
199
- height: 20,
200
- tintColor: theme.colors.textGray,
201
- }}
202
- borderColor={theme.colors.clear}
203
- style={styles.icons}
204
- onClick={() => handleOpenMessagesForBusiness()}
205
- />
198
+ <Messages>
199
+ {messages?.messages?.filter((message: any) => !message?.read)?.length > 0 && <Dot />}
200
+ <OIconButton
201
+ icon={theme.images.general.messages}
202
+ iconStyle={{
203
+ width: 20,
204
+ height: 20,
205
+ tintColor: theme.colors.textGray,
206
+ }}
207
+ borderColor={theme.colors.clear}
208
+ style={styles.icons}
209
+ onClick={() => handleOpenMessagesForBusiness()}
210
+ />
211
+ </Messages>
206
212
  </Actions>
207
213
  )}
208
214
  </Header>
@@ -254,7 +260,6 @@ export const OrderHeaderComponent = (props: OrderHeader) => {
254
260
  style={styles.icons}
255
261
  onClick={() => handleOpenMapView()}
256
262
  />
257
-
258
263
  <OIconButton
259
264
  icon={theme.images.general.messages}
260
265
  iconStyle={{
@@ -25,13 +25,13 @@ export const Logo = styled.View`
25
25
 
26
26
  export const OrderContent = styled.View`
27
27
  flex: 1;
28
- ${(props : any) => props.isOrderGroup && css`
28
+ ${(props: any) => props.isOrderGroup && css`
29
29
  border-color: rgba(0, 0, 0, 0.2);
30
30
  border-width: 1px;
31
31
  padding: 10px;
32
32
  `
33
33
  }
34
- ${(props : any) => props.lastOrder && css`
34
+ ${(props: any) => props.lastOrder && css`
35
35
  margin-bottom: 50px;
36
36
  `}
37
37
  `;
@@ -68,7 +68,18 @@ export const Table = styled.View`
68
68
 
69
69
  export const OrderBill = styled.View`
70
70
  padding-vertical: 20px;
71
- padding-bottom: 30px;
71
+ ${(props: any) => !props.vehicleExists && css`
72
+ padding-bottom: 50px;
73
+ `
74
+ }
75
+ flex: 1;
76
+ `;
77
+
78
+ export const OrderVehicle = styled.View`
79
+ border-top-width: 1px;
80
+ border-top-color: ${(props: any) => props.theme.colors.borderTops};
81
+ padding-vertical: 20px;
82
+ padding-bottom: 50px;
72
83
  flex: 1;
73
84
  `;
74
85
 
@@ -98,3 +109,18 @@ export const OSRow = styled.View`
98
109
  width: 70%;
99
110
  flex-wrap: wrap;
100
111
  `
112
+
113
+ export const Messages = styled.View`
114
+ position: relative;
115
+ `;
116
+
117
+ export const Dot = styled.View`
118
+ position: absolute;
119
+ width: 8px;
120
+ height: 8px;
121
+ border-radius: 4px;
122
+ background-color: ${(props: any) => props.theme.colors.red};
123
+ top: 10;
124
+ right: 10;
125
+ z-index: 99;
126
+ `;
@@ -415,6 +415,7 @@ export interface OrderDetailsParams {
415
415
  orderTitle?: any;
416
416
  forceUpdate?: number;
417
417
  getPermissions?: any
418
+ loadMessages?: any
418
419
  }
419
420
  export interface ProductItemAccordionParams {
420
421
  isCartPending?: boolean;