@eohjsc/react-native-smart-city 0.3.28 → 0.3.31
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/Images/DevMode/close.png +0 -0
- package/src/Images/DevMode/close@2x.png +0 -0
- package/src/Images/DevMode/close@3x.png +0 -0
- package/src/Images/DevMode/plus.png +0 -0
- package/src/Images/DevMode/plus@2x.png +0 -0
- package/src/Images/DevMode/plus@3x.png +0 -0
- package/src/Images/DevMode/remove_circle.png +0 -0
- package/src/Images/DevMode/remove_circle@2x.png +0 -0
- package/src/Images/DevMode/remove_circle@3x.png +0 -0
- package/src/commons/Action/ItemQuickAction.js +1 -0
- package/src/commons/ActionGroup/ColorPickerTemplate.js +36 -17
- package/src/commons/ActionGroup/CurtainButtonTemplate.js +1 -2
- package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +13 -8
- package/src/commons/ActionGroup/OnOffSmartLock/OnOffSmartLock.js +37 -44
- package/src/commons/ActionGroup/OnOffSmartLock/OnOffSmartLockStyle.js +1 -0
- package/src/commons/ActionGroup/OnOffTemplate/OnOffButtonTemplate.js +7 -4
- package/src/commons/ActionGroup/OnOffTemplate/index.js +2 -2
- package/src/commons/ActionGroup/OneBigButtonTemplate.js +4 -4
- package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +28 -18
- package/src/commons/ActionGroup/SliderRangeTemplate.js +24 -16
- package/src/commons/ActionGroup/ThreeButtonTemplate.js +48 -58
- package/src/commons/ActionGroup/TwoButtonTemplate/index.js +134 -132
- package/src/commons/ActionGroup/__test__/index.test.js +2 -2
- package/src/commons/ActionGroup/index.js +35 -10
- package/src/commons/ActionTemplate/CurtainAction.js +60 -0
- package/src/commons/ActionTemplate/CurtainActionStyles.js +11 -0
- package/src/commons/ActionTemplate/OnOffSmartLockAction.js +44 -0
- package/src/commons/ActionTemplate/OnOffSmartLockActionStyles.js +11 -0
- package/src/commons/ActionTemplate/index.js +18 -0
- package/src/commons/BottomButtonView/index.js +1 -0
- package/src/commons/Button/index.js +2 -0
- package/src/commons/DevMode/CardDevMode.js +42 -0
- package/src/commons/DevMode/EmptyComponent.js +18 -0
- package/src/commons/DevMode/Item.js +21 -0
- package/src/commons/DevMode/Styles/CardStyles.js +40 -0
- package/src/commons/DevMode/Styles/EmptyComponentStyles.js +15 -0
- package/src/commons/DevMode/Styles/ItemStyles.js +27 -0
- package/src/commons/DevMode/Styles/TextWithLabelStyles.js +36 -0
- package/src/commons/DevMode/TextWithLabel.js +30 -0
- package/src/commons/DevMode/index.js +5 -1
- package/src/commons/Device/DeviceAlertStatus.js +1 -1
- package/src/commons/Device/Emergency/EmergencyDetail.js +1 -1
- package/src/commons/Device/ItemAddNew/index.js +5 -1
- package/src/commons/Device/ItemDevice.js +12 -9
- package/src/commons/Device/PMSensor/PMSensorIndicatior.js +1 -1
- package/src/commons/Device/RainningSensor/CurrentRainSensor.js +1 -1
- package/src/commons/Device/WindDirection/Compass/index.js +1 -1
- package/src/commons/Device/WindSpeed/Anemometer/index.js +1 -1
- package/src/commons/Header/HeaderCustom.js +8 -2
- package/src/commons/HeaderAni/index.js +1 -0
- package/src/commons/MenuActionMore/index.js +14 -2
- package/src/commons/NavBar/index.js +13 -1
- package/src/commons/Popover/index.js +7 -6
- package/src/commons/Sharing/WrapHeaderScrollable.js +4 -2
- package/src/commons/SubUnit/OneTap/ItemOneTap.js +4 -1
- package/src/commons/SubUnit/ShortDetail.js +1 -0
- package/src/commons/SummaryItem/index.js +2 -1
- package/src/commons/Unit/HeaderUnit/index.js +2 -0
- package/src/commons/Unit/SharedUnit.js +1 -0
- package/src/commons/WrapParallaxScrollView/index.js +16 -2
- package/src/configs/API.js +6 -0
- package/src/configs/Colors.js +4 -0
- package/src/configs/Constants.js +16 -0
- package/src/configs/Images.js +3 -0
- package/src/context/actionType.ts +12 -0
- package/src/context/mockStore.ts +12 -0
- package/src/context/reducer.ts +43 -1
- package/src/hooks/Common/useDevicesStatus.js +1 -1
- package/src/hooks/IoT/useValueEvaluation.js +10 -19
- package/src/iot/RemoteControl/GoogleHome.js +6 -6
- package/src/navigations/Main.js +26 -2
- package/src/navigations/UnitStack.js +5 -8
- package/src/screens/AddNewAction/Device/index.js +5 -1
- package/src/screens/AddNewAction/SelectAction.js +36 -15
- package/src/screens/AddNewAction/__test__/SelectAction.test.js +1 -0
- package/src/screens/AddNewAutoSmart/index.js +2 -0
- package/src/screens/AddNewGateway/PlugAndPlay/GatewayWifiList.js +13 -1
- package/src/screens/AddNewGateway/hooks/__Tests__/index.test.js +27 -0
- package/src/screens/Device/components/DetailHistoryChart.js +7 -5
- package/src/screens/Device/components/SensorConnectStatusViewHeader.js +10 -11
- package/src/screens/Device/components/SensorDisplayItem.js +49 -24
- package/src/screens/Device/detail.js +38 -17
- package/src/screens/Device/hooks/useFavoriteDevice.js +4 -2
- package/src/screens/Drawer/index.js +9 -4
- package/src/screens/EmergencyContacts/EmergencyContactsAddNew.js +3 -3
- package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +4 -7
- package/src/screens/Notification/__test__/NotificationItem.test.js +74 -104
- package/src/screens/Notification/components/NotificationItem.js +40 -239
- package/src/screens/ScriptDetail/__test__/index.test.js +40 -1
- package/src/screens/ScriptDetail/index.js +2 -1
- package/src/screens/Sharing/Components/SensorItem.js +4 -1
- package/src/screens/Sharing/Components/Styles/SensorItemStyles.js +4 -0
- package/src/screens/Sharing/Components/Styles/TitleCheckBoxStyles.js +4 -0
- package/src/screens/Sharing/Components/TitleCheckBox.js +17 -8
- package/src/screens/Template/EditTemplate.js +151 -0
- package/src/screens/Template/GatewayList.js +51 -0
- package/src/screens/Template/Information.js +41 -0
- package/src/screens/Template/Styles/EditTemplateStyle.js +109 -0
- package/src/screens/Template/Styles/GatewayStyles.js +46 -0
- package/src/screens/Template/Styles/InformationStyles.js +16 -0
- package/src/screens/Template/Styles/detailStyles.js +35 -0
- package/src/screens/Template/Styles/indexStyles.js +2 -33
- package/src/screens/Template/__test__/EditTemplate.test.js +89 -0
- package/src/screens/Template/__test__/GatewayList.test.js +26 -0
- package/src/screens/Template/__test__/Information.test.js +16 -0
- package/src/screens/Template/__test__/detail.test.js +60 -0
- package/src/screens/Template/__test__/index.test.js +26 -1
- package/src/screens/Template/detail.js +154 -0
- package/src/screens/Template/index.js +39 -32
- package/src/screens/Unit/Detail.js +11 -1
- package/src/screens/Unit/MoreMenu.js +16 -1
- package/src/screens/Unit/SelectAddToFavorites.js +11 -1
- package/src/screens/Unit/SmartAccount.js +1 -1
- package/src/screens/Unit/Station/__test__/index.test.js +18 -2
- package/src/screens/Unit/Station/index.js +0 -1
- package/src/screens/Unit/Summaries.js +6 -1
- package/src/screens/Unit/__test__/Detail.test.js +73 -43
- package/src/screens/Unit/__test__/SmartAccount.test.js +42 -25
- package/src/screens/Unit/components/AutomateScript/index.js +5 -2
- package/src/utils/I18n/translations/en.json +37 -42
- package/src/utils/I18n/translations/vi.json +35 -44
- package/src/utils/Route/index.js +6 -0
|
@@ -168,7 +168,7 @@ describe('Test ScriptDetail', () => {
|
|
|
168
168
|
});
|
|
169
169
|
const instance = tree.root;
|
|
170
170
|
const buttonStar = instance.find(
|
|
171
|
-
(el) => el.props.testID === TESTID.
|
|
171
|
+
(el) => el.props.testID === TESTID.HEADER_SCRIPT_DETAIL_BUTTON_STAR
|
|
172
172
|
);
|
|
173
173
|
mock.onPost(API.AUTOMATE.STAR_SCRIPT(1)).reply(200);
|
|
174
174
|
await act(async () => {
|
|
@@ -355,4 +355,43 @@ describe('Test ScriptDetail', () => {
|
|
|
355
355
|
'Light Value lower than 3'
|
|
356
356
|
);
|
|
357
357
|
});
|
|
358
|
+
|
|
359
|
+
test('Test render textCondition schedule repeat everyday', async () => {
|
|
360
|
+
route.params = {
|
|
361
|
+
...route.params,
|
|
362
|
+
type: AUTOMATE_TYPE.SCHEDULE,
|
|
363
|
+
automate: {
|
|
364
|
+
repeat: 'every_day',
|
|
365
|
+
date_repeat: '2022-01-02',
|
|
366
|
+
time_repeat: '19:00:00',
|
|
367
|
+
},
|
|
368
|
+
};
|
|
369
|
+
await act(() => {
|
|
370
|
+
tree = create(wrapComponent(route));
|
|
371
|
+
});
|
|
372
|
+
const instance = tree.root;
|
|
373
|
+
const itemAutomate = instance.findByType(ItemAutomate);
|
|
374
|
+
expect(itemAutomate.props.textCondition).toEqual('Every day at 19:00');
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
test('Test render textCondition schedule repeat weekday', async () => {
|
|
378
|
+
route.params = {
|
|
379
|
+
...route.params,
|
|
380
|
+
type: AUTOMATE_TYPE.SCHEDULE,
|
|
381
|
+
automate: {
|
|
382
|
+
repeat: 'every_week',
|
|
383
|
+
date_repeat: '2022-01-02',
|
|
384
|
+
time_repeat: '19:00:00',
|
|
385
|
+
weekday_repeat: ['1', '2', '4', '6'],
|
|
386
|
+
},
|
|
387
|
+
};
|
|
388
|
+
await act(() => {
|
|
389
|
+
tree = create(wrapComponent(route));
|
|
390
|
+
});
|
|
391
|
+
const instance = tree.root;
|
|
392
|
+
const itemAutomate = instance.findByType(ItemAutomate);
|
|
393
|
+
expect(itemAutomate.props.textCondition).toEqual(
|
|
394
|
+
'Mon, Tue, Thu, Sat at 19:00'
|
|
395
|
+
);
|
|
396
|
+
});
|
|
358
397
|
});
|
|
@@ -321,7 +321,8 @@ const ScriptDetail = ({ route }) => {
|
|
|
321
321
|
<PreventDoubleTouch
|
|
322
322
|
style={[styles.buttonStar, styles.headerButton]}
|
|
323
323
|
onPress={onPressStar}
|
|
324
|
-
testID={TESTID.
|
|
324
|
+
testID={TESTID.HEADER_SCRIPT_DETAIL_BUTTON_STAR}
|
|
325
|
+
accessibilityLabel={TESTID.HEADER_SCRIPT_DETAIL_BUTTON_STAR}
|
|
325
326
|
>
|
|
326
327
|
{isStarred ? (
|
|
327
328
|
<IconFill name="star" size={25} color={Colors.Yellow6} />
|
|
@@ -27,7 +27,7 @@ const SensorItem = ({
|
|
|
27
27
|
isChecked,
|
|
28
28
|
} = item;
|
|
29
29
|
const [dataConfig, setDataConfig] = useState([
|
|
30
|
-
...actions,
|
|
30
|
+
...actions.map((i) => ({ ...i, isControl: true })),
|
|
31
31
|
...read_configs.map((i) => ({ ...i, isConfig: true })),
|
|
32
32
|
]);
|
|
33
33
|
|
|
@@ -84,6 +84,9 @@ const SensorItem = ({
|
|
|
84
84
|
titleStyle={styles.titleStyle}
|
|
85
85
|
key={i.id}
|
|
86
86
|
idGroup={idGroup}
|
|
87
|
+
isConfig={i.isConfig}
|
|
88
|
+
isControl={i.isControl}
|
|
89
|
+
wrapStyle={styles.wrapStyleTitle}
|
|
87
90
|
/>
|
|
88
91
|
));
|
|
89
92
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -49,6 +49,7 @@ export default StyleSheet.create({
|
|
|
49
49
|
titleStyle: {
|
|
50
50
|
fontSize: 16,
|
|
51
51
|
fontWeight: 'normal',
|
|
52
|
+
width: 200,
|
|
52
53
|
},
|
|
53
54
|
wrapExpand: {
|
|
54
55
|
marginTop: 10,
|
|
@@ -57,4 +58,7 @@ export default StyleSheet.create({
|
|
|
57
58
|
width: normalize(20),
|
|
58
59
|
height: normalize(20),
|
|
59
60
|
},
|
|
61
|
+
wrapStyleTitle: {
|
|
62
|
+
justifyContent: 'space-between',
|
|
63
|
+
},
|
|
60
64
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { memo, useEffect, useState } from 'react';
|
|
2
2
|
import { View, Text } from 'react-native';
|
|
3
3
|
import { CheckBoxCustom } from '.';
|
|
4
|
+
import t from '../../../hooks/Common/useTranslations';
|
|
4
5
|
import styles from './Styles/TitleCheckBoxStyles';
|
|
5
6
|
|
|
6
7
|
const TitleCheckBox = ({
|
|
@@ -12,6 +13,8 @@ const TitleCheckBox = ({
|
|
|
12
13
|
wrapStyle,
|
|
13
14
|
titleStyle,
|
|
14
15
|
idGroup,
|
|
16
|
+
isConfig,
|
|
17
|
+
isControl,
|
|
15
18
|
}) => {
|
|
16
19
|
const [checked, setChecked] = useState(isChecked);
|
|
17
20
|
const handleOnPress = () => {
|
|
@@ -26,14 +29,20 @@ const TitleCheckBox = ({
|
|
|
26
29
|
|
|
27
30
|
return (
|
|
28
31
|
<View style={[styles.wrap, wrapStyle]}>
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{title}
|
|
36
|
-
|
|
32
|
+
<View style={styles.wrapRow}>
|
|
33
|
+
<CheckBoxCustom
|
|
34
|
+
isChecked={checked}
|
|
35
|
+
onPress={handleOnPress}
|
|
36
|
+
wrapStyle={wrapCheckBoxStyle}
|
|
37
|
+
/>
|
|
38
|
+
<Text onPress={handleOnPress} style={[styles.title, titleStyle]}>
|
|
39
|
+
{title}
|
|
40
|
+
</Text>
|
|
41
|
+
</View>
|
|
42
|
+
<View>
|
|
43
|
+
{isControl && <Text>{t('can_control')}</Text>}
|
|
44
|
+
{isConfig && <Text>{t('view_only')}</Text>}
|
|
45
|
+
</View>
|
|
37
46
|
</View>
|
|
38
47
|
);
|
|
39
48
|
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { useNavigation, useRoute } from '@react-navigation/native';
|
|
2
|
+
import React, {
|
|
3
|
+
useCallback,
|
|
4
|
+
useContext,
|
|
5
|
+
useEffect,
|
|
6
|
+
useMemo,
|
|
7
|
+
useState,
|
|
8
|
+
} from 'react';
|
|
9
|
+
import { Image, TouchableOpacity, View } from 'react-native';
|
|
10
|
+
import DraggableFlatList from 'react-native-draggable-flatlist';
|
|
11
|
+
|
|
12
|
+
import { EmptyComponent } from '../../commons/DevMode';
|
|
13
|
+
import { HeaderCustom } from '../../commons/Header';
|
|
14
|
+
import Text from '../../commons/Text';
|
|
15
|
+
import { Images } from '../../configs';
|
|
16
|
+
import { SCContext } from '../../context';
|
|
17
|
+
import { Action } from '../../context/actionType';
|
|
18
|
+
import t from '../../hooks/Common/useTranslations';
|
|
19
|
+
import { SensorDisplayItem } from '../Device/components/SensorDisplayItem';
|
|
20
|
+
import styles from './Styles/EditTemplateStyle';
|
|
21
|
+
|
|
22
|
+
const EditTemplate = () => {
|
|
23
|
+
const { setAction } = useContext(SCContext);
|
|
24
|
+
const { params = {} } = useRoute();
|
|
25
|
+
const { data = [], setData } = params;
|
|
26
|
+
const { goBack } = useNavigation();
|
|
27
|
+
const [actionsList, setActionList] = useState(
|
|
28
|
+
[...data].map((item) => {
|
|
29
|
+
return {
|
|
30
|
+
...item,
|
|
31
|
+
key: `item-${item?.id}`,
|
|
32
|
+
};
|
|
33
|
+
})
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const AddWidget = useCallback(() => {
|
|
37
|
+
return (
|
|
38
|
+
<TouchableOpacity style={styles.addWidgetButton}>
|
|
39
|
+
<View style={styles.wrapIconAdd}>
|
|
40
|
+
<Image source={Images.plus} />
|
|
41
|
+
</View>
|
|
42
|
+
<Text style={styles.addWidget}>{t('add_widget')}</Text>
|
|
43
|
+
</TouchableOpacity>
|
|
44
|
+
);
|
|
45
|
+
}, []);
|
|
46
|
+
|
|
47
|
+
const onDrag = useCallback(
|
|
48
|
+
(item, drag) => () => {
|
|
49
|
+
drag && drag();
|
|
50
|
+
setAction(Action.SET_WIDGET_DRAGGING, item?.id);
|
|
51
|
+
},
|
|
52
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
53
|
+
[]
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const onDragEnd = useCallback(({ data: dragData }) => {
|
|
57
|
+
setActionList(dragData);
|
|
58
|
+
setAction(Action.SET_WIDGET_DRAGGING);
|
|
59
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
60
|
+
}, []);
|
|
61
|
+
|
|
62
|
+
const onPressSave = useCallback(() => {
|
|
63
|
+
setData && setData(actionsList);
|
|
64
|
+
goBack();
|
|
65
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
66
|
+
}, [actionsList]);
|
|
67
|
+
|
|
68
|
+
const onDelete = useCallback(() => {
|
|
69
|
+
alert(t('feature_under_development'));
|
|
70
|
+
}, []);
|
|
71
|
+
|
|
72
|
+
const renderEmpty = useMemo(() => {
|
|
73
|
+
return (
|
|
74
|
+
<View style={styles.empty}>
|
|
75
|
+
<EmptyComponent text1={t('no_widgets')} text2={t('add_your_widget')} />
|
|
76
|
+
<AddWidget />
|
|
77
|
+
</View>
|
|
78
|
+
);
|
|
79
|
+
}, []);
|
|
80
|
+
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
setAction(Action.SET_IS_IN_EDIT_TEMPLATE_SCREEN, true);
|
|
83
|
+
return () => setAction(Action.SET_IS_IN_EDIT_TEMPLATE_SCREEN);
|
|
84
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
85
|
+
}, []);
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<View style={styles.wrap}>
|
|
89
|
+
<HeaderCustom
|
|
90
|
+
title={t('edit_template')}
|
|
91
|
+
wrapTitleStyle={styles.wrapTitleStyle}
|
|
92
|
+
iconLeft={Images.close}
|
|
93
|
+
iconBackStyle={styles.iconBackStyle}
|
|
94
|
+
titleStyles={styles.titleStyles}
|
|
95
|
+
/>
|
|
96
|
+
{!actionsList?.length ? (
|
|
97
|
+
renderEmpty
|
|
98
|
+
) : (
|
|
99
|
+
<>
|
|
100
|
+
<View style={styles.wrapDescription}>
|
|
101
|
+
<Text style={styles.description}>
|
|
102
|
+
{t('hold_and_hover_description')}
|
|
103
|
+
</Text>
|
|
104
|
+
</View>
|
|
105
|
+
<DraggableFlatList
|
|
106
|
+
showsVerticalScrollIndicator={false}
|
|
107
|
+
data={actionsList}
|
|
108
|
+
renderItem={({ item, index, drag }) => {
|
|
109
|
+
return (
|
|
110
|
+
<TouchableOpacity onLongPress={onDrag(item, drag)}>
|
|
111
|
+
<SensorDisplayItem
|
|
112
|
+
item={item}
|
|
113
|
+
getData={() => {}}
|
|
114
|
+
offsetTitle={'offsetTitle'}
|
|
115
|
+
setOffsetTitle={'setOffsetTitle'}
|
|
116
|
+
maxValue={100}
|
|
117
|
+
/>
|
|
118
|
+
<TouchableOpacity
|
|
119
|
+
style={styles.deleteButton}
|
|
120
|
+
onPress={onDelete}
|
|
121
|
+
>
|
|
122
|
+
<Image
|
|
123
|
+
source={Images.removeCircle}
|
|
124
|
+
style={styles.deleteIcon}
|
|
125
|
+
/>
|
|
126
|
+
</TouchableOpacity>
|
|
127
|
+
</TouchableOpacity>
|
|
128
|
+
);
|
|
129
|
+
}}
|
|
130
|
+
keyExtractor={(item) => `draggable-item-${item.key}`}
|
|
131
|
+
onDragEnd={onDragEnd}
|
|
132
|
+
extraData={actionsList}
|
|
133
|
+
containerStyle={styles.containerStyle}
|
|
134
|
+
ListFooterComponent={
|
|
135
|
+
<View style={styles.wrapListFooterComponent}>
|
|
136
|
+
<AddWidget />
|
|
137
|
+
</View>
|
|
138
|
+
}
|
|
139
|
+
/>
|
|
140
|
+
<View style={styles.wrapBottom}>
|
|
141
|
+
<TouchableOpacity style={styles.saveButton} onPress={onPressSave}>
|
|
142
|
+
<Text style={styles.save}>{t('save')}</Text>
|
|
143
|
+
</TouchableOpacity>
|
|
144
|
+
</View>
|
|
145
|
+
</>
|
|
146
|
+
)}
|
|
147
|
+
</View>
|
|
148
|
+
);
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export default EditTemplate;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useNavigation } from '@react-navigation/native';
|
|
2
|
+
import React, { useCallback, useState } from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { Search } from '../../commons/DevMode';
|
|
5
|
+
import WrapHeaderScrollable from '../../commons/Sharing/WrapHeaderScrollable';
|
|
6
|
+
import Text from '../../commons/Text';
|
|
7
|
+
import t from '../../hooks/Common/useTranslations';
|
|
8
|
+
import styles from './Styles/GatewayStyles';
|
|
9
|
+
|
|
10
|
+
const GatewayList = () => {
|
|
11
|
+
const { goBack } = useNavigation();
|
|
12
|
+
const [data] = useState([
|
|
13
|
+
{
|
|
14
|
+
id: 1,
|
|
15
|
+
name: 'Gateway name',
|
|
16
|
+
templateName: 'Template name',
|
|
17
|
+
status: 'ACTIVE',
|
|
18
|
+
},
|
|
19
|
+
]);
|
|
20
|
+
|
|
21
|
+
const GatewayItem = useCallback(({ item }) => {
|
|
22
|
+
return (
|
|
23
|
+
<View style={styles.wrapItem}>
|
|
24
|
+
<Text style={styles.gateWayName}>{item?.name}</Text>
|
|
25
|
+
<View>
|
|
26
|
+
<Text style={styles.templateName}>{item?.templateName}</Text>
|
|
27
|
+
<View style={styles.wrapStatus}>
|
|
28
|
+
<Text style={styles.status}>{item?.status}</Text>
|
|
29
|
+
</View>
|
|
30
|
+
</View>
|
|
31
|
+
</View>
|
|
32
|
+
);
|
|
33
|
+
}, []);
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<View style={styles.wrap}>
|
|
37
|
+
<WrapHeaderScrollable
|
|
38
|
+
title={t('gateway_list')}
|
|
39
|
+
headerAniStyle={styles.headerAniStyle}
|
|
40
|
+
onGoBack={goBack}
|
|
41
|
+
>
|
|
42
|
+
<View style={styles.wrapContent}>
|
|
43
|
+
<Search />
|
|
44
|
+
{!!data.length && data.map((item) => <GatewayItem item={item} />)}
|
|
45
|
+
</View>
|
|
46
|
+
</WrapHeaderScrollable>
|
|
47
|
+
</View>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default GatewayList;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import TextWithLabel from '../../commons/DevMode/TextWithLabel';
|
|
5
|
+
import WrapHeaderScrollable from '../../commons/Sharing/WrapHeaderScrollable';
|
|
6
|
+
import t from '../../hooks/Common/useTranslations';
|
|
7
|
+
import styles from './Styles/InformationStyles';
|
|
8
|
+
|
|
9
|
+
const Information = () => {
|
|
10
|
+
return (
|
|
11
|
+
<View style={styles.wrap}>
|
|
12
|
+
<WrapHeaderScrollable
|
|
13
|
+
title={t('information')}
|
|
14
|
+
headerAniStyle={styles.headerAniStyle}
|
|
15
|
+
>
|
|
16
|
+
<View style={styles.content}>
|
|
17
|
+
<TextWithLabel
|
|
18
|
+
label={t('template_name')}
|
|
19
|
+
text={'Template name'}
|
|
20
|
+
isBox
|
|
21
|
+
/>
|
|
22
|
+
<TextWithLabel
|
|
23
|
+
label={t('template_name')}
|
|
24
|
+
text={'TMPLTvKiNsKR'}
|
|
25
|
+
isDisable
|
|
26
|
+
isBox
|
|
27
|
+
/>
|
|
28
|
+
<TextWithLabel
|
|
29
|
+
label={t('template_name')}
|
|
30
|
+
text={
|
|
31
|
+
// eslint-disable-next-line max-len
|
|
32
|
+
'Direct repair of aneurysm, pseudoaneurysm, or excision (partial or total) and graft insertion, with or without patch graft; for aneurysm, pseudoaneurysm, and associated occlusive disease, abdominal aorta involving visceral vessels (mesenteric, celiac, renal)'
|
|
33
|
+
}
|
|
34
|
+
/>
|
|
35
|
+
</View>
|
|
36
|
+
</WrapHeaderScrollable>
|
|
37
|
+
</View>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default Information;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { getBottomSpace } from 'react-native-iphone-x-helper';
|
|
3
|
+
import { Colors } from '../../../configs';
|
|
4
|
+
|
|
5
|
+
export default StyleSheet.create({
|
|
6
|
+
wrap: {
|
|
7
|
+
flex: 1,
|
|
8
|
+
backgroundColor: Colors.White,
|
|
9
|
+
},
|
|
10
|
+
wrapTitleStyle: {
|
|
11
|
+
alignItems: 'flex-start',
|
|
12
|
+
paddingHorizontal: 16,
|
|
13
|
+
},
|
|
14
|
+
iconBackStyle: {
|
|
15
|
+
width: 22,
|
|
16
|
+
height: 22,
|
|
17
|
+
},
|
|
18
|
+
titleStyles: {
|
|
19
|
+
fontSize: 20,
|
|
20
|
+
},
|
|
21
|
+
empty: {
|
|
22
|
+
justifyContent: 'center',
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
paddingHorizontal: 16,
|
|
25
|
+
marginTop: 159,
|
|
26
|
+
},
|
|
27
|
+
addWidgetButton: {
|
|
28
|
+
borderWidth: 2,
|
|
29
|
+
borderStyle: 'dashed',
|
|
30
|
+
borderColor: Colors.Gray4,
|
|
31
|
+
flexDirection: 'row',
|
|
32
|
+
width: '100%',
|
|
33
|
+
marginTop: 24,
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
padding: 16,
|
|
36
|
+
borderRadius: 8,
|
|
37
|
+
},
|
|
38
|
+
wrapIconAdd: {
|
|
39
|
+
width: 32,
|
|
40
|
+
height: 32,
|
|
41
|
+
borderRadius: 16,
|
|
42
|
+
backgroundColor: Colors.Gray3,
|
|
43
|
+
justifyContent: 'center',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
},
|
|
46
|
+
addWidget: {
|
|
47
|
+
fontSize: 16,
|
|
48
|
+
fontWeight: '400',
|
|
49
|
+
color: Colors.Gray8,
|
|
50
|
+
marginLeft: 24,
|
|
51
|
+
},
|
|
52
|
+
content: {
|
|
53
|
+
flex: 1,
|
|
54
|
+
marginBottom: 120,
|
|
55
|
+
},
|
|
56
|
+
wrapBottom: {
|
|
57
|
+
position: 'absolute',
|
|
58
|
+
bottom: 0,
|
|
59
|
+
left: 0,
|
|
60
|
+
right: 0,
|
|
61
|
+
alignItems: 'center',
|
|
62
|
+
paddingBottom: getBottomSpace(),
|
|
63
|
+
backgroundColor: Colors.White,
|
|
64
|
+
paddingHorizontal: 16,
|
|
65
|
+
paddingTop: 16,
|
|
66
|
+
},
|
|
67
|
+
saveButton: {
|
|
68
|
+
height: 56,
|
|
69
|
+
borderRadius: 8,
|
|
70
|
+
backgroundColor: Colors.Primary,
|
|
71
|
+
width: '100%',
|
|
72
|
+
justifyContent: 'center',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
},
|
|
75
|
+
save: {
|
|
76
|
+
fontSize: 16,
|
|
77
|
+
fontWeight: 'bold',
|
|
78
|
+
color: Colors.White,
|
|
79
|
+
},
|
|
80
|
+
containerStyle: {
|
|
81
|
+
paddingBottom: 130,
|
|
82
|
+
},
|
|
83
|
+
wrapListFooterComponent: {
|
|
84
|
+
paddingHorizontal: 16,
|
|
85
|
+
},
|
|
86
|
+
wrapDescription: {
|
|
87
|
+
paddingHorizontal: 16,
|
|
88
|
+
marginTop: 10,
|
|
89
|
+
marginBottom: 10,
|
|
90
|
+
},
|
|
91
|
+
description: {
|
|
92
|
+
fontSize: 16,
|
|
93
|
+
fontWeight: '400',
|
|
94
|
+
color: Colors.Gray8,
|
|
95
|
+
},
|
|
96
|
+
deleteButton: {
|
|
97
|
+
position: 'absolute',
|
|
98
|
+
zIndex: 2,
|
|
99
|
+
top: -5,
|
|
100
|
+
right: 0,
|
|
101
|
+
width: 40,
|
|
102
|
+
height: 40,
|
|
103
|
+
justifyContent: 'center',
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
},
|
|
106
|
+
deleteIcon: {
|
|
107
|
+
tintColor: Colors.Red,
|
|
108
|
+
},
|
|
109
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
},
|
|
9
|
+
headerAniStyle: {
|
|
10
|
+
borderBottomWidth: 0,
|
|
11
|
+
},
|
|
12
|
+
wrapContent: {
|
|
13
|
+
paddingHorizontal: 16,
|
|
14
|
+
},
|
|
15
|
+
wrapItem: {
|
|
16
|
+
borderRadius: 8,
|
|
17
|
+
borderWidth: 1,
|
|
18
|
+
borderColor: Colors.Neutral.Neutral3,
|
|
19
|
+
height: 128,
|
|
20
|
+
paddingHorizontal: 16,
|
|
21
|
+
justifyContent: 'space-around',
|
|
22
|
+
},
|
|
23
|
+
gateWayName: {
|
|
24
|
+
fontSize: 14,
|
|
25
|
+
fontWeight: 'bold',
|
|
26
|
+
},
|
|
27
|
+
templateName: {
|
|
28
|
+
fontSize: 12,
|
|
29
|
+
fontWeight: '400',
|
|
30
|
+
color: Colors.Gray9,
|
|
31
|
+
},
|
|
32
|
+
status: {
|
|
33
|
+
fontSize: 12,
|
|
34
|
+
fontWeight: '600',
|
|
35
|
+
color: Colors.Salem,
|
|
36
|
+
},
|
|
37
|
+
wrapStatus: {
|
|
38
|
+
borderRadius: 54,
|
|
39
|
+
backgroundColor: Colors.LightGreen,
|
|
40
|
+
width: 63,
|
|
41
|
+
height: 24,
|
|
42
|
+
justifyContent: 'center',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
marginTop: 10,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
},
|
|
9
|
+
content: {
|
|
10
|
+
paddingHorizontal: 16,
|
|
11
|
+
marginVertical: 16,
|
|
12
|
+
},
|
|
13
|
+
headerAniStyle: {
|
|
14
|
+
borderBottomWidth: 0,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Platform, StyleSheet } from 'react-native';
|
|
2
|
+
import { Colors, Constants } from '../../../configs';
|
|
3
|
+
|
|
4
|
+
export default StyleSheet.create({
|
|
5
|
+
wrap: {
|
|
6
|
+
flex: 1,
|
|
7
|
+
backgroundColor: Colors.White,
|
|
8
|
+
},
|
|
9
|
+
headerAniStyle: {
|
|
10
|
+
borderBottomWidth: 0,
|
|
11
|
+
},
|
|
12
|
+
rightComponent: {
|
|
13
|
+
flexDirection: 'row',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
},
|
|
16
|
+
headerButton: {
|
|
17
|
+
marginRight: 10,
|
|
18
|
+
},
|
|
19
|
+
wrapEmpty: {
|
|
20
|
+
justifyContent: 'center',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
height: Constants.height - 250,
|
|
23
|
+
},
|
|
24
|
+
wrapStyle: {
|
|
25
|
+
borderRadius: 8,
|
|
26
|
+
borderBottomRightRadius: 8,
|
|
27
|
+
borderBottomLeftRadius: 8,
|
|
28
|
+
width: 160,
|
|
29
|
+
marginTop: Platform.select({
|
|
30
|
+
android: -25,
|
|
31
|
+
ios: 0,
|
|
32
|
+
}),
|
|
33
|
+
marginLeft: -10,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
-
import { Colors
|
|
2
|
+
import { Colors } from '../../../configs';
|
|
3
3
|
|
|
4
4
|
export default StyleSheet.create({
|
|
5
5
|
wrap: {
|
|
@@ -13,39 +13,8 @@ export default StyleSheet.create({
|
|
|
13
13
|
alignItems: 'center',
|
|
14
14
|
marginTop: -100,
|
|
15
15
|
},
|
|
16
|
-
|
|
17
|
-
fontSize: 20,
|
|
18
|
-
fontWeight: 'bold',
|
|
19
|
-
},
|
|
20
|
-
textEmpty2: {
|
|
21
|
-
fontSize: 14,
|
|
22
|
-
fontWeight: '400',
|
|
23
|
-
color: Colors.Neutral.Neutral5,
|
|
24
|
-
marginTop: 7,
|
|
25
|
-
},
|
|
16
|
+
|
|
26
17
|
contentContainerStyle: {
|
|
27
18
|
flex: 1,
|
|
28
19
|
},
|
|
29
|
-
item: {
|
|
30
|
-
width: (Constants.width - 42) / 2,
|
|
31
|
-
height: 128,
|
|
32
|
-
borderRadius: 8,
|
|
33
|
-
borderWidth: 1,
|
|
34
|
-
borderColor: Colors.Neutral.Neutral3,
|
|
35
|
-
marginBottom: 16,
|
|
36
|
-
justifyContent: 'space-around',
|
|
37
|
-
alignItems: 'center',
|
|
38
|
-
},
|
|
39
|
-
oddItem: {
|
|
40
|
-
marginRight: 10,
|
|
41
|
-
},
|
|
42
|
-
nameItem: {
|
|
43
|
-
fontSize: 14,
|
|
44
|
-
fontWeight: 'bold',
|
|
45
|
-
},
|
|
46
|
-
countItem: {
|
|
47
|
-
fontSize: 12,
|
|
48
|
-
fontWeight: 400,
|
|
49
|
-
color: Colors.Neutral.Neutral5,
|
|
50
|
-
},
|
|
51
20
|
});
|