ordering-ui-react-native 0.12.11 → 0.12.12

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.12.11",
3
+ "version": "0.12.12",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -73,8 +73,8 @@ const AccountUI = (props: AccountParams) => {
73
73
  console.log('ImagePicker Error: ', response.errorMessage);
74
74
  showToast(ToastType.Error, response.errorMessage);
75
75
  } else {
76
- if (response.uri) {
77
- const url = `data:${response.type};base64,${response.base64}`
76
+ if (response?.assets) {
77
+ const url = `data:${response.assets[0].type};base64,${response.assets[0].base64}`
78
78
  handleButtonUpdateClick(null, true, url);
79
79
  } else {
80
80
  showToast(ToastType.Error, t('IMAGE_NOT_FOUND', 'Image not found'));
package/src/config.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "app_id": "react-native-app",
3
3
  "notification_app": "orderingapp",
4
4
  "app_name": "Ordering",
5
- "project": "reactdemo",
5
+ "project": "jorgev4",
6
6
  "api": {
7
- "url": "https://apiv4.ordering.co",
7
+ "url": "https://apiv4-staging.ordering.co",
8
8
  "language": "en",
9
9
  "version": "v400"
10
10
  },
@@ -75,12 +75,12 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
75
75
  const showFloatButtonsPickUp: any = {
76
76
  8: true,
77
77
  3: true,
78
- 4: true,
79
78
  18: true
80
79
  };
81
80
 
82
81
  const showFloatButtonsAcceptOrReject: any = {
83
82
  0: true,
83
+ 4: true,
84
84
  7: true,
85
85
  };
86
86
 
@@ -382,7 +382,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
382
382
  {showFloatButtonsPickUp[order?.status] && (
383
383
  <FloatingButton
384
384
  disabled={loading}
385
- btnText={t('FAILED', 'Failed')}
385
+ btnText={t('PICKUP_FAILED', 'Pickup failed')}
386
386
  isSecondaryBtn={false}
387
387
  secondButtonClick={() =>
388
388
  handleChangeOrderStatus && handleChangeOrderStatus(9)
@@ -401,7 +401,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
401
401
  <>
402
402
  <FloatingButton
403
403
  disabled={loading}
404
- btnText={t('FAILED', 'Failed')}
404
+ btnText={t('DELIVERY_FAILED', 'Delivery Failed')}
405
405
  isSecondaryBtn={false}
406
406
  secondButtonClick={() =>
407
407
  handleChangeOrderStatus && handleChangeOrderStatus(11)
@@ -41,10 +41,11 @@ const tabsList: any = {
41
41
  };
42
42
 
43
43
  const tabsListText: any = {
44
- 1: 'pending',
45
- 2: 'inProgress',
46
- 3: 'completed',
47
- 4: 'cancelled'
44
+ 1: 'logistic_pending',
45
+ 2: 'pending',
46
+ 3: 'inProgress',
47
+ 4: 'completed',
48
+ 5: 'cancelled'
48
49
  };
49
50
 
50
51
  const swipeConfig = {
@@ -86,7 +87,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
86
87
  type: ''
87
88
  }
88
89
  }
89
-
90
+ console.log('ORDERS', ordersGroup)
90
91
  const theme = useTheme();
91
92
  const [, t] = useLanguage();
92
93
  const [{ parseDate }] = useUtils()
@@ -167,7 +168,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
167
168
 
168
169
  const [tagsState, setTags] = useState<any>({ values: [] })
169
170
 
170
- const tagsList = ordersGroup[currentTabSelected].defaultFilter ?? []
171
+ const tagsList = ordersGroup[currentTabSelected]?.defaultFilter ?? []
171
172
  const currentOrdersGroup = ordersGroup[currentTabSelected]
172
173
 
173
174
  const isEqual = (array1: any, array2: any) => {
@@ -441,8 +442,8 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
441
442
  />
442
443
  }
443
444
  >
444
- {!currentOrdersGroup.error?.length &&
445
- currentOrdersGroup.orders?.length > 0 &&
445
+ {!currentOrdersGroup?.error?.length &&
446
+ currentOrdersGroup?.orders?.length > 0 &&
446
447
  (
447
448
  <PreviousOrders
448
449
  orders={currentOrdersGroup.orders}
@@ -452,8 +453,8 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
452
453
  />
453
454
  )}
454
455
 
455
- {(currentOrdersGroup.loading ||
456
- currentOrdersGroup.pagination.total === null) &&
456
+ {(currentOrdersGroup?.loading ||
457
+ currentOrdersGroup?.pagination?.total === null) &&
457
458
  (
458
459
  <>
459
460
  <View>
@@ -486,11 +487,11 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
486
487
  </>
487
488
  )}
488
489
 
489
- {!currentOrdersGroup.error?.length &&
490
- !currentOrdersGroup.loading &&
491
- currentOrdersGroup.pagination.totalPages &&
492
- currentOrdersGroup.pagination.currentPage < currentOrdersGroup.pagination.totalPages &&
493
- currentOrdersGroup.orders.length > 0 &&
490
+ {!currentOrdersGroup?.error?.length &&
491
+ !currentOrdersGroup?.loading &&
492
+ currentOrdersGroup?.pagination?.totalPages &&
493
+ currentOrdersGroup?.pagination?.currentPage < currentOrdersGroup?.pagination?.totalPages &&
494
+ currentOrdersGroup?.orders?.length > 0 &&
494
495
  (
495
496
  <OButton
496
497
  onClick={handleLoadMore}
@@ -503,13 +504,13 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
503
504
  />
504
505
  )}
505
506
 
506
- {!currentOrdersGroup.loading &&
507
- (currentOrdersGroup.error?.length ||
508
- currentOrdersGroup.orders?.length === 0) &&
507
+ {!currentOrdersGroup?.loading &&
508
+ (currentOrdersGroup?.error?.length ||
509
+ currentOrdersGroup?.orders?.length === 0) &&
509
510
  (
510
511
  <NotFoundSource
511
512
  content={
512
- !currentOrdersGroup.error?.length
513
+ !currentOrdersGroup?.error?.length
513
514
  ? t('NO_RESULTS_FOUND', 'Sorry, no results found')
514
515
  : currentOrdersGroup?.error[0]?.message ||
515
516
  currentOrdersGroup?.error[0] ||
@@ -686,24 +687,30 @@ export const OrdersOption = (props: OrdersOptionParams) => {
686
687
  tabs: [
687
688
  {
688
689
  key: 0,
690
+ text: t('Logistics', 'Logistics'),
691
+ tags: [0],
692
+ title: 'Logistics'
693
+ },
694
+ {
695
+ key: 1,
689
696
  text: t('PENDING', 'Pending'),
690
- tags: props?.orderGroupStatusCustom?.inProgress ?? [0, 13],
697
+ tags: props?.orderGroupStatusCustom?.pending ?? [0, 13],
691
698
  title: 'pending'
692
699
  },
693
700
  {
694
- key: 1,
701
+ key: 2,
695
702
  text: t('IN_PROGRESS', 'In Progress'),
696
703
  tags: props?.orderGroupStatusCustom?.inProgress ?? [3, 4, 7, 8, 9, 14, 18, 19, 20, 21],
697
704
  title: 'inProgress',
698
705
  },
699
706
  {
700
- key: 2,
707
+ key: 3,
701
708
  text: t('COMPLETED', 'Completed'),
702
709
  tags: props?.orderGroupStatusCustom?.completed ?? [1, 11, 15],
703
710
  title: 'completed',
704
711
  },
705
712
  {
706
- key: 3,
713
+ key: 4,
707
714
  text: t('CANCELLED', 'Cancelled'),
708
715
  tags: props?.orderGroupStatusCustom?.cancelled ?? [2, 5, 6, 10, 12, 16, 17],
709
716
  title: 'cancelled',