@eohjsc/react-native-smart-city 0.2.26 → 0.2.27

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.
Files changed (123) hide show
  1. package/assets/images/Illustrations.svg +83 -0
  2. package/assets/images/{WeatherChange.svg → ValueChange.svg} +0 -0
  3. package/index.js +2 -0
  4. package/package.json +3 -1
  5. package/src/Images/Common/file.png +0 -0
  6. package/src/Images/Common/fullscreen.png +0 -0
  7. package/src/commons/ActionGroup/OnOffTemplate/index.js +5 -0
  8. package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +294 -0
  9. package/src/commons/ActionGroup/__test__/NumberUpDownTemplateWithNullConfigValue.test.js +60 -0
  10. package/src/commons/AlertAction/__test__/AlertAction.test.js +6 -6
  11. package/src/commons/AlertAction/index.js +2 -0
  12. package/src/commons/Automate/ItemAutomate.js +7 -1
  13. package/src/commons/Automate/__test__/ItemAutomate.test.js +16 -0
  14. package/src/commons/Automate/__test__/ItemScriptAction.test.js +16 -0
  15. package/src/commons/BackDefault/__test__/BackDefault.test.js +21 -0
  16. package/src/commons/BottomScrollPicker/index.js +5 -1
  17. package/src/commons/BottomSheet/index.js +10 -5
  18. package/src/commons/ButtonPopup/__test__/__snapshots__/ButtonPopup.test.js.snap +2 -0
  19. package/src/commons/ButtonPopup/index.js +2 -0
  20. package/src/commons/Calendar/index.js +72 -0
  21. package/src/commons/Calendar/styles.js +11 -0
  22. package/src/commons/Device/ItemAddNew/index.js +2 -2
  23. package/src/commons/Explore/__test__/HeaderExplore.test.js +25 -0
  24. package/src/commons/Explore/__test__/LocationItem.test.js +31 -0
  25. package/src/commons/Header/HeaderCustom.js +7 -3
  26. package/src/commons/HeaderAni/index.js +31 -3
  27. package/src/commons/HorizontalPicker/index.js +134 -0
  28. package/src/commons/HorizontalPicker/styles.js +56 -0
  29. package/src/commons/Modal/__test__/ModalBottom.test.js +39 -0
  30. package/src/commons/RowItem/__test__/RowItem.test.js +16 -0
  31. package/src/commons/RowItem/index.js +61 -0
  32. package/src/commons/RowItem/styles.js +53 -0
  33. package/src/commons/Sharing/WrapHeaderScrollable.js +78 -74
  34. package/src/commons/SubUnit/OneTap/ItemOneTap.js +73 -69
  35. package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +47 -1
  36. package/src/commons/SubUnit/OneTap/index.js +2 -2
  37. package/src/commons/Unit/__test__/SharedUnit.test.js +330 -0
  38. package/src/commons/WheelDateTimePicker/index.js +16 -8
  39. package/src/commons/index.js +2 -0
  40. package/src/configs/API.js +5 -1
  41. package/src/configs/Constants.js +18 -3
  42. package/src/configs/Theme.js +20 -0
  43. package/src/context/SCContext.tsx +2 -2
  44. package/src/context/mockStore.ts +3 -1
  45. package/src/hooks/Common/__test__/useStatusbar.test.js +28 -0
  46. package/src/navigations/AutomateStack.js +45 -0
  47. package/src/navigations/UnitStack.js +33 -14
  48. package/src/navigations/utils.js +8 -0
  49. package/src/screens/AddNewAction/Components/LoadingSelectAction.js +40 -0
  50. package/src/screens/AddNewAction/Components/index.js +3 -0
  51. package/src/screens/AddNewAction/SelectAction.js +147 -62
  52. package/src/screens/AddNewAction/{SelectDevice.js → SelectSensorDevices.js} +42 -12
  53. package/src/screens/AddNewAction/SetupSensor.js +221 -0
  54. package/src/screens/AddNewAction/Styles/SelectActionStyles.js +43 -5
  55. package/src/screens/AddNewAction/Styles/{SelectDeviceStyles.js → SelectSensorDevicesStyles.js} +0 -0
  56. package/src/screens/AddNewAction/Styles/SetupSensorStyles.js +76 -0
  57. package/src/screens/AddNewAction/__test__/SelectAction.test.js +0 -19
  58. package/src/screens/AddNewAction/__test__/{SelectDevice.test.js → SelectSensorDevices.test.js} +3 -3
  59. package/src/screens/AddNewAction/__test__/SetupSensor.test.js +125 -0
  60. package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +69 -12
  61. package/src/screens/AddNewAutoSmart/index.js +42 -14
  62. package/src/screens/AddNewOneTap/AddNewOneTapStyles.js +4 -3
  63. package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +1 -0
  64. package/src/screens/AddNewOneTap/index.js +7 -4
  65. package/src/screens/AllCamera/__test__/index.test.js +103 -0
  66. package/src/screens/Automate/Components/Loading.js +64 -0
  67. package/src/screens/Automate/Styles/indexStyles.js +64 -0
  68. package/src/screens/Automate/__test__/Loading.test.js +16 -0
  69. package/src/screens/Automate/__test__/index.test.js +93 -0
  70. package/src/screens/Automate/index.js +148 -0
  71. package/src/screens/Device/__test__/detail.test.js +64 -0
  72. package/src/screens/Device/detail.js +17 -7
  73. package/src/screens/EditActionsList/index.js +2 -2
  74. package/src/screens/GuestInfo/__test__/index.test.js +176 -0
  75. package/src/screens/GuestInfo/components/AccessScheduleItem.js +6 -1
  76. package/src/screens/GuestInfo/components/AccessScheduleSheet.js +26 -15
  77. package/src/screens/GuestInfo/components/HeaderGuestInfo.js +6 -1
  78. package/src/screens/GuestInfo/components/RecurringDetail.js +9 -2
  79. package/src/screens/GuestInfo/components/TemporaryDetail.js +9 -2
  80. package/src/screens/GuestInfo/constant.js +2 -2
  81. package/src/screens/GuestInfo/index.js +4 -5
  82. package/src/screens/PlayBackCamera/Timer.js +1 -1
  83. package/src/screens/ScriptDetail/Styles/indexStyles.js +14 -0
  84. package/src/screens/ScriptDetail/__test__/index.test.js +119 -0
  85. package/src/screens/ScriptDetail/hooks/index.js +55 -0
  86. package/src/screens/ScriptDetail/index.js +124 -23
  87. package/src/screens/SelectUnit/Styles/indexStyles.js +55 -0
  88. package/src/screens/SelectUnit/__test__/index.test.js +85 -0
  89. package/src/screens/SelectUnit/index.js +100 -0
  90. package/src/screens/SetSchedule/__test__/index.test.js +97 -0
  91. package/src/screens/SetSchedule/components/RepeatOptionsPopup.js +56 -0
  92. package/src/screens/SetSchedule/components/RowItem.js +27 -0
  93. package/src/screens/SetSchedule/components/SelectWeekday.js +65 -0
  94. package/src/screens/SetSchedule/index.js +139 -0
  95. package/src/screens/SetSchedule/styles/RepeatOptionsPopupStyles.js +22 -0
  96. package/src/screens/SetSchedule/styles/RowItemStyles.js +29 -0
  97. package/src/screens/SetSchedule/styles/SelectWeekdayStyles.js +26 -0
  98. package/src/screens/{AddNewScriptAction/AddNewScriptActionStyles.js → SetSchedule/styles/indexStyles.js} +6 -12
  99. package/src/screens/Sharing/__test__/MemberList.test.js +21 -28
  100. package/src/screens/SubUnit/EditSubUnit.js +274 -0
  101. package/src/screens/SubUnit/EditSubUnitStyles.js +119 -0
  102. package/src/screens/SubUnit/ManageSubUnit.js +112 -370
  103. package/src/screens/SubUnit/ManageSubUnitStyles.js +40 -0
  104. package/src/screens/SubUnit/__test__/EditSubUnit.test.js +427 -0
  105. package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +42 -386
  106. package/src/screens/SubUnit/hooks/__test__/useManageSubUnit.test.js +85 -0
  107. package/src/screens/SubUnit/hooks/useManageSubUnit.js +35 -0
  108. package/src/screens/Unit/Detail.js +3 -2
  109. package/src/screens/Unit/ManageUnit.js +10 -0
  110. package/src/screens/Unit/components/SearchLocation/__test__/RowLocation.test.js +36 -0
  111. package/src/screens/Unit/components/__test__/MyUnit.test.js +35 -0
  112. package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +32 -0
  113. package/src/screens/UnitSummary/components/__test__/UnitSummary.test.js +67 -0
  114. package/src/screens/UnitSummary/components/__test__/index.test.js +48 -0
  115. package/src/screens/UnitSummary/components/index.js +1 -37
  116. package/src/screens/UnitSummary/components/indexstyles.js +39 -0
  117. package/src/utils/Apis/axios.js +0 -4
  118. package/src/utils/I18n/translations/en.json +30 -4
  119. package/src/utils/I18n/translations/vi.json +29 -3
  120. package/src/utils/Route/index.js +6 -1
  121. package/src/utils/__test__/InitData.test.js +20 -0
  122. package/src/commons/Automate/ItemAddNewScriptAction.js +0 -30
  123. package/src/screens/AddNewScriptAction/index.js +0 -100
@@ -0,0 +1,53 @@
1
+ import { Colors } from '../../configs';
2
+ import { StyleSheet } from 'react-native';
3
+
4
+ export default StyleSheet.create({
5
+ wrap: {
6
+ flex: 1,
7
+ backgroundColor: Colors.White,
8
+ },
9
+ columeFlex: {
10
+ paddingLeft: 16,
11
+ flexDirection: 'column',
12
+ },
13
+ rowFlex: {
14
+ flexDirection: 'row',
15
+ },
16
+ endFlex: {
17
+ flex: 1,
18
+ justifyContent: 'center',
19
+ alignItems: 'flex-end',
20
+ paddingRight: 16,
21
+ },
22
+ Border: {
23
+ display: 'flex',
24
+ width: '100%',
25
+ borderWidth: 0,
26
+ borderColor: Colors.Gray4,
27
+ borderBottomWidth: 1,
28
+ borderStyle: 'solid',
29
+ flexDirection: 'row',
30
+ paddingTop: 16,
31
+ paddingBottom: 16,
32
+ },
33
+ titleName: {
34
+ fontSize: 16,
35
+ lineHeight: 24,
36
+ fontStyle: 'normal',
37
+ fontWeight: '400',
38
+ color: Colors.Gray9,
39
+ },
40
+ status: {
41
+ fontSize: 12,
42
+ lineHeight: 20,
43
+ fontStyle: 'normal',
44
+ fontWeight: '400',
45
+ color: Colors.Gray7,
46
+ },
47
+ container: {
48
+ paddingTop: 0,
49
+ },
50
+ paddingLeft16: {
51
+ paddingLeft: 16,
52
+ },
53
+ });
@@ -14,82 +14,86 @@ import { Colors, Theme } from '../../configs';
14
14
  import HeaderAni, { heightHeader } from '../../commons/HeaderAni';
15
15
  import Text from '../../commons/Text';
16
16
 
17
- const WrapHeaderScrollable = memo(
18
- ({
19
- children,
20
- title,
21
- subTitle,
22
- rightComponent,
23
- loading = false,
24
- onRefresh,
25
- styleScrollView,
26
- contentContainerStyle,
27
- onLoadMore,
28
- headerAniStyle,
29
- }) => {
30
- const animatedScrollYValue = useRef(new Animated.Value(0)).current;
31
- const [loadingMore, setLoadingMore] = useState(false);
32
- const loadMore = useCallback(() => {
33
- if (onLoadMore) {
34
- setLoadingMore(true);
35
- onLoadMore(() => setLoadingMore(false));
36
- }
37
- }, [onLoadMore]);
17
+ const WrapHeaderScrollable = ({
18
+ children,
19
+ title,
20
+ subTitle,
21
+ rightComponent,
22
+ loading = false,
23
+ onRefresh,
24
+ styleScrollView,
25
+ contentContainerStyle,
26
+ onLoadMore,
27
+ headerAniStyle,
28
+ headerAniCenterStyle,
29
+ onGoBack,
30
+ }) => {
31
+ const animatedScrollYValue = useRef(new Animated.Value(0)).current;
32
+ const [loadingMore, setLoadingMore] = useState(false);
33
+ const loadMore = useCallback(() => {
34
+ if (onLoadMore) {
35
+ setLoadingMore(true);
36
+ onLoadMore(() => setLoadingMore(false));
37
+ }
38
+ }, [onLoadMore]);
38
39
 
39
- return (
40
- <SafeAreaView style={[styles.container, headerAniStyle]}>
41
- <HeaderAni
42
- scrollY={animatedScrollYValue}
43
- title={title}
44
- rightComponent={rightComponent}
45
- headerStyle={headerAniStyle}
46
- />
47
- <Animated.ScrollView
48
- scrollEventThrottle={16}
49
- onScroll={Animated.event(
50
- [{ nativeEvent: { contentOffset: { y: animatedScrollYValue } } }],
51
- {
52
- useNativeDriver: false,
53
- }
54
- )}
55
- style={[styles.scrollView, styleScrollView]}
56
- contentContainerStyle={[
57
- styles.contentContainerStyle,
58
- contentContainerStyle && contentContainerStyle,
59
- ]}
60
- refreshControl={
61
- <RefreshControl
62
- refreshing={loading}
63
- onRefresh={onRefresh}
64
- progressViewOffset={heightHeader}
65
- />
40
+ return (
41
+ <SafeAreaView style={[styles.container, headerAniStyle]}>
42
+ <HeaderAni
43
+ scrollY={animatedScrollYValue}
44
+ title={title}
45
+ rightComponent={rightComponent}
46
+ headerAniCenterStyle={headerAniCenterStyle}
47
+ headerStyle={headerAniStyle}
48
+ onLeft={onGoBack}
49
+ />
50
+ <Animated.ScrollView
51
+ scrollEventThrottle={16}
52
+ onScroll={Animated.event(
53
+ [{ nativeEvent: { contentOffset: { y: animatedScrollYValue } } }],
54
+ {
55
+ useNativeDriver: false,
66
56
  }
67
- contentInset={{
68
- top: heightHeader - (isIphoneX() ? 32 : 0),
69
- }}
70
- contentOffset={{
71
- y: -heightHeader,
72
- }}
73
- showsVerticalScrollIndicator={false}
74
- onMomentumScrollEnd={loadMore}
75
- >
76
- {!!subTitle && (
77
- <Text type={'Body'} color={Colors.Gray8} style={styles.subTitle}>
78
- {subTitle}
79
- </Text>
80
- )}
81
- {children}
82
- {loadingMore && (
83
- <View style={styles.bottomLoading}>
84
- <ActivityIndicator size="small" color={Colors.Black} />
85
- </View>
86
- )}
87
- </Animated.ScrollView>
88
- </SafeAreaView>
89
- );
90
- }
91
- );
92
- export default WrapHeaderScrollable;
57
+ )}
58
+ style={[styles.scrollView, styleScrollView]}
59
+ contentContainerStyle={[
60
+ styles.contentContainerStyle,
61
+ contentContainerStyle && contentContainerStyle,
62
+ ]}
63
+ refreshControl={
64
+ <RefreshControl
65
+ refreshing={loading}
66
+ onRefresh={onRefresh}
67
+ progressViewOffset={heightHeader}
68
+ />
69
+ }
70
+ contentInset={{
71
+ top: heightHeader - (isIphoneX() ? 32 : 0),
72
+ }}
73
+ contentOffset={{
74
+ y: -heightHeader,
75
+ }}
76
+ showsVerticalScrollIndicator={false}
77
+ onMomentumScrollEnd={loadMore}
78
+ >
79
+ {!!subTitle && (
80
+ <Text type={'Body'} color={Colors.Gray8} style={styles.subTitle}>
81
+ {subTitle}
82
+ </Text>
83
+ )}
84
+ {children}
85
+ {loadingMore && (
86
+ <View style={styles.bottomLoading}>
87
+ <ActivityIndicator size="small" color={Colors.Black} />
88
+ </View>
89
+ )}
90
+ </Animated.ScrollView>
91
+ </SafeAreaView>
92
+ );
93
+ };
94
+
95
+ export default memo(WrapHeaderScrollable);
96
+
93
97
  const styles = StyleSheet.create({
94
98
  container: {
95
99
  flex: 1,
@@ -15,83 +15,87 @@ import { useTranslations } from '../../../hooks/Common/useTranslations';
15
15
  import { useNavigation } from '@react-navigation/native';
16
16
  import Routes from '../../../utils/Route';
17
17
  import { useGetIdUser } from '../../../hooks/Common';
18
- import { TESTID } from '../../../configs/Constants';
18
+ import { AUTOMATE_TYPE, TESTID } from '../../../configs/Constants';
19
19
 
20
- const ItemOneTap = memo(({ isOwner, automate, unit }) => {
21
- const { navigate } = useNavigation();
22
- const { id, type, user, script, activate_at } = automate;
23
- const t = useTranslations();
24
- const idUser = useGetIdUser();
20
+ const ItemOneTap = memo(
21
+ ({ isOwner, automate, unit, wrapSyles, onPressItem }) => {
22
+ const { navigate } = useNavigation();
23
+ const { id, type, user, script, activate_at } = automate;
24
+ const t = useTranslations();
25
+ const idUser = useGetIdUser();
25
26
 
26
- const goToDetail = useCallback(() => {
27
- navigate(Routes.ScriptDetail, {
28
- id,
29
- name: script?.name,
30
- type: type,
31
- havePermission: isOwner || user === idUser,
32
- unit,
33
- });
34
- }, [isOwner, user, idUser, navigate, id, script, type, unit]);
27
+ const goToDetail = useCallback(() => {
28
+ navigate(Routes.ScriptDetail, {
29
+ id,
30
+ name: script?.name,
31
+ type: type,
32
+ havePermission: isOwner || user === idUser,
33
+ unit,
34
+ });
35
+ }, [isOwner, user, idUser, navigate, id, script, type, unit]);
35
36
 
36
- const handleScriptAction = useCallback(async () => {
37
- const { success } = await axiosPost(API.AUTOMATE.ACTION_ONE_TAP(id));
38
- if (success) {
39
- ToastBottomHelper.success(t('Activated successfully.'));
40
- } else {
41
- ToastBottomHelper.error(t('Activation failed.'));
42
- }
43
- // eslint-disable-next-line react-hooks/exhaustive-deps
44
- }, [id]);
37
+ const handleScriptAction = useCallback(async () => {
38
+ const { success } = await axiosPost(API.AUTOMATE.ACTION_ONE_TAP(id));
39
+ if (success) {
40
+ ToastBottomHelper.success(t('Activated successfully.'));
41
+ } else {
42
+ ToastBottomHelper.error(t('Activation failed.'));
43
+ }
44
+ // eslint-disable-next-line react-hooks/exhaustive-deps
45
+ }, [id]);
45
46
 
46
- const displayIcon = () => {
47
- const iconKit = script?.icon_kit;
48
- return iconKit ? (
49
- <FImage source={{ uri: iconKit }} style={styles.iconSensor} />
50
- ) : (
51
- <OneTap />
52
- );
53
- };
54
- const activateAt = activate_at
55
- ? timeDifference(new Date(), moment(activate_at), true)
56
- : null;
57
- return (
58
- <TouchableWithoutFeedback onPress={goToDetail}>
59
- <View style={styles.container}>
60
- <View style={styles.boxIcon}>
61
- {displayIcon()}
62
- <TouchableOpacity
63
- testID={TESTID.AUTOMATE_SCRIPT_ACTION}
64
- onPress={handleScriptAction}
65
- >
66
- <CheckCircle />
67
- </TouchableOpacity>
68
- </View>
69
- <TouchableOpacity testID={TESTID.GO_DETAIL} onPress={goToDetail}>
70
- <Text
71
- numberOfLines={1}
72
- semibold
73
- size={14}
74
- color={Colors.Gray9}
75
- type="Body"
76
- >
77
- {script?.name}
78
- </Text>
79
- <View style={styles.descriptionContainer}>
47
+ const displayIcon = () => {
48
+ const iconKit = script?.icon_kit;
49
+ return iconKit ? (
50
+ <FImage source={{ uri: iconKit }} style={styles.iconSensor} />
51
+ ) : (
52
+ <OneTap />
53
+ );
54
+ };
55
+ const activateAt = activate_at
56
+ ? timeDifference(new Date(), moment(activate_at), true)
57
+ : null;
58
+ return (
59
+ <TouchableWithoutFeedback onPress={onPressItem || goToDetail}>
60
+ <View style={[styles.container, wrapSyles]}>
61
+ <View style={styles.boxIcon}>
62
+ {displayIcon()}
63
+ {type === AUTOMATE_TYPE.ONE_TAP && (
64
+ <TouchableOpacity
65
+ testID={TESTID.AUTOMATE_SCRIPT_ACTION}
66
+ onPress={handleScriptAction}
67
+ >
68
+ <CheckCircle />
69
+ </TouchableOpacity>
70
+ )}
71
+ </View>
72
+ <TouchableOpacity testID={TESTID.GO_DETAIL} onPress={goToDetail}>
80
73
  <Text
81
74
  numberOfLines={1}
82
75
  semibold
83
- size={12}
84
- color={Colors.Gray8}
85
- type="Label"
76
+ size={14}
77
+ color={Colors.Gray9}
78
+ type="Body"
86
79
  >
87
- {activateAt && t('activated_time', { time: activateAt })}
80
+ {script?.name}
88
81
  </Text>
89
- <IconOutline name="right" size={12} />
90
- </View>
91
- </TouchableOpacity>
92
- </View>
93
- </TouchableWithoutFeedback>
94
- );
95
- });
82
+ <View style={styles.descriptionContainer}>
83
+ <Text
84
+ numberOfLines={1}
85
+ semibold
86
+ size={12}
87
+ color={Colors.Gray8}
88
+ type="Label"
89
+ >
90
+ {activateAt && t('activated_time', { time: activateAt })}
91
+ </Text>
92
+ <IconOutline name="right" size={12} />
93
+ </View>
94
+ </TouchableOpacity>
95
+ </View>
96
+ </TouchableWithoutFeedback>
97
+ );
98
+ }
99
+ );
96
100
 
97
101
  export default ItemOneTap;
@@ -117,7 +117,8 @@ describe('test Item', () => {
117
117
  });
118
118
  });
119
119
 
120
- test('render SubUnitAutomate handleScriptAction fail', async () => {
120
+ test('render SubUnitAutomate not is owner handleScriptAction fail', async () => {
121
+ data.isOwner = false;
121
122
  const response = {
122
123
  status: 400,
123
124
  };
@@ -146,4 +147,49 @@ describe('test Item', () => {
146
147
  visibilityTime: 1000,
147
148
  });
148
149
  });
150
+
151
+ test('render SubUnitAutomate script value_change', async () => {
152
+ data.isOwner = false;
153
+ data.type = 'value_change';
154
+ data.automates = [
155
+ {
156
+ id: 1,
157
+ user: 6,
158
+ type: 'value_change',
159
+ activate_at: null,
160
+ script: {
161
+ name: 'Rain',
162
+ icon: '',
163
+ icon_kit: 'https://www.figma.com/',
164
+ },
165
+ },
166
+ ];
167
+ const response = {
168
+ status: 200,
169
+ };
170
+
171
+ axios.post.mockImplementation(async () => {
172
+ return response;
173
+ });
174
+
175
+ await act(async () => {
176
+ tree = await create(wrapComponent(data));
177
+ });
178
+
179
+ const goDetail = tree.root.findAll(
180
+ (el) =>
181
+ el.props.testID === TESTID.GO_DETAIL && el.type === TouchableOpacity
182
+ );
183
+ expect(goDetail).toHaveLength(1);
184
+ await act(async () => {
185
+ await goDetail[0].props.onPress();
186
+ });
187
+ expect(mockedNavigate).toHaveBeenCalledWith(Routes.ScriptDetail, {
188
+ havePermission: false,
189
+ id: 1,
190
+ name: 'Rain',
191
+ type: 'value_change',
192
+ unit: undefined,
193
+ });
194
+ });
149
195
  });
@@ -10,7 +10,7 @@ import { useNavigation } from '@react-navigation/native';
10
10
  import Routes from '../../../utils/Route/index.js';
11
11
  import { AUTOMATE_TYPE } from '../../../configs/Constants';
12
12
 
13
- const SubUnitAutomate = ({ isOwner, type, automates, unit }) => {
13
+ const SubUnitAutomate = ({ isOwner, type, automates, unit, isScript }) => {
14
14
  const t = useTranslations();
15
15
  const { navigate } = useNavigation();
16
16
  const handleOnAddNew = () => {
@@ -19,7 +19,7 @@ const SubUnitAutomate = ({ isOwner, type, automates, unit }) => {
19
19
  navigate(Routes.AddNewOneTap, { type: type, unit });
20
20
  break;
21
21
  case AUTOMATE_TYPE.VALUE_CHANGE:
22
- navigate(Routes.AddNewAutoSmart, { type: type });
22
+ navigate(Routes.AddNewAutoSmart, { type, unit, isScript });
23
23
  break;
24
24
  }
25
25
  };