@eohjsc/react-native-smart-city 0.3.17 → 0.3.18
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 +1 -1
- package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +1 -4
- package/src/screens/AddCommon/SelectSubUnit.js +1 -1
- package/src/screens/AddNewDevice/hooks/ConnectDevices.js +1 -1
- package/src/screens/AddNewDevice/index.js +1 -1
- package/src/screens/AddNewGateway/hooks/index.js +1 -1
- package/src/screens/SubUnit/hooks/useManageSubUnit.js +1 -1
- package/src/screens/SyncLGDevice/AddLGDevice.js +1 -1
- package/src/screens/Unit/Detail.js +1 -0
- package/src/screens/Unit/styles.js +10 -1
- package/src/screens/UnitSummary/index.js +1 -1
package/package.json
CHANGED
|
@@ -22,8 +22,8 @@ const NumberUpDownActionTemplate = ({ actionGroup, doAction, sensor }) => {
|
|
|
22
22
|
|
|
23
23
|
// eslint-disable-next-line no-unused-vars
|
|
24
24
|
const [configValues, setConfigValues] = useConfigGlobalState('configValues');
|
|
25
|
-
const [value, setValue] = useState();
|
|
26
25
|
const valueDefault = 28;
|
|
26
|
+
const [value, setValue] = useState(valueDefault);
|
|
27
27
|
|
|
28
28
|
useEffect(() => {
|
|
29
29
|
if (sensor?.device_type === DEVICE_TYPE.LG_THINQ) {
|
|
@@ -40,15 +40,12 @@ const NumberUpDownActionTemplate = ({ actionGroup, doAction, sensor }) => {
|
|
|
40
40
|
|
|
41
41
|
useEffect(() => {
|
|
42
42
|
if (!config) {
|
|
43
|
-
setValue(valueDefault);
|
|
44
43
|
return;
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
const configValue = configValues[config];
|
|
48
47
|
if (configValue !== null && configValue !== undefined) {
|
|
49
48
|
setValue(configValue);
|
|
50
|
-
} else {
|
|
51
|
-
setValue(valueDefault);
|
|
52
49
|
}
|
|
53
50
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
54
51
|
}, [JSON.stringify(configValues)]);
|
|
@@ -64,7 +64,7 @@ const AddCommonSelectSubUnit = ({ route }) => {
|
|
|
64
64
|
const fetchDetails = useCallback(async () => {
|
|
65
65
|
const { success, data } = await axiosGet(
|
|
66
66
|
API.UNIT.UNIT_DETAIL(unit_id),
|
|
67
|
-
{},
|
|
67
|
+
{ headers: { 'Cache-Control': 'no-cache' } },
|
|
68
68
|
true
|
|
69
69
|
);
|
|
70
70
|
if (success) {
|
|
@@ -13,7 +13,7 @@ const useConnectDevices = (new_sensor, station_id, unit_id) => {
|
|
|
13
13
|
const fetchDetails = useCallback(async () => {
|
|
14
14
|
const { success: fetchSuccess, data: unit } = await axiosGet(
|
|
15
15
|
API.UNIT.UNIT_DETAIL(unit_id),
|
|
16
|
-
{},
|
|
16
|
+
{ headers: { 'Cache-Control': 'no-cache' } },
|
|
17
17
|
true
|
|
18
18
|
);
|
|
19
19
|
const station = unit.stations.find((item) => item.id === station_id);
|
|
@@ -9,7 +9,7 @@ const useConnectGateway = (unit_id) => {
|
|
|
9
9
|
const fetchDetails = useCallback(async () => {
|
|
10
10
|
const { success: fetchSuccess, data: unit } = await axiosGet(
|
|
11
11
|
API.UNIT.UNIT_DETAIL(unit_id),
|
|
12
|
-
{},
|
|
12
|
+
{ headers: { 'Cache-Control': 'no-cache' } },
|
|
13
13
|
true
|
|
14
14
|
);
|
|
15
15
|
return { fetchSuccess, unit };
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
-
import { Colors } from '../../configs';
|
|
2
|
+
import { Colors, Constants } from '../../configs';
|
|
3
|
+
|
|
4
|
+
const marginItem = 12;
|
|
5
|
+
const marginHorizontal = 16;
|
|
6
|
+
const widthItem = (Constants.width - marginHorizontal * 2 - marginItem) / 2;
|
|
7
|
+
const heightItem = (widthItem / 166) * 126;
|
|
3
8
|
|
|
4
9
|
export default StyleSheet.create({
|
|
5
10
|
container: {
|
|
@@ -71,6 +76,10 @@ export default StyleSheet.create({
|
|
|
71
76
|
margin: 0,
|
|
72
77
|
padding: 0,
|
|
73
78
|
},
|
|
79
|
+
wrapItemStyle: {
|
|
80
|
+
height: heightItem,
|
|
81
|
+
marginVertical: 0,
|
|
82
|
+
},
|
|
74
83
|
camera: {
|
|
75
84
|
width: 1,
|
|
76
85
|
height: 1,
|
|
@@ -93,7 +93,7 @@ const UnitSummary = memo(({ route }) => {
|
|
|
93
93
|
const fetchUnitDetail = useCallback(async () => {
|
|
94
94
|
const { success, data } = await axiosGet(
|
|
95
95
|
API.UNIT.UNIT_DETAIL(unit?.id),
|
|
96
|
-
{},
|
|
96
|
+
{ headers: { 'Cache-Control': 'no-cache' } },
|
|
97
97
|
true
|
|
98
98
|
);
|
|
99
99
|
if (success) {
|