@ledvance/base 1.3.7 → 1.3.9

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 (45) hide show
  1. package/localazy.json +12 -1
  2. package/package.json +1 -1
  3. package/src/components/AdvanceCard.tsx +4 -3
  4. package/src/components/ApplyForDeviceItem.tsx +6 -5
  5. package/src/components/ApplyForDeviceList.tsx +4 -3
  6. package/src/components/ApplyForText.tsx +4 -3
  7. package/src/components/Card.tsx +4 -3
  8. package/src/components/ColorTempAdjustView.tsx +2 -1
  9. package/src/components/CustomListDialog.tsx +4 -3
  10. package/src/components/DeleteButton.tsx +4 -3
  11. package/src/components/DrawToolView.tsx +13 -12
  12. package/src/components/FanAdjustView.tsx +16 -15
  13. package/src/components/InfoText.tsx +3 -2
  14. package/src/components/Page.tsx +3 -2
  15. package/src/components/Popup.tsx +4 -3
  16. package/src/components/Segmented.tsx +7 -6
  17. package/src/components/SocketItem.tsx +4 -3
  18. package/src/components/Stepper.tsx +6 -5
  19. package/src/components/StripAdjustView.tsx +6 -6
  20. package/src/components/StripLightView.tsx +3 -2
  21. package/src/components/Summary.tsx +7 -6
  22. package/src/components/Tag.tsx +6 -5
  23. package/src/components/TextField.tsx +7 -6
  24. package/src/components/TextFieldStyleButton.tsx +7 -6
  25. package/src/components/UATabTitle.tsx +4 -3
  26. package/src/components/UATabs.tsx +5 -4
  27. package/src/components/ldvColorSlider.tsx +3 -2
  28. package/src/components/ldvPickerView.tsx +5 -4
  29. package/src/components/ldvSlider.tsx +4 -3
  30. package/src/components/ldvSwitch.tsx +4 -4
  31. package/src/components/ldvTopBar.tsx +4 -3
  32. package/src/components/ldvTopName.tsx +4 -3
  33. package/src/components/segmentControl.tsx +7 -7
  34. package/src/components/weekSelect.tsx +3 -3
  35. package/src/config/dark-theme.ts +1 -0
  36. package/src/config/light-theme.ts +2 -1
  37. package/src/i18n/strings.ts +354 -35
  38. package/src/res/arrow_temp_down.png +0 -0
  39. package/src/res/arrow_temp_down@2x.png +0 -0
  40. package/src/res/arrow_temp_down@3x.png +0 -0
  41. package/src/res/arrow_temp_up.png +0 -0
  42. package/src/res/arrow_temp_up@2x.png +0 -0
  43. package/src/res/arrow_temp_up@3x.png +0 -0
  44. package/src/res/index.ts +3 -1
  45. package/translateKey.txt +11 -0
package/localazy.json CHANGED
@@ -889,7 +889,18 @@
889
889
  "MATCH:thermostat_difference",
890
890
  "MATCH:thermostat_refresh",
891
891
  "MATCH:thermostat_quicktemp",
892
- "MATCH:thermostat_energysaving"
892
+ "MATCH:thermostat_energysaving",
893
+ "MATCH:thermostat_editauto",
894
+ "MATCH:add_new_trigger_time_icon_selection_headline_text",
895
+ "MATCH:thermostat_setscope",
896
+ "MATCH:thermostat_settime",
897
+ "MATCH:thermostat_starttime",
898
+ "MATCH:thermostat_endtime",
899
+ "MATCH:thermostat_error",
900
+ "MATCH:thermostat_maxtime",
901
+ "MATCH:thermostat_schedule",
902
+ "MATCH:thermostat_unit",
903
+ "MATCH:thermostat_comforttemp"
893
904
  ],
894
905
  "replacements": {
895
906
  "REGEX:% %1\\$s.*?\\)%": "{0}",
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/base",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.3.7",
7
+ "version": "1.3.9",
8
8
  "scripts": {
9
9
  "prepublishOnly": "python update-localazy.py"
10
10
  },
@@ -3,6 +3,7 @@ import { StyleSheet, Text, View, ViewProps } from 'react-native'
3
3
  import { Utils } from 'tuya-panel-kit'
4
4
  import Card from 'components/Card'
5
5
  import Spacer from 'components/Spacer'
6
+ import ThemeType from '../config/themeType'
6
7
 
7
8
  const { convertX: cx } = Utils.RatioUtils
8
9
  const { withTheme } = Utils.ThemeUtils
@@ -38,7 +39,7 @@ export function getAdvancedStatusColor(status: AdvancedStatus): string {
38
39
  }
39
40
 
40
41
  export interface AdvanceCardProps extends PropsWithChildren<ViewProps> {
41
- theme?: any
42
+ theme?: ThemeType
42
43
  data: AdvancedData
43
44
  onPress: () => void
44
45
  }
@@ -61,11 +62,11 @@ const AdvanceCard = (props: AdvanceCardProps) => {
61
62
  props.children ?
62
63
  props.children :
63
64
  <View style={styles.titleBg}>
64
- <Text style={{...styles.title, color: props.theme.global.fontColor}}>{props.data.title}</Text>
65
+ <Text style={{...styles.title, color: props.theme?.global.fontColor}}>{props.data.title}</Text>
65
66
  <Spacer height={cx(8)} />
66
67
  {
67
68
  (!!props.data.subtitles) && props.data.subtitles.map((subtitle, index) => (
68
- <Text style={{...styles.subtitle, color: props.theme.global.secondFontColor}} key={`${subtitle}_${index}`}>{subtitle}</Text>
69
+ <Text style={{...styles.subtitle, color: props.theme?.global.secondFontColor}} key={`${subtitle}_${index}`}>{subtitle}</Text>
69
70
  ))
70
71
  }
71
72
  </View>
@@ -4,12 +4,13 @@ import { Utils } from 'tuya-panel-kit'
4
4
  import { DeviceInfo } from '../api/native'
5
5
  import Spacer from './Spacer'
6
6
  import res from '../res'
7
+ import ThemeType from '../config/themeType'
7
8
 
8
9
  const cx = Utils.RatioUtils.convertX
9
10
  const { withTheme } = Utils.ThemeUtils
10
11
 
11
12
  export interface ApplyForDeviceItemProps {
12
- theme?: any
13
+ theme?: ThemeType
13
14
  deviceInfo: DeviceInfo
14
15
  }
15
16
 
@@ -18,7 +19,7 @@ const ApplyForDeviceItem = (props: ApplyForDeviceItemProps) => {
18
19
  const styles = StyleSheet.create({
19
20
  root: {
20
21
  marginHorizontal: cx(8),
21
- backgroundColor: props.theme.global.background,
22
+ backgroundColor: props.theme?.global.background,
22
23
  flexDirection: 'row',
23
24
  alignItems: 'center'
24
25
  },
@@ -36,7 +37,7 @@ const ApplyForDeviceItem = (props: ApplyForDeviceItemProps) => {
36
37
  deviceName: {
37
38
  flex: 1,
38
39
  marginStart: cx(8),
39
- color: props.theme.global.fontColor,
40
+ color: props.theme?.global.fontColor,
40
41
  fontSize: cx(16),
41
42
  fontFamily: 'helvetica_neue_lt_std_roman',
42
43
  },
@@ -48,12 +49,12 @@ const ApplyForDeviceItem = (props: ApplyForDeviceItemProps) => {
48
49
  height: cx(16),
49
50
  display: 'flex',
50
51
  justifyContent: 'center',
51
- backgroundColor: props.theme.tag.background,
52
+ backgroundColor: props.theme?.tag.background,
52
53
  borderRadius: cx(8),
53
54
  },
54
55
  roomName: {
55
56
  marginHorizontal: cx(12),
56
- color: props.theme.tag.fontColor,
57
+ color: props.theme?.tag.fontColor,
57
58
  fontSize: cx(10),
58
59
  fontFamily: 'helvetica_neue_lt_std_roman',
59
60
  },
@@ -6,12 +6,13 @@ import Spacer from './Spacer'
6
6
  import ApplyForDeviceItem from './ApplyForDeviceItem'
7
7
  import { Utils } from 'tuya-panel-kit'
8
8
  import { useReactive, useUpdateEffect } from 'ahooks'
9
+ import ThemeType from '../config/themeType'
9
10
 
10
11
  const cx = Utils.RatioUtils.convertX
11
12
  const { withTheme } = Utils.ThemeUtils
12
13
 
13
14
  export interface ApplyForDeviceListProps {
14
- theme?: any
15
+ theme?: ThemeType
15
16
  devices: DeviceInfo[]
16
17
  expand?: boolean
17
18
  onExpandChange?: (expand: boolean) => void
@@ -30,10 +31,10 @@ const ApplyForDeviceList = (props: ApplyForDeviceListProps) => {
30
31
  deviceList: {
31
32
  marginHorizontal: cx(16),
32
33
  paddingVertical: cx(8),
33
- backgroundColor: props.theme.container.background,
34
+ backgroundColor: props.theme?.container.background,
34
35
  },
35
36
  spacer: {
36
- backgroundColor: props.theme.container.background,
37
+ backgroundColor: props.theme?.container.background,
37
38
  }
38
39
  })
39
40
 
@@ -3,12 +3,13 @@ import React from 'react'
3
3
  import { Utils } from 'tuya-panel-kit'
4
4
  import res from '../res/index'
5
5
  import I18n from '../i18n/index'
6
+ import ThemeType from '../config/themeType'
6
7
 
7
8
  const cx = Utils.RatioUtils.convertX
8
9
  const { withTheme } = Utils.ThemeUtils
9
10
 
10
11
  export interface ApplyForTextProps {
11
- theme?: any
12
+ theme?: ThemeType
12
13
  expand: boolean
13
14
  onExpandChange: (expand: boolean) => void
14
15
  }
@@ -21,13 +22,13 @@ const ApplyForText = (props: ApplyForTextProps) => {
21
22
  marginStart: cx(16),
22
23
  },
23
24
  text: {
24
- color: props.theme.global.secondFontColor,
25
+ color: props.theme?.global.secondFontColor,
25
26
  fontSize: cx(16),
26
27
  letterSpacing: cx(0.12),
27
28
  fontFamily: 'helvetica_neue_lt_std_bd',
28
29
  },
29
30
  icon: {
30
- tintColor: props.theme.global.secondFontColor,
31
+ tintColor: props.theme?.global.secondFontColor,
31
32
  width: cx(24),
32
33
  height: cx(24),
33
34
  },
@@ -1,12 +1,13 @@
1
1
  import {Platform, StyleProp, TouchableOpacity, View, ViewProps, ViewStyle} from 'react-native'
2
2
  import React, {PropsWithChildren} from 'react'
3
3
  import {Utils} from 'tuya-panel-kit'
4
+ import ThemeType from '../config/themeType'
4
5
 
5
6
  const cx = Utils.RatioUtils.convertX
6
7
  const { withTheme } = Utils.ThemeUtils
7
8
 
8
9
  interface CardProps extends PropsWithChildren<ViewProps> {
9
- theme?: any
10
+ theme?: ThemeType
10
11
  shadowHeight?: number | undefined
11
12
  onPress?: () => void
12
13
  onLongPress?: () => void
@@ -19,9 +20,9 @@ const Card = (props: CardProps) => {
19
20
  <View
20
21
  style={[{
21
22
  overflow: Platform.OS === 'ios' ? undefined : 'hidden',
22
- backgroundColor: props.theme.card.background,
23
+ backgroundColor: props.theme?.card.background,
23
24
  elevation: shadowHeight,
24
- shadowColor: props.theme.card.shadowColor,
25
+ shadowColor: props.theme?.card.shadowColor,
25
26
  shadowOpacity: 0.2,
26
27
  shadowRadius: shadowHeight,
27
28
  shadowOffset: {
@@ -7,12 +7,13 @@ import LdvSlider from './ldvSlider'
7
7
  import {Utils} from 'tuya-panel-kit'
8
8
  import I18n from '../i18n/index'
9
9
  import {cctToColor} from '../utils/cctUtils'
10
+ import ThemeType from '../config/themeType'
10
11
 
11
12
  const {convertX: cx} = Utils.RatioUtils
12
13
  const { withTheme } = Utils.ThemeUtils
13
14
 
14
15
  export interface ColorTempAdjustViewProps {
15
- theme?: any
16
+ theme?: ThemeType
16
17
  colorTemp: number
17
18
  brightness: number
18
19
  minBrightness?: number
@@ -4,6 +4,7 @@ import TextButton from './TextButton'
4
4
  import Dialog from './Dialog'
5
5
  import React from 'react'
6
6
  import { Utils } from 'tuya-panel-kit'
7
+ import ThemeType from '../config/themeType'
7
8
 
8
9
  const cx = Utils.RatioUtils.convertX
9
10
  const { withTheme } = Utils.ThemeUtils
@@ -15,7 +16,7 @@ interface ListData {
15
16
  }
16
17
 
17
18
  interface CustomListDialogProps extends ViewProps {
18
- theme?: any
19
+ theme?: ThemeType
19
20
  itemStyle?: StyleProp<ViewStyle>
20
21
  show: boolean
21
22
  onDismiss: () => void
@@ -26,11 +27,11 @@ interface CustomListDialogProps extends ViewProps {
26
27
  const CustomListDialog = (props: CustomListDialogProps) => {
27
28
  const styles = StyleSheet.create({
28
29
  popoverItemText: {
29
- color: props.theme.global.fontColor,
30
+ color: props.theme?.global.fontColor,
30
31
  fontSize: cx(16),
31
32
  },
32
33
  disableItemText: {
33
- color: props.theme.global.disabledFontColor,
34
+ color: props.theme?.global.disabledFontColor,
34
35
  fontSize: cx(16),
35
36
  },
36
37
  line: {
@@ -1,12 +1,13 @@
1
1
  import React from 'react'
2
2
  import { StyleProp, Text, TextStyle, TouchableOpacity, ViewStyle } from 'react-native'
3
3
  import { Utils } from 'tuya-panel-kit'
4
+ import ThemeType from '../config/themeType'
4
5
 
5
6
  const cx = Utils.RatioUtils.convertX
6
7
  const { withTheme } = Utils.ThemeUtils
7
8
 
8
9
  interface DeleteButtonProps {
9
- theme?: any
10
+ theme?: ThemeType
10
11
  text: string,
11
12
  onPress: () => void,
12
13
  style?: StyleProp<ViewStyle>,
@@ -23,13 +24,13 @@ const DeleteButton = (props: DeleteButtonProps) => {
23
24
  style={[{
24
25
  width: '100%',
25
26
  height: cx(50),
26
- backgroundColor: props.theme.button.delete,
27
+ backgroundColor: props.theme?.button.delete,
27
28
  alignItems: 'center',
28
29
  justifyContent: 'center',
29
30
  borderRadius: cx(8),
30
31
  }, style]}>
31
32
  <Text style={[{
32
- color: props.theme.button.fontColor,
33
+ color: props.theme?.button.fontColor,
33
34
  fontSize: cx(16),
34
35
  fontFamily: 'helvetica_neue_lt_std_bd',
35
36
  }, textStyle]}>{text}</Text>
@@ -13,6 +13,7 @@ import DeleteButton from './DeleteButton'
13
13
  import Stepper from './Stepper'
14
14
  import StripLightView from './StripLightView'
15
15
  import { nativeEventEmitter } from '../api/nativeEventEmitter'
16
+ import ThemeType from '../config/themeType'
16
17
 
17
18
  const { convertX: cx } = Utils.RatioUtils
18
19
  const { withTheme } = Utils.ThemeUtils
@@ -23,7 +24,7 @@ export type Node = {
23
24
  }
24
25
 
25
26
  interface DrawToolViewProps extends PropsWithChildren<ViewProps> {
26
- theme?: any
27
+ theme?: ThemeType
27
28
  title?: string
28
29
  switchLed?: boolean
29
30
  showEnable?: boolean
@@ -105,7 +106,7 @@ const DrawToolView = (props: DrawToolViewProps) => {
105
106
  const s = Math.round(mapFloatToRange(props.s / 100, 30, 100))
106
107
  return hsv2Hex(props.h, s, 100)
107
108
  }
108
- return props.theme.card.background
109
+ return props.theme?.card.background
109
110
  }, [props.isColorMode, props.h, props.s])
110
111
 
111
112
  const ledNumValidator = (num?: number) => {
@@ -120,7 +121,7 @@ const DrawToolView = (props: DrawToolViewProps) => {
120
121
  alignItems: 'center',
121
122
  },
122
123
  title: {
123
- color: props.theme.global.fontColor,
124
+ color: props.theme?.global.fontColor,
124
125
  fontSize: cx(16),
125
126
  marginLeft: cx(10),
126
127
  fontFamily: 'helvetica_neue_lt_std_bd',
@@ -139,7 +140,7 @@ const DrawToolView = (props: DrawToolViewProps) => {
139
140
  <Card style={{ marginHorizontal: cx(24) }}>
140
141
  <LdvSwitch
141
142
  title={props.title || I18n.getLang('light_sources_tile_tw_lighting_headline')}
142
- color={props.theme.card.background}
143
+ color={props.theme?.card.background}
143
144
  colorAlpha={1}
144
145
  enable={!!props.switchLed}
145
146
  showSwitch={!!props.showEnable}
@@ -152,7 +153,7 @@ const DrawToolView = (props: DrawToolViewProps) => {
152
153
  props.setAdjustType(1)
153
154
  }}>
154
155
  <Image
155
- style={[styles.adjustButton, { tintColor: props.adjustType === 1 ? props.theme.icon.primary : props.theme.icon.normal }]}
156
+ style={[styles.adjustButton, { tintColor: props.adjustType === 1 ? props.theme?.icon.primary : props.theme?.icon.normal }]}
156
157
  source={res.ic_paint_bucket} />
157
158
  </TouchableOpacity>
158
159
  {!props.hideDisableLight && <TouchableOpacity
@@ -160,7 +161,7 @@ const DrawToolView = (props: DrawToolViewProps) => {
160
161
  props.setAdjustType(3)
161
162
  }}>
162
163
  <Image
163
- style={[styles.adjustButton, { tintColor: props.adjustType === 3 ? props.theme.icon.primary : props.theme.icon.normal }]}
164
+ style={[styles.adjustButton, { tintColor: props.adjustType === 3 ? props.theme?.icon.primary : props.theme?.icon.normal }]}
164
165
  source={res.ic_disabled_light} />
165
166
  </TouchableOpacity>}
166
167
  {!props.hideColorize && <TouchableOpacity
@@ -168,7 +169,7 @@ const DrawToolView = (props: DrawToolViewProps) => {
168
169
  props.setAdjustType(2)
169
170
  }}>
170
171
  <Image
171
- style={[styles.adjustButton, { tintColor: props.adjustType === 2 ? props.theme.icon.primary : props.theme.icon.normal }]}
172
+ style={[styles.adjustButton, { tintColor: props.adjustType === 2 ? props.theme?.icon.primary : props.theme?.icon.normal }]}
172
173
  source={res.ic_colorize} />
173
174
  </TouchableOpacity>}
174
175
  {!props.hideLedNum && <TouchableOpacity
@@ -178,10 +179,10 @@ const DrawToolView = (props: DrawToolViewProps) => {
178
179
  style={[styles.adjustButton, {
179
180
  alignItems: 'center',
180
181
  justifyContent: 'center',
181
- backgroundColor: props.theme.icon.primary,
182
+ backgroundColor: props.theme?.icon.primary,
182
183
  borderRadius: cx(5),
183
184
  }]}>
184
- <Text style={{ color: props.theme.global.fontColor, fontSize: cx(18), fontWeight: 'bold' }}>{props.ledNum || 5}</Text>
185
+ <Text style={{ color: props.theme?.global.fontColor, fontSize: cx(18), fontWeight: 'bold' }}>{props.ledNum || 5}</Text>
185
186
  </TouchableOpacity>}
186
187
  </View>
187
188
  <StripLightView
@@ -229,9 +230,9 @@ const DrawToolView = (props: DrawToolViewProps) => {
229
230
  containerStyle={{ marginHorizontal: cx(16), alignItems: 'center' }}
230
231
  style={{ marginHorizontal: cx(16), marginTop: cx(50) }}>
231
232
  <Spacer />
232
- <Text style={{ color: props.theme.global.fontColor, fontSize: cx(14) }}>{I18n.getLang('string_lights_set_bulbs_title')}</Text>
233
+ <Text style={{ color: props.theme?.global.fontColor, fontSize: cx(14) }}>{I18n.getLang('string_lights_set_bulbs_title')}</Text>
233
234
  <Spacer height={cx(10)}/>
234
- <Text style={{color: props.theme.global.secondFontColor}}>{I18n.getLang('string_lights_set_bulbs_description_text')}</Text>
235
+ <Text style={{color: props.theme?.global.secondFontColor}}>{I18n.getLang('string_lights_set_bulbs_description_text')}</Text>
235
236
  <Spacer />
236
237
  <Stepper
237
238
  min={5}
@@ -247,7 +248,7 @@ const DrawToolView = (props: DrawToolViewProps) => {
247
248
  <Spacer />
248
249
  <DeleteButton
249
250
  text={I18n.getLang('auto_scan_system_wifi_confirm')}
250
- style={{ width: cx(150), height: cx(40), backgroundColor: ledNumValidator(state.ledNum) ? props.theme.button.primary : props.theme.button.disabled }}
251
+ style={{ width: cx(150), height: cx(40), backgroundColor: ledNumValidator(state.ledNum) ? props.theme?.button.primary : props.theme?.button.disabled }}
251
252
  textStyle={{ fontSize: cx(14) }}
252
253
  onPress={() => {
253
254
  if (!ledNumValidator(state.ledNum)) return
@@ -9,12 +9,13 @@ import Spacer from './Spacer'
9
9
  import res from '../res'
10
10
  import Segmented from './Segmented'
11
11
  import Popup from './Popup'
12
+ import ThemeType from '../config/themeType'
12
13
 
13
14
  const {convertX: cx} = Utils.RatioUtils
14
15
  const { withTheme } = Utils.ThemeUtils
15
16
 
16
17
  interface FanAdjustViewProps extends ViewProps {
17
- theme?: any
18
+ theme?: ThemeType
18
19
  hideEnable?: boolean
19
20
  fanEnable: boolean
20
21
  fanSpeed: number
@@ -69,7 +70,7 @@ export function FanAdjustViewContent(props: FanAdjustViewProps) {
69
70
  <View style={{flexDirection: 'row', marginBottom: cx(2), alignItems: 'center'}}>
70
71
  <Text style={{
71
72
  marginRight: cx(5),
72
- color: props.theme.global.fontColor,
73
+ color: props.theme?.global.fontColor,
73
74
  }}>{I18n.getLang('ceiling_fan_tile_uvc_fan_direction')}</Text>
74
75
  <TouchableOpacity onPress={() => Popup({
75
76
  title: I18n.getLang('ceiling_fan_direction_info_headline'),
@@ -77,17 +78,17 @@ export function FanAdjustViewContent(props: FanAdjustViewProps) {
77
78
  content: <View>
78
79
  <Text style={{
79
80
  fontWeight: 'bold',
80
- color: props.theme.global.fontColor,
81
+ color: props.theme?.global.fontColor,
81
82
  }}>{I18n.getLang('ceiling_fan_direction_info_description_text')}</Text>
82
83
  <Spacer/>
83
- <Text style={{color: props.theme.global.fontColor}}>{I18n.getLang('ceiling_fan_direction_info_option_1_headline')}</Text>
84
- <Text style={{color: props.theme.global.fontColor}}>{I18n.getLang('ceiling_fan_direction_info_option_1_text')}</Text>
84
+ <Text style={{color: props.theme?.global.fontColor}}>{I18n.getLang('ceiling_fan_direction_info_option_1_headline')}</Text>
85
+ <Text style={{color: props.theme?.global.fontColor}}>{I18n.getLang('ceiling_fan_direction_info_option_1_text')}</Text>
85
86
  <Spacer/>
86
- <Text style={{color: props.theme.global.fontColor}}>{I18n.getLang('ceiling_fan_direction_info_option_2_headline')}</Text>
87
- <Text style={{color: props.theme.global.fontColor}}>{I18n.getLang('ceiling_fan_direction_info_option_2_text')}</Text>
87
+ <Text style={{color: props.theme?.global.fontColor}}>{I18n.getLang('ceiling_fan_direction_info_option_2_headline')}</Text>
88
+ <Text style={{color: props.theme?.global.fontColor}}>{I18n.getLang('ceiling_fan_direction_info_option_2_text')}</Text>
88
89
  </View>,
89
90
  })}>
90
- <Image style={{width: cx(16), height: cx(16), tintColor: props.theme.icon.primary}} source={res.ic_info}/>
91
+ <Image style={{width: cx(16), height: cx(16), tintColor: props.theme?.icon.primary}} source={res.ic_info}/>
91
92
  </TouchableOpacity>
92
93
  </View>
93
94
  <Segmented
@@ -100,24 +101,24 @@ export function FanAdjustViewContent(props: FanAdjustViewProps) {
100
101
 
101
102
  {props.fanEnable && props.isSupportMode && <View style={{marginHorizontal: cx(16)}}>
102
103
  <View style={{flexDirection: 'row', marginBottom: cx(2), alignItems: 'center'}}>
103
- <Text style={{marginRight: cx(5), color: props.theme.global.fontColor}}>{I18n.getLang('ceiling_fan_tile_uvc_fan_mode')}</Text>
104
+ <Text style={{marginRight: cx(5), color: props.theme?.global.fontColor}}>{I18n.getLang('ceiling_fan_tile_uvc_fan_mode')}</Text>
104
105
  <TouchableOpacity onPress={() => Popup({
105
106
  title: I18n.getLang('ceiling_fan_mode_info_headline'),
106
107
  confirmText: I18n.getLang('ceiling_fan_direction_info_button_label'),
107
108
  content: <View>
108
109
  <Text style={{
109
110
  fontWeight: 'bold',
110
- color: props.theme.global.fontColor,
111
+ color: props.theme?.global.fontColor,
111
112
  }}>{I18n.getLang('ceiling_fan_mode_info_description_text')}</Text>
112
113
  <Spacer/>
113
- <Text style={{color: props.theme.global.fontColor}}>{I18n.getLang('ceiling_fan_mode_info_option_1_headline')}</Text>
114
- <Text style={{color: props.theme.global.fontColor}}>{I18n.getLang('ceiling_fan_mode_info_option_1_text')}</Text>
114
+ <Text style={{color: props.theme?.global.fontColor}}>{I18n.getLang('ceiling_fan_mode_info_option_1_headline')}</Text>
115
+ <Text style={{color: props.theme?.global.fontColor}}>{I18n.getLang('ceiling_fan_mode_info_option_1_text')}</Text>
115
116
  <Spacer/>
116
- <Text style={{color: props.theme.global.fontColor}}>{I18n.getLang('ceiling_fan_mode_info_option_2_headline')}</Text>
117
- <Text style={{color: props.theme.global.fontColor}}>{I18n.getLang('ceiling_fan_mode_info_option_2_text')}</Text>
117
+ <Text style={{color: props.theme?.global.fontColor}}>{I18n.getLang('ceiling_fan_mode_info_option_2_headline')}</Text>
118
+ <Text style={{color: props.theme?.global.fontColor}}>{I18n.getLang('ceiling_fan_mode_info_option_2_text')}</Text>
118
119
  </View>,
119
120
  })}>
120
- <Image style={{width: cx(16), height: cx(16), tintColor: props.theme.icon.primary}} source={res.ic_info}/>
121
+ <Image style={{width: cx(16), height: cx(16), tintColor: props.theme?.icon.primary}} source={res.ic_info}/>
121
122
  </TouchableOpacity>
122
123
  </View>
123
124
  <Segmented
@@ -2,12 +2,13 @@ import {Image, ImageStyle, StyleProp, StyleSheet, Text, TextStyle, View, ViewPro
2
2
  import React from 'react'
3
3
  import {Utils} from 'tuya-panel-kit'
4
4
  import Spacer from './Spacer'
5
+ import ThemeType from '../config/themeType'
5
6
 
6
7
  const cx = Utils.RatioUtils.convertX
7
8
  const { withTheme } = Utils.ThemeUtils
8
9
 
9
10
  interface InfoTextProps extends ViewProps {
10
- theme?: any
11
+ theme?: ThemeType
11
12
  icon: string | number
12
13
  text: string
13
14
  contentColor?: string
@@ -17,7 +18,7 @@ interface InfoTextProps extends ViewProps {
17
18
  }
18
19
 
19
20
  const InfoText = (props: InfoTextProps) => {
20
- const contentColor = props.contentColor || props.theme.global.secondFontColor
21
+ const contentColor = props.contentColor || props.theme?.global.secondFontColor
21
22
  const source = typeof props.icon === 'string' ? {uri: props.icon} : props.icon
22
23
  return (
23
24
  <View style={[styles.root, props.style]}>
@@ -5,11 +5,12 @@ import { useNavigation } from '@react-navigation/native'
5
5
  import {Dialog, Toast, Utils} from 'tuya-panel-kit'
6
6
  import I18n from '@i18n'
7
7
  import LdvTopName from './ldvTopName'
8
+ import ThemeType from '../config/themeType'
8
9
 
9
10
  const { withTheme } = Utils.ThemeUtils
10
11
 
11
12
  interface PageProps extends PropsWithChildren<ViewProps> {
12
- theme?: any
13
+ theme?: ThemeType
13
14
  rightButtonDisabled?: boolean
14
15
  backText: string
15
16
  onBackClick?: () => void
@@ -69,7 +70,7 @@ const Page = (props: PageProps) => {
69
70
 
70
71
  return (
71
72
  <>
72
- <View style={[{ flex: 1, position: 'relative', backgroundColor: props.theme.global.backgroud }, props.style]}>
73
+ <View style={[{ flex: 1, position: 'relative', backgroundColor: props.theme?.global.backgroud }, props.style]}>
73
74
  <LDVTopBar
74
75
  title={props.backText}
75
76
  onBackPress={
@@ -1,6 +1,7 @@
1
1
  import React from 'react'
2
2
  import {Text, TouchableOpacity, View} from 'react-native'
3
3
  import {Popup, Utils} from 'tuya-panel-kit'
4
+ import ThemeType from '../config/themeType'
4
5
 
5
6
  const {convertX: cx, height} = Utils.RatioUtils
6
7
  const { withTheme } = Utils.ThemeUtils
@@ -12,14 +13,14 @@ interface InformationPopupProps {
12
13
  }
13
14
 
14
15
  const InformationPopup = (props: InformationPopupProps) => {
15
- const TitleNode = withTheme(({theme}: {theme?: any}) => {
16
+ const TitleNode = withTheme(({theme}: {theme?: ThemeType}) => {
16
17
  return (
17
18
  <View style={{flexDirection: 'row', height: cx(80), justifyContent: 'space-between'}}>
18
19
  <View style={{flexDirection: 'column-reverse', flex: 1, alignItems: 'center', paddingLeft: cx(12)}}>
19
20
  <Text style={{
20
21
  fontSize: cx(16),
21
22
  fontWeight: 'bold',
22
- color: theme.global.fontColor,
23
+ color: theme?.global.fontColor,
23
24
  paddingBottom: cx(12),
24
25
 
25
26
  }}>{props.title}</Text>
@@ -36,7 +37,7 @@ const InformationPopup = (props: InformationPopupProps) => {
36
37
  <Text
37
38
  style={{
38
39
  fontSize: cx(12),
39
- color: theme.button.primary,
40
+ color: theme?.button.primary,
40
41
  }}
41
42
  >
42
43
  {props.confirmText}
@@ -1,6 +1,7 @@
1
1
  import React, {ReactNode} from 'react'
2
2
  import {StyleSheet, Text, TouchableOpacity, View, ViewStyle} from 'react-native'
3
3
  import {Utils} from 'tuya-panel-kit'
4
+ import ThemeType from '../config/themeType'
4
5
 
5
6
  const {convertX: cx} = Utils.RatioUtils
6
7
  const { withTheme } = Utils.ThemeUtils
@@ -11,7 +12,7 @@ interface SegmentedItem {
11
12
  }
12
13
 
13
14
  interface SegmentedProps {
14
- theme?: any
15
+ theme?: ThemeType
15
16
  value?: string | number
16
17
  options?: SegmentedItem[]
17
18
  onChange?: (v: string | number) => void
@@ -23,7 +24,7 @@ const Segmented = (props: SegmentedProps) => {
23
24
  wrap_container: {
24
25
  flexDirection: 'row',
25
26
  height: cx(42),
26
- backgroundColor: props.theme.segment.background,
27
+ backgroundColor: props.theme?.segment.background,
27
28
  padding: cx(2),
28
29
  borderRadius: cx(8),
29
30
  },
@@ -31,7 +32,7 @@ const Segmented = (props: SegmentedProps) => {
31
32
  flex: 1,
32
33
  alignItems: 'center',
33
34
  justifyContent: 'center',
34
- backgroundColor: props.theme.container.background,
35
+ backgroundColor: props.theme?.container.background,
35
36
  },
36
37
  segmented_item_first: {
37
38
  borderBottomLeftRadius: cx(8),
@@ -42,14 +43,14 @@ const Segmented = (props: SegmentedProps) => {
42
43
  borderTopRightRadius: cx(8),
43
44
  },
44
45
  segmented_item_check: {
45
- backgroundColor: props.theme.button.primary,
46
+ backgroundColor: props.theme?.button.primary,
46
47
  },
47
48
  segmented_text: {
48
49
  fontSize: cx(16),
49
- color: props.theme.global.secondFontColor,
50
+ color: props.theme?.global.secondFontColor,
50
51
  },
51
52
  segmented_text_check: {
52
- color: props.theme.button.fontColor,
53
+ color: props.theme?.button.fontColor,
53
54
  },
54
55
  })
55
56
  return (
@@ -4,12 +4,13 @@ import Card from "components/Card";
4
4
  import Spacer from "components/Spacer";
5
5
  import { Dialog, SwitchButton, Utils } from "tuya-panel-kit";
6
6
  import I18n from "../i18n";
7
+ import ThemeType from '../config/themeType'
7
8
 
8
9
  const cx = Utils.RatioUtils.convertX
9
10
  const { withTheme } = Utils.ThemeUtils
10
11
 
11
12
  interface SocketItemProps extends PropsWithChildren<ViewProps>{
12
- theme?: any
13
+ theme?: ThemeType
13
14
  title: string
14
15
  name: string
15
16
  icon: any
@@ -29,7 +30,7 @@ function SocketItem(props: SocketItemProps) {
29
30
  },
30
31
  title: {
31
32
  fontSize: cx(16),
32
- color: props.theme.global.fontColor,
33
+ color: props.theme?.global.fontColor,
33
34
  fontFamily: 'helvetica_neue_lt_std_bd',
34
35
  fontWeight: 'bold',
35
36
  },
@@ -43,7 +44,7 @@ function SocketItem(props: SocketItemProps) {
43
44
  },
44
45
  name: {
45
46
  fontSize: cx(14),
46
- color: props.theme.global.fontColor,
47
+ color: props.theme?.global.fontColor,
47
48
  fontFamily: 'helvetica_neue_lt_std_roman',
48
49
  },
49
50
  })