ordering-ui-react-native 0.23.67 → 0.23.69

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.23.67",
3
+ "version": "0.23.69",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -470,7 +470,6 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
470
470
  }
471
471
  }, [isNetConnected, JSON.stringify(offlineActionsState.orders)]);
472
472
 
473
-
474
473
  const handleInitAnimation = () => {
475
474
  Animated.timing(
476
475
  spinValue,
@@ -682,6 +681,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
682
681
  {!currentOrdersGroup?.error?.length &&
683
682
  currentOrdersGroup?.orders?.length > 0 &&
684
683
  currentTabSelected !== 'logisticOrders' &&
684
+ !currentOrdersGroup?.loading &&
685
685
  (
686
686
  <PreviousOrders
687
687
  orders={ordersFormatted}
@@ -701,6 +701,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
701
701
  )}
702
702
  {!logisticOrders?.error?.length &&
703
703
  logisticOrders && logisticOrders?.orders?.length > 0 &&
704
+ !logisticOrders?.loading &&
704
705
  currentTabSelected === 'logisticOrders' && (
705
706
  <PreviousOrders
706
707
  orders={logisticOrders?.orders?.filter((order: any) => !order?.expired).map((order: any) => ({ ...order, isLogistic: true }))}
@@ -719,11 +720,10 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
719
720
  (currentOrdersGroup?.pagination?.total === null && isNetConnected) ||
720
721
  logisticOrders?.loading
721
722
  ) &&
722
- !currentOrdersGroup?.error?.length &&
723
- !currentOrdersGroup?.orders?.length
723
+ !currentOrdersGroup?.error?.length
724
724
  ) || internetLoading
725
725
  ) && (
726
- <View>
726
+ <View style={{ marginTop: 10 }}>
727
727
  {[...Array(5)].map((_, i) => (
728
728
  <Placeholder key={i} Animation={Fade}>
729
729
  <View
@@ -775,7 +775,7 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
775
775
  (currentOrdersGroup?.error?.length ||
776
776
  currentOrdersGroup?.orders?.length === 0)) ||
777
777
  (currentTabSelected === 'logisticOrders' &&
778
- (logisticOrders && logisticOrders?.error?.length > 0 || logisticOrders?.orders?.length === 0 || !logisticOrders?.orders?.some(order => !order?.expired)))
778
+ (logisticOrders && !logisticOrders?.loading && (logisticOrders?.error?.length > 0 || logisticOrders?.orders?.length === 0 || !logisticOrders?.orders?.some(order => !order?.expired))))
779
779
  ) &&
780
780
  (
781
781
  <NotFoundSource
@@ -171,7 +171,7 @@ export const OrderItem = React.memo((props: any) => {
171
171
  timeState={order?.time_status}
172
172
  />
173
173
  )}
174
- <Logo style={styles.logo}>
174
+ <Logo style={styles.logo} hasExternalAndGroup={showExternalId && order?.order_group_id}>
175
175
  <FastImage
176
176
  style={styles.icon}
177
177
  source={order.business?.logo?.includes('https') ? {
@@ -182,7 +182,7 @@ export const OrderItem = React.memo((props: any) => {
182
182
  resizeMode={FastImage.resizeMode.cover}
183
183
  />
184
184
  </Logo>
185
- <Information>
185
+ <Information hasExternalAndGroup={showExternalId && order?.order_group_id}>
186
186
  {!!order?.order_group_id && (
187
187
  <OText>
188
188
  <OText>{(t('INVOICE_GROUP_NO', 'Group No.') + order?.order_group_id)}</OText>
@@ -217,7 +217,7 @@ export const OrderItem = React.memo((props: any) => {
217
217
  </NotificationIcon>
218
218
  )}
219
219
  <View>
220
- {!order?.order_group_id && showExternalId && !order?.order_group && (
220
+ {showExternalId && (
221
221
  <OText
222
222
  style={styles.date}
223
223
  color={theme.colors.unselectText}
@@ -10,6 +10,7 @@ export const Card = styled.View`
10
10
  export const Logo = styled.View`
11
11
  height: 65px;
12
12
  width: 65px;
13
+ align-self: ${({ hasExternalAndGroup }: any) => hasExternalAndGroup ? 'center' : 'auto'};
13
14
  `;
14
15
 
15
16
  export const Information = styled.View`
@@ -17,7 +18,7 @@ export const Information = styled.View`
17
18
  justify-content: flex-start;
18
19
  margin-horizontal: 5px;
19
20
  flex: 1;
20
- max-height: 60px;
21
+ max-height: ${({ hasExternalAndGroup }: any) => hasExternalAndGroup ? '75px' : '60px'};
21
22
  `;
22
23
 
23
24
  export const MyOrderOptions = styled.View`
@@ -474,10 +474,10 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
474
474
  {activeStatus.includes(order?.status) ? (
475
475
  <>
476
476
  {cateringTypes.includes(order?.delivery_type) ? `${t('CREATED_AT', 'Created at')}: ${parseDate(order?.created_at)}\n` : ''}
477
- {cateringTypes.includes(order?.delivery_type) ? `${t('PLACED_TO', 'Placed to')}:` : ''} <OrderEta order={order} />
477
+ {cateringTypes.includes(order?.delivery_type) ? `${t('PLACED_TO', 'Placed to')}:` : ''} <OrderEta order={order} outputFormat={`YYYY-MM-DD ${configs?.general_hour_format?.value}`} />
478
478
  </>
479
479
  ) : (
480
- parseDate(order?.reporting_data?.at[`status:${order.status}`])
480
+ parseDate(order?.reporting_data?.at[`status:${order.status}`], { outputFormat: `YYYY-MM-DD ${configs?.general_hour_format?.value}` })
481
481
  )}
482
482
  </OText>}
483
483
  />