ordering-ui-react-native 0.20.6-release → 0.20.8-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-react-native",
3
- "version": "0.20.6-release",
3
+ "version": "0.20.8-release",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -64,6 +64,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
64
64
 
65
65
  const { order } = props.order
66
66
 
67
+ const hideTimer = configs?.hidden_driver_eta_time?.value === '1'
67
68
  const isAllowedDriverRejectOrder = configs?.allow_driver_reject_order?.value === '1'
68
69
  const isHideRejectButtons = configs?.reject_orders_enabled && configs?.reject_orders_enabled?.value !== '1'
69
70
  const theme = useTheme();
@@ -583,7 +584,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
583
584
  secondButton={true}
584
585
  firstColorCustom={theme.colors.red}
585
586
  secondColorCustom={theme.colors.green}
586
- widthButton={isHideRejectButtons ? '100%': '45%'}
587
+ widthButton={isHideRejectButtons ? '100%' : '45%'}
587
588
  isHideRejectButtons={isHideRejectButtons}
588
589
  />
589
590
  )}
@@ -603,7 +604,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
603
604
  secondButton={true}
604
605
  firstColorCustom={theme.colors.red}
605
606
  secondColorCustom={theme.colors.green}
606
- widthButton={isHideRejectButtons ? '100%': '45%'}
607
+ widthButton={isHideRejectButtons ? '100%' : '45%'}
607
608
  isHideRejectButtons={isHideRejectButtons}
608
609
  />
609
610
  </>
@@ -612,13 +613,13 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
612
613
  <FloatingButton
613
614
  btnText={t('REJECT', 'Reject')}
614
615
  isSecondaryBtn={false}
615
- secondButtonClick={() => (order?.isLogistic && (order?.order_group || logisticOrderStatus.includes(order?.status))) ? handleAcceptLogisticOrder(order) : handleViewActionOrder('accept')}
616
+ secondButtonClick={() => hideTimer ? handleChangeOrderStatus && handleChangeOrderStatus(8) : (order?.isLogistic && (order?.order_group || logisticOrderStatus.includes(order?.status))) ? handleAcceptLogisticOrder(order) : handleViewActionOrder('accept')}
616
617
  firstButtonClick={() => order?.isLogistic && (order?.order_group || logisticOrderStatus.includes(order?.status)) ? handleRejectLogisticOrder() : handleViewActionOrder('reject')}
617
618
  secondBtnText={t('ACCEPT', 'Accept')}
618
619
  secondButton={true}
619
620
  firstColorCustom={theme.colors.red}
620
621
  secondColorCustom={theme.colors.green}
621
- widthButton={isHideRejectButtons ? '100%': '45%'}
622
+ widthButton={isHideRejectButtons ? '100%' : '45%'}
622
623
  isHideRejectButtons={isHideRejectButtons}
623
624
  />
624
625
  )}
@@ -123,6 +123,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
123
123
  backColor: '#E63757'
124
124
  }
125
125
  ]
126
+ const combineTabs = configState?.configs?.combine_pending_and_progress_orders?.value === '1'
126
127
  const [selectedTabStatus, setSelectedTabStatus] = useState<any>(deliveryStatus)
127
128
  const [openedSelect, setOpenedSelect] = useState('')
128
129
 
@@ -467,7 +468,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
467
468
  nestedScrollEnabled={true}
468
469
  >
469
470
  <TabsContainer>
470
- {(isLogisticActivated && !isBusinessApp) && (
471
+ {(isLogisticActivated && !isBusinessApp && !combineTabs) && (
471
472
  <Pressable
472
473
  style={styles.pressable}
473
474
  onPress={() => setCurrentTabSelected('logisticOrders')}>
@@ -974,7 +975,9 @@ export const Timer = () => {
974
975
 
975
976
  export const OrdersOption = (props: OrdersOptionParams) => {
976
977
  const [, t] = useLanguage();
978
+ const [configState] = useConfig()
977
979
  const [checkNotificationStatus, setCheckNotificationStatus] = useState({ open: false, checked: false })
980
+ const combineTabs = configState?.configs?.combine_pending_and_progress_orders?.value === '1'
978
981
  const ordersProps = {
979
982
  ...props,
980
983
  UIComponent: OrdersOptionUI,
@@ -1061,32 +1064,52 @@ export const OrdersOption = (props: OrdersOptionParams) => {
1061
1064
  text: t('ORDER_DRIVER_ON_WAY', 'Driver on way')
1062
1065
  }
1063
1066
  ],
1064
- tabs: [
1067
+ tabs: combineTabs ? [
1065
1068
  {
1066
1069
  key: 0,
1067
- text: t('PENDING', 'Pending'),
1068
- tags: props?.orderGroupStatusCustom?.pending ?? [0, 13],
1069
- title: 'pending'
1070
+ text: t('ACTIVE', 'Active'),
1071
+ tags: props?.orderGroupStatusCustom?.active ?? [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23],
1072
+ title: 'active',
1070
1073
  },
1071
1074
  {
1072
1075
  key: 1,
1073
- text: t('IN_PROGRESS', 'In Progress'),
1074
- tags: props?.orderGroupStatusCustom?.inProgress ?? [3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23],
1075
- title: 'inProgress',
1076
- },
1077
- {
1078
- key: 2,
1079
1076
  text: t('COMPLETED', 'Completed'),
1080
1077
  tags: props?.orderGroupStatusCustom?.completed ?? [1, 11, 15],
1081
1078
  title: 'completed',
1082
1079
  },
1083
1080
  {
1084
- key: 3,
1081
+ key: 2,
1085
1082
  text: t('CANCELLED', 'Cancelled'),
1086
1083
  tags: props?.orderGroupStatusCustom?.cancelled ?? [2, 5, 6, 10, 12, 16, 17],
1087
1084
  title: 'cancelled',
1088
1085
  },
1089
- ]
1086
+ ] :
1087
+ [
1088
+ {
1089
+ key: 0,
1090
+ text: t('PENDING', 'Pending'),
1091
+ tags: props?.orderGroupStatusCustom?.pending ?? [0, 13],
1092
+ title: 'pending'
1093
+ },
1094
+ {
1095
+ key: 1,
1096
+ text: t('IN_PROGRESS', 'In Progress'),
1097
+ tags: props?.orderGroupStatusCustom?.inProgress ?? [3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23],
1098
+ title: 'inProgress',
1099
+ },
1100
+ {
1101
+ key: 2,
1102
+ text: t('COMPLETED', 'Completed'),
1103
+ tags: props?.orderGroupStatusCustom?.completed ?? [1, 11, 15],
1104
+ title: 'completed',
1105
+ },
1106
+ {
1107
+ key: 3,
1108
+ text: t('CANCELLED', 'Cancelled'),
1109
+ tags: props?.orderGroupStatusCustom?.cancelled ?? [2, 5, 6, 10, 12, 16, 17],
1110
+ title: 'cancelled',
1111
+ },
1112
+ ]
1090
1113
  };
1091
1114
 
1092
1115
  return (<>
@@ -303,6 +303,7 @@ export interface OrdersOptionParams {
303
303
  filtered?: any;
304
304
  handleClickOrder?: any;
305
305
  orderGroupStatusCustom?: {
306
+ active?: Array<number>;
306
307
  pending?: Array<number>;
307
308
  inProgress?: Array<number>;
308
309
  completed?: Array<number>;
@@ -40,7 +40,6 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
40
40
 
41
41
  const theme = useTheme();
42
42
 
43
-
44
43
  const pickerStyle = StyleSheet.create({
45
44
  inputAndroid: {
46
45
  width: 34,
@@ -77,7 +76,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
77
76
  const [isServiceOpen, setIsServiceOpen] = useState(false)
78
77
  // const [setHeight, setHeightState] = useState({ height: new Animated.Value(0) })
79
78
  // const [setRotate, setRotateState] = useState({ angle: new Animated.Value(0) })
80
- const [productQuantity, setProductQuantity] = useState(product.quantity.toString())
79
+ let productQuantity = product.quantity.toString()
81
80
 
82
81
  const productInfo = () => {
83
82
  if (isCartProduct) {
@@ -121,7 +120,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
121
120
 
122
121
  const handleChangeQuantity = (value: string) => {
123
122
  if (!orderState.loading) {
124
- setProductQuantity(value)
123
+ productQuantity = value
125
124
  if (parseInt(value) === 0) {
126
125
  onDeleteProduct && onDeleteProduct(product)
127
126
  } else {