ordering-ui-react-native 0.22.81 → 0.22.83

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.81",
3
+ "version": "0.22.83",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -96,7 +96,9 @@ const ChatUI = (props: MessagesParams) => {
96
96
  20: t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Order customer almost arrived to business'),
97
97
  21: t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Order customer arrived to business'),
98
98
  22: t('ORDER_LOOKING_FOR_DRIVER', 'Order looking for driver'),
99
- 23: t('ORDER_DRIVER_ON_WAY', 'Driver on way')
99
+ 23: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
100
+ 24: t('ORDER_DRIVER_WAITING_FOR_ORDER', 'Driver waiting for order'),
101
+ 25: t('ORDER_ACCEPTED_BY_DRIVER_COMPANY', 'Accepted by driver company')
100
102
  }
101
103
 
102
104
  const getLogisticTag = (status: any) => {
@@ -846,6 +846,14 @@ export const OrdersListManager = (props: OrdersOptionParams) => {
846
846
  {
847
847
  key: 23,
848
848
  text: t('ORDER_DRIVER_ON_WAY', 'Driver on way')
849
+ },
850
+ {
851
+ key: 24,
852
+ text: t('ORDER_DRIVER_WAITING_FOR_ORDER', 'Driver waiting for order')
853
+ },
854
+ {
855
+ key: 25,
856
+ text: t('ORDER_ACCEPTED_BY_DRIVER_COMPANY', 'Accepted by driver company')
849
857
  }
850
858
  ],
851
859
  tabs: [
@@ -858,7 +866,7 @@ export const OrdersListManager = (props: OrdersOptionParams) => {
858
866
  {
859
867
  key: 1,
860
868
  text: t('IN_PROGRESS', 'In Progress'),
861
- tags: props?.orderGroupStatusCustom?.inProgress ?? [3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23],
869
+ tags: props?.orderGroupStatusCustom?.inProgress ?? [3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23, 24, 25],
862
870
  title: 'inProgress',
863
871
  },
864
872
  {
@@ -393,12 +393,12 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
393
393
  setTags({ values: [] })
394
394
  }, [currentTabSelected])
395
395
 
396
- useEffect(() => {
397
- const unsubcribe = navigation.addListener('focus', () => {
396
+ useEffect(() => {
397
+ const unsubcribe = navigation.addListener('focus', () => {
398
398
  currentTabSelected === 'logisticOrders' && loadLogisticOrders && loadLogisticOrders()
399
- })
400
- return unsubcribe
401
- }, [navigation, loadLogisticOrders])
399
+ })
400
+ return unsubcribe
401
+ }, [navigation, loadLogisticOrders])
402
402
 
403
403
  useEffect(() => {
404
404
  const orderStatuses = ['active', 'pending', 'inProgress', 'completed', 'cancelled']
@@ -675,34 +675,34 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
675
675
  !currentOrdersGroup?.orders?.length
676
676
  ) || internetLoading
677
677
  ) && (
678
- <View>
679
- {[...Array(5)].map((_, i) => (
680
- <Placeholder key={i} Animation={Fade}>
681
- <View
682
- style={{
683
- width: '100%',
684
- flexDirection: 'row',
685
- marginBottom: 10,
686
- }}>
687
- <PlaceholderLine
688
- width={IS_PORTRAIT ? 22 : 11}
689
- height={74}
678
+ <View>
679
+ {[...Array(5)].map((_, i) => (
680
+ <Placeholder key={i} Animation={Fade}>
681
+ <View
690
682
  style={{
691
- marginRight: 20,
692
- marginBottom: 20,
693
- borderRadius: 7.6,
694
- }}
695
- />
696
- <Placeholder>
697
- <PlaceholderLine width={30} style={{ marginTop: 5 }} />
698
- <PlaceholderLine width={50} />
699
- <PlaceholderLine width={20} />
700
- </Placeholder>
701
- </View>
702
- </Placeholder>
703
- ))}
704
- </View>
705
- )}
683
+ width: '100%',
684
+ flexDirection: 'row',
685
+ marginBottom: 10,
686
+ }}>
687
+ <PlaceholderLine
688
+ width={IS_PORTRAIT ? 22 : 11}
689
+ height={74}
690
+ style={{
691
+ marginRight: 20,
692
+ marginBottom: 20,
693
+ borderRadius: 7.6,
694
+ }}
695
+ />
696
+ <Placeholder>
697
+ <PlaceholderLine width={30} style={{ marginTop: 5 }} />
698
+ <PlaceholderLine width={50} />
699
+ <PlaceholderLine width={20} />
700
+ </Placeholder>
701
+ </View>
702
+ </Placeholder>
703
+ ))}
704
+ </View>
705
+ )}
706
706
 
707
707
  {isNetConnected &&
708
708
  !currentOrdersGroup?.error?.length &&
@@ -724,22 +724,22 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
724
724
 
725
725
  {!internetLoading &&
726
726
  ((!currentOrdersGroup?.loading &&
727
- (currentOrdersGroup?.error?.length ||
728
- currentOrdersGroup?.orders?.length === 0)) ||
729
- (currentTabSelected === 'logisticOrders' &&
730
- (logisticOrders?.error?.length > 0 || logisticOrders?.orders?.length === 0 || !logisticOrders?.orders?.some(order => !order?.expired)))
731
- ) &&
727
+ (currentOrdersGroup?.error?.length ||
728
+ currentOrdersGroup?.orders?.length === 0)) ||
729
+ (currentTabSelected === 'logisticOrders' &&
730
+ (logisticOrders?.error?.length > 0 || logisticOrders?.orders?.length === 0 || !logisticOrders?.orders?.some(order => !order?.expired)))
731
+ ) &&
732
732
  (
733
733
  <NotFoundSource
734
734
  content={
735
735
  !isNetConnected ? t('NETWORK_ERROR', 'Network Error') :
736
- ((currentTabSelected !== 'logisticOrders' && !currentOrdersGroup?.error?.length) ||
737
- (currentTabSelected === 'logisticOrders' && (!logisticOrders?.error?.length || (logisticOrders?.orders?.length > 0 && !logisticOrders?.orders?.some(order => !order?.expired)))))
738
- ? t('NO_RESULTS_FOUND', 'Sorry, no results found')
739
- : currentOrdersGroup?.error?.[0]?.message ||
740
- currentOrdersGroup?.error?.[0] ||
741
- (currentTabSelected === 'logisticOrders' && logisticOrders?.error) ||
742
- t('NETWORK_ERROR', 'Network Error')
736
+ ((currentTabSelected !== 'logisticOrders' && !currentOrdersGroup?.error?.length) ||
737
+ (currentTabSelected === 'logisticOrders' && (!logisticOrders?.error?.length || (logisticOrders?.orders?.length > 0 && !logisticOrders?.orders?.some(order => !order?.expired)))))
738
+ ? t('NO_RESULTS_FOUND', 'Sorry, no results found')
739
+ : currentOrdersGroup?.error?.[0]?.message ||
740
+ currentOrdersGroup?.error?.[0] ||
741
+ (currentTabSelected === 'logisticOrders' && logisticOrders?.error) ||
742
+ t('NETWORK_ERROR', 'Network Error')
743
743
  }
744
744
  image={theme.images.general.notFound}
745
745
  conditioned={false}
@@ -1117,13 +1117,21 @@ export const OrdersOption = (props: OrdersOptionParams) => {
1117
1117
  {
1118
1118
  key: 23,
1119
1119
  text: t('ORDER_DRIVER_ON_WAY', 'Driver on way')
1120
+ },
1121
+ {
1122
+ key: 24,
1123
+ text: t('ORDER_DRIVER_WAITING_FOR_ORDER', 'Driver waiting for order')
1124
+ },
1125
+ {
1126
+ key: 25,
1127
+ text: t('ORDER_ACCEPTED_BY_DRIVER_COMPANY', 'Accepted by driver company')
1120
1128
  }
1121
1129
  ],
1122
1130
  tabs: combineTabs ? [
1123
1131
  {
1124
1132
  key: 0,
1125
1133
  text: t('ACTIVE', 'Active'),
1126
- tags: props?.orderGroupStatusCustom?.active ?? [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23],
1134
+ tags: props?.orderGroupStatusCustom?.active ?? [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23, 24, 25],
1127
1135
  title: 'active',
1128
1136
  },
1129
1137
  {
@@ -1149,7 +1157,7 @@ export const OrdersOption = (props: OrdersOptionParams) => {
1149
1157
  {
1150
1158
  key: 1,
1151
1159
  text: t('IN_PROGRESS', 'In Progress'),
1152
- tags: props?.orderGroupStatusCustom?.inProgress ?? [3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23],
1160
+ tags: props?.orderGroupStatusCustom?.inProgress ?? [3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23, 24, 25],
1153
1161
  title: 'inProgress',
1154
1162
  },
1155
1163
  {
@@ -201,6 +201,18 @@ export const PreviousMessages = (props: PreviousMessagesParams) => {
201
201
  value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
202
202
  slug: 'ORDER_DRIVER_ON_WAY',
203
203
  percentage: 45
204
+ },
205
+ {
206
+ key: 24,
207
+ value: t('ORDER_DRIVER_WAITING_FOR_ORDER', 'Driver waiting for order'),
208
+ slug: 'ORDER_DRIVER_WAITING_FOR_ORDER',
209
+ percentage: 25
210
+ },
211
+ {
212
+ key: 25,
213
+ value: t('ORDER_ACCEPTED_BY_DRIVER_COMPANY', 'Accepted by driver company'),
214
+ slug: 'ORDER_ACCEPTED_BY_DRIVER_COMPANY',
215
+ percentage: 25
204
216
  }
205
217
  ];
206
218
 
@@ -344,6 +344,18 @@ export const getOrderStatus = (s: string, t: any) => {
344
344
  value: t('ORDER_DRIVER_ON_WAY', 'Driver on way'),
345
345
  slug: 'ORDER_DRIVER_ON_WAY',
346
346
  percentage: 45
347
+ },
348
+ {
349
+ key: 24,
350
+ value: t('ORDER_DRIVER_WAITING_FOR_ORDER', 'Driver waiting for order'),
351
+ slug: 'ORDER_DRIVER_WAITING_FOR_ORDER',
352
+ percentage: 25
353
+ },
354
+ {
355
+ key: 25,
356
+ value: t('ORDER_ACCEPTED_BY_DRIVER_COMPANY', 'Accepted by driver company'),
357
+ slug: 'ORDER_ACCEPTED_BY_DRIVER_COMPANY',
358
+ percentage: 25
347
359
  }
348
360
  ];
349
361