@eohjsc/react-native-smart-city 0.3.54 → 0.3.56
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 +5 -4
- package/src/commons/ActionGroup/SliderRangeTemplate.js +1 -1
- package/src/commons/DevMode/Item.js +2 -4
- package/src/commons/DevMode/Styles/ItemStyles.js +6 -0
- package/src/screens/Smart/__test__/index.test.js +16 -4
- package/src/screens/Smart/index.js +15 -1
- package/src/screens/Smart/styles.js +15 -0
- package/src/utils/I18n/translations/en.json +2 -0
- package/src/utils/I18n/translations/vi.json +2 -0
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.3.
|
|
4
|
+
"version": "0.3.56",
|
|
5
5
|
"description": "TODO",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"files": [
|
|
@@ -64,9 +64,11 @@
|
|
|
64
64
|
"license": "MIT",
|
|
65
65
|
"licenseFilename": "LICENSE",
|
|
66
66
|
"peerDependencies": {
|
|
67
|
+
"@react-native-community/clipboard": "*",
|
|
68
|
+
"lottie-ios": "*",
|
|
69
|
+
"lottie-react-native": "*",
|
|
67
70
|
"react": "*",
|
|
68
|
-
"react-native": "*"
|
|
69
|
-
"@react-native-community/clipboard": "*"
|
|
71
|
+
"react-native": "*"
|
|
70
72
|
},
|
|
71
73
|
"devDependencies": {
|
|
72
74
|
"@babel/core": "^7.12.9",
|
|
@@ -136,7 +138,6 @@
|
|
|
136
138
|
"i18n-js": "^3.7.1",
|
|
137
139
|
"i18next": "^20.1.0",
|
|
138
140
|
"lodash": "^4.17.19",
|
|
139
|
-
"lottie-react-native": "^5.1.4",
|
|
140
141
|
"moment": "^2.27.0",
|
|
141
142
|
"moment-timezone": "^0.5.32",
|
|
142
143
|
"numeral": "^2.0.6",
|
|
@@ -71,7 +71,7 @@ const SliderRangeTemplate = memo(({ actionGroup = {}, doAction, sensor }) => {
|
|
|
71
71
|
<View style={styles.LeftBrightness}>
|
|
72
72
|
<SvgBrightness />
|
|
73
73
|
<Text type="H4" style={styles.LeftTextBrightness}>
|
|
74
|
-
{t('brightness')}
|
|
74
|
+
{actionGroup.title || t('brightness')}
|
|
75
75
|
</Text>
|
|
76
76
|
</View>
|
|
77
77
|
<View style={styles.RightBrightness}>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { TouchableOpacity } from 'react-native';
|
|
3
3
|
import Text from '../Text';
|
|
4
|
-
import t from '../../hooks/Common/useTranslations';
|
|
5
4
|
import styles from './Styles/ItemStyles';
|
|
5
|
+
import IconComponent from '../IconComponent';
|
|
6
6
|
|
|
7
7
|
const Item = ({ item, index, onPress }) => {
|
|
8
8
|
return (
|
|
@@ -10,10 +10,8 @@ const Item = ({ item, index, onPress }) => {
|
|
|
10
10
|
onPress={onPress}
|
|
11
11
|
style={[styles.item, index % 2 === 0 && styles.oddItem]}
|
|
12
12
|
>
|
|
13
|
+
<IconComponent iconKit={item?.icon} />
|
|
13
14
|
<Text style={styles.nameItem}>{item?.name}</Text>
|
|
14
|
-
<Text style={styles.countItem}>{`${
|
|
15
|
-
item?.count > 0 ? item?.count : t('no')
|
|
16
|
-
} ${t('gateways').toLowerCase()}`}</Text>
|
|
17
15
|
</TouchableOpacity>
|
|
18
16
|
);
|
|
19
17
|
};
|
|
@@ -18,6 +18,12 @@ export default StyleSheet.create({
|
|
|
18
18
|
nameItem: {
|
|
19
19
|
fontSize: 14,
|
|
20
20
|
fontWeight: 'bold',
|
|
21
|
+
padding: 8,
|
|
22
|
+
paddingBottom: 0,
|
|
23
|
+
borderTopWidth: 1,
|
|
24
|
+
width: '100%',
|
|
25
|
+
borderColor: Colors.Neutral.Neutral3,
|
|
26
|
+
textAlign: 'center',
|
|
21
27
|
},
|
|
22
28
|
countItem: {
|
|
23
29
|
fontSize: 12,
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
2
|
import { act, create } from 'react-test-renderer';
|
|
3
|
+
|
|
4
|
+
import { SCProvider } from '../../../context';
|
|
5
|
+
import { mockSCStore } from '../../../context/mockStore';
|
|
6
|
+
import { EmptyComponent } from '../../../commons/DevMode';
|
|
7
|
+
import t from '../../../hooks/Common/useTranslations';
|
|
8
|
+
|
|
4
9
|
import Smart from '..';
|
|
5
10
|
|
|
11
|
+
const wrapComponent = (route) => (
|
|
12
|
+
<SCProvider initState={mockSCStore({})}>
|
|
13
|
+
<Smart route={route} />
|
|
14
|
+
</SCProvider>
|
|
15
|
+
);
|
|
16
|
+
|
|
6
17
|
describe('Test Template screen', () => {
|
|
7
18
|
let tree;
|
|
8
19
|
it('Test render', async () => {
|
|
9
20
|
await act(async () => {
|
|
10
|
-
tree = await create(
|
|
21
|
+
tree = await create(wrapComponent());
|
|
11
22
|
});
|
|
12
23
|
const instance = tree.root;
|
|
13
|
-
const
|
|
14
|
-
expect(
|
|
24
|
+
const emptyComponent = instance.findByType(EmptyComponent);
|
|
25
|
+
expect(emptyComponent.props.text1).toEqual(t('text_under_development'));
|
|
26
|
+
expect(emptyComponent.props.text2).toEqual(t('text_working_hard'));
|
|
15
27
|
});
|
|
16
28
|
});
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
+
import { EmptyComponent } from '../../commons/DevMode';
|
|
4
|
+
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
5
|
+
|
|
6
|
+
import styles from './styles';
|
|
3
7
|
|
|
4
8
|
const Smart = () => {
|
|
5
|
-
|
|
9
|
+
const t = useTranslations();
|
|
10
|
+
return (
|
|
11
|
+
<View style={styles.wrap}>
|
|
12
|
+
<View style={styles.wrapEmpty}>
|
|
13
|
+
<EmptyComponent
|
|
14
|
+
text1={t('text_under_development')}
|
|
15
|
+
text2={t('text_working_hard')}
|
|
16
|
+
/>
|
|
17
|
+
</View>
|
|
18
|
+
</View>
|
|
19
|
+
);
|
|
6
20
|
};
|
|
7
21
|
|
|
8
22
|
export default Smart;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { Colors } from '../../configs';
|
|
3
|
+
|
|
4
|
+
export default StyleSheet.create({
|
|
5
|
+
wrap: {
|
|
6
|
+
flex: 1,
|
|
7
|
+
backgroundColor: Colors.White,
|
|
8
|
+
padding: 16,
|
|
9
|
+
},
|
|
10
|
+
wrapEmpty: {
|
|
11
|
+
justifyContent: 'center',
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
marginTop: 200,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
@@ -1097,6 +1097,8 @@
|
|
|
1097
1097
|
"continue_to_wait": "Continue to wait?",
|
|
1098
1098
|
"it_has_been_5_minutes": "It has been 5 minutes...",
|
|
1099
1099
|
"click_here_to_setup_device": "Click here to setup device",
|
|
1100
|
+
"text_under_development": "This feature is under development.",
|
|
1101
|
+
"text_working_hard": "We are working hard to get this running",
|
|
1100
1102
|
"photo_request_permission": "Photo request permission",
|
|
1101
1103
|
"photo_request_permission_des": "To select photo from gallery, please unlock access photo permission"
|
|
1102
1104
|
}
|
|
@@ -1096,6 +1096,8 @@
|
|
|
1096
1096
|
"continue_to_wait": "Bạn có muốn đợi tiếp?",
|
|
1097
1097
|
"it_has_been_5_minutes": "Đã 5 phút trôi qua...",
|
|
1098
1098
|
"click_here_to_setup_device": "Chọn thiết bị thêm vào phòng",
|
|
1099
|
+
"text_under_development": "Tính năng này đang được phát triển.",
|
|
1100
|
+
"text_working_hard": "Chúng tôi đang làm việc chăm chỉ để làm cho điều này hoạt động",
|
|
1099
1101
|
"photo_request_permission": "Quyền yêu cầu ảnh",
|
|
1100
1102
|
"photo_request_permission_des": "Để chọn ảnh từ thư viện, vui lòng mở khóa quyền truy cập ảnh"
|
|
1101
1103
|
}
|