ordering-ui-react-native 0.23.65 → 0.23.66

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.65",
3
+ "version": "0.23.66",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState, useRef } from 'react';
2
- import { View, Pressable, StyleSheet, ScrollView, RefreshControl, Platform, TouchableOpacity } from 'react-native';
2
+ import { View, Pressable, StyleSheet, ScrollView, RefreshControl, Platform, TouchableOpacity, Animated, Easing } from 'react-native';
3
3
  import { useLanguage, useUtils, OrderListGroups, useConfig } from 'ordering-components/native';
4
4
  import SelectDropdown from 'react-native-select-dropdown'
5
5
  import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
@@ -139,6 +139,8 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
139
139
  const HEIGHT_SCREEN = orientationState?.dimensions?.height
140
140
  const IS_PORTRAIT = orientationState.orientation === PORTRAIT
141
141
  const showTagsList = !props.isAlsea && !props.isDriverApp && currentTabSelected !== 'logisticOrders'
142
+ const AnimatedFeatherIcon = Animated.createAnimatedComponent(FeatherIcon);
143
+ const spinValue = new Animated.Value(0);
142
144
 
143
145
  const preorderTypeList = [
144
146
  { key: null, name: t('SLA', 'SLA\'s') },
@@ -468,6 +470,25 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
468
470
  }
469
471
  }, [isNetConnected, JSON.stringify(offlineActionsState.orders)]);
470
472
 
473
+
474
+ const handleInitAnimation = () => {
475
+ Animated.timing(
476
+ spinValue,
477
+ {
478
+ toValue: 1,
479
+ duration: 2000,
480
+ easing: Easing.linear,
481
+ useNativeDriver: true
482
+ }
483
+ ).start()
484
+ }
485
+
486
+ useEffect(() => {
487
+ if (currentOrdersGroup?.loading || logisticOrders?.loading){
488
+ handleInitAnimation()
489
+ }
490
+ }, [currentOrdersGroup?.loading, logisticOrders?.loading])
491
+
471
492
  return (
472
493
  <>
473
494
  <View style={styles.header}>
@@ -477,12 +498,20 @@ const OrdersOptionUI = (props: OrdersOptionParams) => {
477
498
  <WebsocketStatus />
478
499
  </View>
479
500
  {isNetConnected && (
480
- <FeatherIcon
501
+ <AnimatedFeatherIcon
481
502
  name='refresh-cw'
482
503
  color={theme.colors.backgroundDark}
483
504
  size={24}
484
- onPress={() => { currentTabSelected === 'logisticOrders' ? loadLogisticOrders && loadLogisticOrders() : loadOrders && loadOrders({ newFetch: true }) }}
485
- style={{ marginRight: 20 }}
505
+ onPress={() => currentTabSelected === 'logisticOrders' ? loadLogisticOrders && loadLogisticOrders() : loadOrders && loadOrders({ newFetch: true })}
506
+ style={{
507
+ marginRight: 20,
508
+ transform: [{
509
+ rotate: spinValue.interpolate({
510
+ inputRange: [0, 0.3],
511
+ outputRange: ['0deg', '360deg'],
512
+ })
513
+ }]
514
+ }}
486
515
  />
487
516
  )}
488
517
  <FontistoIcon