@eohjsc/react-native-smart-city 0.2.94 → 0.2.95

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@eohjsc/react-native-smart-city",
3
3
  "title": "React Native Smart Home",
4
- "version": "0.2.94",
4
+ "version": "0.2.95",
5
5
  "description": "TODO",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -1,7 +1,6 @@
1
1
  import React, { memo, useCallback, useEffect } from 'react';
2
2
  import { TouchableOpacity, ScrollView } from 'react-native';
3
3
  import Popover from 'react-native-popover-view';
4
- import debounce from 'lodash.debounce';
5
4
 
6
5
  import styles from './MenuActionMoreStyles';
7
6
  import Text from '../Text';
@@ -21,25 +20,13 @@ const MenuActionMore = memo(
21
20
  isTextCenter = true,
22
21
  }) => {
23
22
  const onPress = useCallback(
24
- (item, index) => {
23
+ (item, index) => () => {
25
24
  hideMore && hideMore();
26
25
  onItemClick && onItemClick(item, index);
27
26
  },
28
27
  [hideMore, onItemClick]
29
28
  );
30
29
 
31
- // eslint-disable-next-line react-hooks/exhaustive-deps
32
- const debouncedOnPress = useCallback(
33
- debounce(
34
- (item, index) => {
35
- onPress(item, index);
36
- },
37
- 500,
38
- { leading: true, trailing: false }
39
- ),
40
- []
41
- );
42
-
43
30
  useEffect(() => {
44
31
  // eslint-disable-next-line react-hooks/rules-of-hooks
45
32
  useStatusBarPreview(
@@ -65,7 +52,7 @@ const MenuActionMore = memo(
65
52
  styles.menuWrapper,
66
53
  isTextCenter ? styles.modalHeaderCenter : styles.modalHeader,
67
54
  ]}
68
- onPress={() => debouncedOnPress(item, index)}
55
+ onPress={onPress(item, index)}
69
56
  key={index}
70
57
  testID={TESTID.TOUCHABLE_ACTION_ADD_MORE}
71
58
  >
@@ -137,9 +137,9 @@ const API = {
137
137
  CHECK_SEND_EMAIL: () =>
138
138
  SCConfig.apiRoot + '/connection_manager/googlehome/check_send_email/',
139
139
  },
140
- POWER_CONSUME: {
140
+ VALUE_CONSUME: {
141
141
  DISPLAY_HISTORY: () =>
142
- SCConfig.apiRoot + '/property_manager/power_consume/display_history/',
142
+ SCConfig.apiRoot + '/property_manager/value_consume/display_history/',
143
143
  },
144
144
  SHARE: {
145
145
  UNITS: () => SCConfig.apiRoot + '/property_manager/sharing/units/',
@@ -207,7 +207,7 @@ const ThreePhasePowerConsumption = memo(({ summaryDetail }) => {
207
207
  params.append('date_from', moment(startDate).format('YYYY-MM-DD'));
208
208
  params.append('date_to', moment(endDate).format('YYYY-MM-DD'));
209
209
  const { success, data } = await axiosGet(
210
- API.POWER_CONSUME.DISPLAY_HISTORY,
210
+ API.VALUE_CONSUME.DISPLAY_HISTORY,
211
211
  {
212
212
  params,
213
213
  }
@@ -96,7 +96,7 @@ const PowerConsumption = memo(({ summaryDetail }) => {
96
96
  params.append('date_to', moment(endDate).format('YYYY-MM-DD'));
97
97
  }
98
98
  const { success, data } = await axiosGet(
99
- API.POWER_CONSUME.DISPLAY_HISTORY(),
99
+ API.VALUE_CONSUME.DISPLAY_HISTORY(),
100
100
  {
101
101
  params,
102
102
  }