@ledvance/base 1.2.19 → 1.2.21
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/components/SocketItem.tsx +88 -0
- package/src/i18n/strings.ts +4 -4
package/package.json
CHANGED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
|
2
|
+
import { View, Image, StyleSheet, Text, TouchableOpacity, ViewProps } from "react-native";
|
|
3
|
+
import Card from "@ledvance/base/src/components/Card";
|
|
4
|
+
import Spacer from "@ledvance/base/src/components/Spacer";
|
|
5
|
+
import { Dialog, SwitchButton, Utils } from "tuya-panel-kit";
|
|
6
|
+
import I18n from "@ledvance/base/src/i18n";
|
|
7
|
+
|
|
8
|
+
const cx = Utils.RatioUtils.convertX
|
|
9
|
+
|
|
10
|
+
interface SocketItemProps extends PropsWithChildren<ViewProps>{
|
|
11
|
+
title: string
|
|
12
|
+
name: string
|
|
13
|
+
icon: any
|
|
14
|
+
disabledEdit?: boolean
|
|
15
|
+
onNameChange: (value: string) => void
|
|
16
|
+
enabled: boolean
|
|
17
|
+
onSwitchChange: (value: boolean) => void
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function SocketItem(props: SocketItemProps) {
|
|
21
|
+
return (
|
|
22
|
+
<Card style={{ marginHorizontal: cx(24) }}>
|
|
23
|
+
<View>
|
|
24
|
+
<Spacer />
|
|
25
|
+
<View style={styles.switchLine}>
|
|
26
|
+
<Text style={styles.title}>{props.title}</Text>
|
|
27
|
+
<Spacer height={0} width={cx(12)} />
|
|
28
|
+
<Image style={styles.icon} source={props.icon} />
|
|
29
|
+
<Spacer style={{ flex: 1 }} />
|
|
30
|
+
<SwitchButton
|
|
31
|
+
value={props.enabled}
|
|
32
|
+
onValueChange={props.onSwitchChange} />
|
|
33
|
+
</View>
|
|
34
|
+
<TouchableOpacity
|
|
35
|
+
style={styles.nameLine}
|
|
36
|
+
onPress={() => {
|
|
37
|
+
if(props.disabledEdit) return
|
|
38
|
+
Dialog.prompt({
|
|
39
|
+
title: I18n.getLang('routines_add_edit_name'),
|
|
40
|
+
value: props.name,
|
|
41
|
+
cancelText: I18n.getLang('auto_scan_system_cancel'),
|
|
42
|
+
confirmText: I18n.getLang('auto_scan_system_wifi_confirm'),
|
|
43
|
+
onChangeText: text => {
|
|
44
|
+
return text.length <= 32 ? text : text.slice(0, 32)
|
|
45
|
+
},
|
|
46
|
+
onConfirm: (text, { close }) => {
|
|
47
|
+
props.onNameChange(text)
|
|
48
|
+
close()
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
|
+
}}>
|
|
52
|
+
<Text style={styles.name}>{props.name}</Text>
|
|
53
|
+
</TouchableOpacity>
|
|
54
|
+
<Spacer height={cx(16)} />
|
|
55
|
+
{props.children}
|
|
56
|
+
</View>
|
|
57
|
+
</Card>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const styles = StyleSheet.create({
|
|
62
|
+
switchLine: {
|
|
63
|
+
flexDirection: 'row',
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
marginHorizontal: cx(16),
|
|
66
|
+
},
|
|
67
|
+
title: {
|
|
68
|
+
fontSize: cx(16),
|
|
69
|
+
color: '#000',
|
|
70
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
71
|
+
fontWeight: 'bold',
|
|
72
|
+
},
|
|
73
|
+
icon: {
|
|
74
|
+
width: cx(60),
|
|
75
|
+
height: cx(20),
|
|
76
|
+
},
|
|
77
|
+
nameLine: {
|
|
78
|
+
flex: 1,
|
|
79
|
+
marginHorizontal: cx(16),
|
|
80
|
+
},
|
|
81
|
+
name: {
|
|
82
|
+
fontSize: cx(14),
|
|
83
|
+
color: '#000',
|
|
84
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
export default SocketItem
|
package/src/i18n/strings.ts
CHANGED
|
@@ -2842,7 +2842,7 @@ export default {
|
|
|
2842
2842
|
mood_overview_information_text: "De statiske scener gemmes lokalt på din smartphone. Derfor kan de ikke deles med andre brugere.",
|
|
2843
2843
|
motion_detection_add_time_schedule_headline_text: "Tilføj en ny tidsplan",
|
|
2844
2844
|
motion_detection_add_time_schedule_selectionfield_text: "Navn",
|
|
2845
|
-
motion_detection_add_time_schedule_system_back_text: "
|
|
2845
|
+
motion_detection_add_time_schedule_system_back_text: "Opstart",
|
|
2846
2846
|
motion_detection_time_schedule_notifications_field_weekdays_text2: "Kun en gang (i dag)",
|
|
2847
2847
|
timeschedule_add_schedule_text: "Hver {0}",
|
|
2848
2848
|
motion_detection_time_schedule_notifications_field_weekdays_text4: "Hver dag",
|
|
@@ -2860,7 +2860,7 @@ export default {
|
|
|
2860
2860
|
timeschedule_add_schedule_subheadline_text: "GÆLDER FOR",
|
|
2861
2861
|
timeschedule_add_schedule_switch_tab_manual_text: "Manuelle indstillinger",
|
|
2862
2862
|
timeschedule_add_schedule_switch_tab_mood_text: "Scene",
|
|
2863
|
-
timeschedule_add_schedule_system_back_text: "
|
|
2863
|
+
timeschedule_add_schedule_system_back_text: "Opstart",
|
|
2864
2864
|
timeschedule_add_schedule_text2: "Notifikationer",
|
|
2865
2865
|
timeschedule_add_schedule_weekday1_text: "Man.",
|
|
2866
2866
|
timeschedule_add_schedule_weekday2_text: "Tirs.",
|
|
@@ -2870,7 +2870,7 @@ export default {
|
|
|
2870
2870
|
timeschedule_add_schedule_weekday6_text: "Lør.",
|
|
2871
2871
|
timeschedule_add_schedule_weekday7_text: "Søn.",
|
|
2872
2872
|
timeschedule_overview_empty_information_text: "Du har endnu ikke tilføjet en tidsplan.",
|
|
2873
|
-
timeschedule_overview_headline_text: "
|
|
2873
|
+
timeschedule_overview_headline_text: "Opstart",
|
|
2874
2874
|
timeschedule_overview_description_text: "Der kan forekomme mindre forsinkelser på op til 30 sekunder.",
|
|
2875
2875
|
timeschedule_overview_empty_button_add_text: "Tilføj tidsplan",
|
|
2876
2876
|
ceiling_fan_feature_2_light_text_min_off: "Lyset slukkes om {0} min.",
|
|
@@ -12648,7 +12648,7 @@ export default {
|
|
|
12648
12648
|
striplight_lengthtitle: "Comprimento da luz de tira",
|
|
12649
12649
|
striplight_actuallength: "Comprimento real",
|
|
12650
12650
|
add_sleepschedule_one_source_subheadline4_text: "Sumário"
|
|
12651
|
-
},
|
|
12651
|
+
},
|
|
12652
12652
|
ro: {
|
|
12653
12653
|
add_new_dynamic_mood_color_changing_mode_value: "Gradient",
|
|
12654
12654
|
power_off_memory_default_state_title: "Starea implicită",
|