@ledvance/ui-biz-bundle 1.1.89 → 1.1.91

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 (38) hide show
  1. package/package.json +1 -1
  2. package/src/modules/flags/FlagEditPage.tsx +180 -179
  3. package/src/modules/flags/FlagItem.tsx +26 -42
  4. package/src/modules/flags/FlagPage.tsx +27 -26
  5. package/src/modules/history/HistoryPage.tsx +111 -103
  6. package/src/modules/music/MusicPage.tsx +90 -88
  7. package/src/modules/timer/TimerPage.tsx +13 -9
  8. package/src/newModules/biorhythm/BiorhythmEditPage.tsx +54 -54
  9. package/src/newModules/biorhythm/BiorhythmPage.tsx +163 -162
  10. package/src/newModules/biorhythm/IconSelect.tsx +5 -4
  11. package/src/newModules/childLock/ChildLockPage.tsx +49 -47
  12. package/src/newModules/energyConsumption/component/EnergyModal.tsx +2 -2
  13. package/src/newModules/fixedTime/FixedTimeDetailPage.tsx +127 -124
  14. package/src/newModules/fixedTime/FixedTimePage.tsx +108 -104
  15. package/src/newModules/lightMode/LightModePage.tsx +74 -67
  16. package/src/newModules/mood/AddMoodPage.tsx +18 -15
  17. package/src/newModules/mood/DynamicMoodEditorPage.tsx +103 -100
  18. package/src/newModules/mood/MixDynamicMoodEditor.tsx +107 -104
  19. package/src/newModules/mood/MoodItem.tsx +59 -55
  20. package/src/newModules/mood/MoodPage.tsx +58 -57
  21. package/src/newModules/mood/RecommendMoodItem.tsx +27 -24
  22. package/src/newModules/mood/StaticMoodEditorPage.tsx +77 -85
  23. package/src/newModules/overchargeSwitch/OverchargeSwitchPage.tsx +36 -48
  24. package/src/newModules/powerOnBehavior/LightBehaviorPage.tsx +137 -135
  25. package/src/newModules/powerOnBehavior/PlugBehaviorPage.tsx +67 -61
  26. package/src/newModules/randomTime/RandomTimeDetailPage.tsx +114 -151
  27. package/src/newModules/randomTime/RandomTimePage.tsx +110 -105
  28. package/src/newModules/randomTime/Summary.tsx +61 -57
  29. package/src/newModules/remoteControl/RemoteControlPage.tsx +4 -3
  30. package/src/newModules/select/SelectPage.tsx +65 -62
  31. package/src/newModules/sleepWakeUp/SleepWakeUpActions.ts +16 -8
  32. package/src/newModules/sleepWakeUp/SleepWakeUpDetailPage.tsx +131 -123
  33. package/src/newModules/sleepWakeUp/SleepWakeUpPage.tsx +144 -140
  34. package/src/newModules/switchGradient/SwitchGradientPage.tsx +24 -25
  35. package/src/newModules/swithInching/SwithInching.tsx +154 -152
  36. package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +83 -83
  37. package/src/newModules/timeSchedule/components/ManuaSettings.tsx +3 -2
  38. package/src/newModules/swithInching/pickerView.tsx +0 -91
@@ -10,6 +10,7 @@ import {Result} from "@ledvance/base/src/models/modules/Result";
10
10
  import {useParams} from "@ledvance/base/src/hooks/Hooks";
11
11
 
12
12
  const { convertX: cx } = Utils.RatioUtils
13
+ const { withTheme } = Utils.ThemeUtils
13
14
 
14
15
  export interface OverchargeSwitchPageParams {
15
16
  overchargeSwitchCode: string
@@ -19,13 +20,45 @@ export function useOverchargeSwitch(overchargeSwitchCode: string): [boolean, (v:
19
20
  return useDp(overchargeSwitchCode)
20
21
  }
21
22
 
22
- const OverchargeSwitchPage = () => {
23
+ const OverchargeSwitchPage = (props: { theme?: any }) => {
23
24
  const params = useParams<OverchargeSwitchPageParams>()
24
25
  const devInfo = useDeviceInfo()
25
26
  const [overchargeSwitch, setOverchargeSwitch] = useOverchargeSwitch(params.overchargeSwitchCode)
26
27
  const state = useReactive({
27
28
  loading: false
28
29
  })
30
+
31
+ const styles = StyleSheet.create({
32
+ titleBGView: {
33
+ flexDirection: 'row',
34
+ alignItems: 'center',
35
+ paddingHorizontal: cx(16),
36
+ marginHorizontal: cx(24),
37
+ marginTop: cx(30)
38
+ },
39
+ title: {
40
+ color: props.theme.global.fontColor,
41
+ fontSize: cx(14),
42
+ fontFamily: 'helvetica_neue_lt_std_bd',
43
+ paddingVertical: cx(16),
44
+ },
45
+ desc: {
46
+ color: props.theme.global.fontColor,
47
+ },
48
+ shadow: {
49
+ shadowColor: props.theme.card.shadowColor,
50
+ shadowOpacity: 0.2,
51
+ shadowRadius: 8,
52
+ elevation:8,
53
+ shadowOffset: {
54
+ width: 0,
55
+ height: 4,
56
+ },
57
+ backgroundColor: props.theme.card.background,
58
+ borderRadius: 8,
59
+ },
60
+ })
61
+
29
62
  return (<Page
30
63
  backText={devInfo.name}
31
64
  loading={state.loading}>
@@ -35,7 +68,7 @@ const OverchargeSwitchPage = () => {
35
68
  <Text style={styles.title}>{I18n.getLang('switch_overcharge_headline_text')}</Text>
36
69
  </View>
37
70
  <View style={{ paddingBottom: cx(16) }}>
38
- <Text>{I18n.getLang('switch_overcharge_headline_description')}</Text>
71
+ <Text style={styles.desc}>{I18n.getLang('switch_overcharge_headline_description')}</Text>
39
72
  </View>
40
73
  </View>
41
74
  <Spacer style={{ flex: 1 }} height={0} width={0} />
@@ -48,49 +81,4 @@ const OverchargeSwitchPage = () => {
48
81
  </Page>)
49
82
  }
50
83
 
51
- const styles = StyleSheet.create({
52
- tipInfoContainer: {
53
- flexDirection: 'row',
54
- marginHorizontal: cx(24),
55
- marginVertical: cx(10)
56
- },
57
- image: {
58
- width: cx(16),
59
- height: cx(16),
60
- marginRight: cx(5),
61
- tintColor: '#000'
62
- },
63
- titleBGView: {
64
- flexDirection: 'row',
65
- alignItems: 'center',
66
- paddingHorizontal: cx(16),
67
- marginHorizontal: cx(24),
68
- marginTop: cx(30)
69
- },
70
- colorBlock: {
71
- width: cx(20),
72
- height: cx(20),
73
- marginStart: cx(12),
74
- borderRadius: cx(4),
75
- },
76
- title: {
77
- color: '#000',
78
- fontSize: cx(14),
79
- fontFamily: 'helvetica_neue_lt_std_bd',
80
- paddingVertical: cx(16),
81
- },
82
- shadow: {
83
- shadowColor: '#000000',
84
- shadowOpacity: 0.2,
85
- shadowRadius: 8,
86
- elevation:8,
87
- shadowOffset: {
88
- width: 0,
89
- height: 4,
90
- },
91
- backgroundColor: '#fff',
92
- borderRadius: 8,
93
- },
94
- })
95
-
96
- export default OverchargeSwitchPage
84
+ export default withTheme(OverchargeSwitchPage)
@@ -15,10 +15,11 @@ import { cloneDeep } from 'lodash'
15
15
  import { useParams } from '@ledvance/base/src/hooks/Hooks'
16
16
 
17
17
  const { convertX: cx } = Utils.RatioUtils
18
+ const { withTheme } = Utils.ThemeUtils
18
19
 
19
20
  export interface LightBehaviorPageParams {
20
21
  memoryDpCode: string
21
- disturbDpCode: string
22
+ disturbDpCode: string
22
23
  isSupportDoNotDisturb?: boolean
23
24
  isSupportBrightness: boolean
24
25
  isSupportTemperature: boolean
@@ -30,7 +31,7 @@ export enum PowerMemoryMode {
30
31
  Last = 1,
31
32
  Custom = 2
32
33
  }
33
- const LightBehaviorPage = () => {
34
+ const LightBehaviorPage = (props: { theme?: any }) => {
34
35
  const params = useParams<LightBehaviorPageParams>()
35
36
  const deviceInfo = useDeviceInfo()
36
37
  const [powerMemory, setPowerMemory] = usePowerOffMemory(params.memoryDpCode)
@@ -44,6 +45,59 @@ const LightBehaviorPage = () => {
44
45
  state.powerMemory = powerMemory
45
46
  }, [JSON.stringify(powerMemory)])
46
47
 
48
+ const styles = StyleSheet.create({
49
+ root: {
50
+ flex: 1,
51
+ },
52
+ tipText: {
53
+ marginHorizontal: cx(24),
54
+ color: props.theme.global.fontColor,
55
+ fontSize: cx(14),
56
+ fontFamily: 'helvetica_neue_lt_std_roman',
57
+ },
58
+ modeSelectGroup: {
59
+ marginHorizontal: cx(24),
60
+ backgroundColor: props.theme.container.background,
61
+ borderRadius: cx(4),
62
+ },
63
+ modeTip: {
64
+ marginHorizontal: cx(8),
65
+ color: props.theme.global.fontColor,
66
+ fontSize: cx(14),
67
+ fontWeight: 'bold',
68
+ fontFamily: 'helvetica_neue_lt_std_bd',
69
+ },
70
+ modeSelectCard: {
71
+ marginHorizontal: cx(8),
72
+ },
73
+ line: {
74
+ height: cx(1),
75
+ marginHorizontal: cx(12),
76
+ backgroundColor: props.theme.container.divider,
77
+ },
78
+ itemRoot: {
79
+ flexDirection: 'row',
80
+ alignItems: 'center',
81
+ paddingHorizontal: cx(12),
82
+ paddingBottom: cx(8),
83
+ },
84
+ itemTextGroup: {
85
+ flex: 1,
86
+ marginEnd: cx(12),
87
+ justifyContent: 'center',
88
+ },
89
+ itemTitle: {
90
+ color: props.theme.global.fontColor,
91
+ fontSize: cx(14),
92
+ fontFamily: 'helvetica_neue_lt_std_roman',
93
+ },
94
+ itemContent: {
95
+ color: props.theme.global.secondFontColor,
96
+ fontSize: cx(14),
97
+ fontFamily: 'helvetica_neue_lt_std_roman',
98
+ },
99
+ })
100
+
47
101
  return (
48
102
  <Page
49
103
  backText={deviceInfo.name}
@@ -64,6 +118,7 @@ const LightBehaviorPage = () => {
64
118
  <Card style={styles.modeSelectCard}>
65
119
  <Spacer height={cx(12)} />
66
120
  <PowerOnBehaviorModeItem
121
+ styles={styles}
67
122
  enable={state.powerMemory.type === PowerMemoryMode.Default}
68
123
  title={I18n.getLang('groups_settings_power_on_behavior_secondbox_status_value1_topic')}
69
124
  content={I18n.getLang('groups_settings_power_on_behavior_secondbox_status_value1_description')}
@@ -74,6 +129,7 @@ const LightBehaviorPage = () => {
74
129
  <View style={styles.line} />
75
130
  <Spacer height={cx(8)} />
76
131
  <PowerOnBehaviorModeItem
132
+ styles={styles}
77
133
  enable={state.powerMemory.type === PowerMemoryMode.Last}
78
134
  title={I18n.getLang('groups_settings_power_on_behavior_secondbox_status_value2_topic')}
79
135
  content={I18n.getLang('groups_settings_power_on_behavior_secondbox_status_value2_description')}
@@ -84,6 +140,7 @@ const LightBehaviorPage = () => {
84
140
  <View style={styles.line} />
85
141
  <Spacer height={cx(8)} />
86
142
  <PowerOnBehaviorModeItem
143
+ styles={styles}
87
144
  enable={state.powerMemory.type === PowerMemoryMode.Custom}
88
145
  title={I18n.getLang('groups_settings_power_on_behavior_secondbox_status_value3_topic')}
89
146
  content={I18n.getLang('groups_settings_power_on_behavior_secondbox_status_value3_description')}
@@ -97,77 +154,77 @@ const LightBehaviorPage = () => {
97
154
  </View>
98
155
  <Spacer />
99
156
  {state.powerMemory.type === PowerMemoryMode.Custom &&
100
- <Card style={{ marginHorizontal: cx(24) }}>
101
- <View>
102
- <Spacer />
103
- <LampAdjustView
104
- isSupportColor={params.isSupportColor}
105
- isSupportTemperature={params.isSupportTemperature}
106
- isSupportBrightness={params.isSupportBrightness}
107
- isColorMode={state.powerMemory.isColor}
108
- reserveSV={true}
109
- setIsColorMode={async isColorMode => {
110
- state.powerMemory.isColor = isColorMode
111
- }}
112
- h={state.powerMemory.hue} s={state.powerMemory.sat} v={state.powerMemory.val}
113
- onHSVChange={(h, s, v) => {
114
- state.powerMemory.hue = h
115
- state.powerMemory.sat = s
116
- state.powerMemory.val = v
117
- }}
118
- onHSVChangeComplete={async (h, s, v) => {
119
- state.powerMemory.hue = h
120
- state.powerMemory.sat = s
121
- state.powerMemory.val = v
122
- await setPowerMemory(state.powerMemory)
123
- }}
124
- colorTemp={state.powerMemory.temperature}
125
- brightness={state.powerMemory.bright}
126
- onCCTChange={cct => {
127
- state.powerMemory.temperature = cct
128
- }}
129
- onCCTChangeComplete={async cct => {
130
- state.powerMemory.temperature = cct
131
- await setPowerMemory(state.powerMemory)
132
- }}
133
- onBrightnessChange={brightness => {
134
- state.powerMemory.bright = brightness
135
- }}
136
- onBrightnessChangeComplete={async brightness => {
137
- state.powerMemory.bright = brightness
138
- await setPowerMemory(state.powerMemory)
139
- }} />
140
- </View>
141
- </Card>
157
+ <Card style={{ marginHorizontal: cx(24) }}>
158
+ <View>
159
+ <Spacer />
160
+ <LampAdjustView
161
+ isSupportColor={params.isSupportColor}
162
+ isSupportTemperature={params.isSupportTemperature}
163
+ isSupportBrightness={params.isSupportBrightness}
164
+ isColorMode={state.powerMemory.isColor}
165
+ reserveSV={true}
166
+ setIsColorMode={async isColorMode => {
167
+ state.powerMemory.isColor = isColorMode
168
+ }}
169
+ h={state.powerMemory.hue} s={state.powerMemory.sat} v={state.powerMemory.val}
170
+ onHSVChange={(h, s, v) => {
171
+ state.powerMemory.hue = h
172
+ state.powerMemory.sat = s
173
+ state.powerMemory.val = v
174
+ }}
175
+ onHSVChangeComplete={async (h, s, v) => {
176
+ state.powerMemory.hue = h
177
+ state.powerMemory.sat = s
178
+ state.powerMemory.val = v
179
+ await setPowerMemory(state.powerMemory)
180
+ }}
181
+ colorTemp={state.powerMemory.temperature}
182
+ brightness={state.powerMemory.bright}
183
+ onCCTChange={cct => {
184
+ state.powerMemory.temperature = cct
185
+ }}
186
+ onCCTChangeComplete={async cct => {
187
+ state.powerMemory.temperature = cct
188
+ await setPowerMemory(state.powerMemory)
189
+ }}
190
+ onBrightnessChange={brightness => {
191
+ state.powerMemory.bright = brightness
192
+ }}
193
+ onBrightnessChangeComplete={async brightness => {
194
+ state.powerMemory.bright = brightness
195
+ await setPowerMemory(state.powerMemory)
196
+ }} />
197
+ </View>
198
+ </Card>
142
199
  }
143
200
  <Spacer />
144
201
  {!!params.isSupportDoNotDisturb && <View style={styles.modeSelectGroup}>
145
- <Spacer height={cx(8)} />
146
- <View style={{ marginHorizontal: cx(8) }}>
147
- <Card style={{ borderRadius: cx(4) }}>
148
- <LdvSwitch
149
- title={I18n.getLang('light_settings_default_secondbox_text')}
150
- color={'#fffffff'}
151
- colorAlpha={1}
152
- enable={doNotDisturb}
153
- setEnable={async (enable: boolean) => {
154
- state.loading = true
155
- await setDoNotDisturb(enable)
156
- state.loading = false
157
- }} />
158
- </Card>
159
- </View>
160
- <Spacer height={cx(8)} />
161
- <Text
162
- style={{
163
- marginHorizontal: cx(8),
164
- color: '#000',
165
- fontSize: cx(12),
166
- fontFamily: 'helvetica_neue_lt_std_roman',
167
- }}>
168
- {I18n.getLang('groups_settings_power_on_behavior_disturbbox_note')}
169
- </Text>
170
- <Spacer height={cx(8)} />
202
+ <Spacer height={cx(8)} />
203
+ <View style={{ marginHorizontal: cx(8) }}>
204
+ <Card style={{ borderRadius: cx(4) }}>
205
+ <LdvSwitch
206
+ title={I18n.getLang('light_settings_default_secondbox_text')}
207
+ color={props.theme.card.background}
208
+ colorAlpha={1}
209
+ enable={doNotDisturb}
210
+ setEnable={async (enable: boolean) => {
211
+ state.loading = true
212
+ await setDoNotDisturb(enable)
213
+ state.loading = false
214
+ }} />
215
+ </Card>
216
+ </View>
217
+ <Spacer height={cx(8)} />
218
+ <Text
219
+ style={{
220
+ marginHorizontal: cx(8),
221
+ color: props.theme.global.fontColor,
222
+ fontSize: cx(12),
223
+ fontFamily: 'helvetica_neue_lt_std_roman',
224
+ }}>
225
+ {I18n.getLang('groups_settings_power_on_behavior_disturbbox_note')}
226
+ </Text>
227
+ <Spacer height={cx(8)} />
171
228
  </View>}
172
229
  <Spacer />
173
230
  </View>
@@ -181,9 +238,11 @@ interface PowerOnBehaviorModeItemProps extends PropsWithChildren<ViewProps> {
181
238
  title: string
182
239
  content: string
183
240
  enable: boolean
241
+ styles: StyleSheet.NamedStyles<any>
184
242
  }
185
243
 
186
244
  function PowerOnBehaviorModeItem(props: PowerOnBehaviorModeItemProps) {
245
+ const { styles } = props
187
246
  return (
188
247
  <TouchableOpacity onPress={props.onPress}>
189
248
  <View style={styles.itemRoot}>
@@ -194,73 +253,16 @@ function PowerOnBehaviorModeItem(props: PowerOnBehaviorModeItemProps) {
194
253
  </View>
195
254
  <Image
196
255
  source={{ uri: res.ic_check }}
197
- style={[
198
- styles.itemCheckedIcon,
199
- {
200
- display: props.enable ? 'flex' : 'none',
201
- },
202
- ]} />
256
+ style={{
257
+ width: cx(32),
258
+ height: cx(32),
259
+ marginEnd: cx(4),
260
+ display: props.enable ? 'flex' : 'none',
261
+ }}
262
+ />
203
263
  </View>
204
264
  </TouchableOpacity>
205
265
  )
206
266
  }
207
267
 
208
- const styles = StyleSheet.create({
209
- root: {
210
- flex: 1,
211
- },
212
- tipText: {
213
- marginHorizontal: cx(24),
214
- color: '#000',
215
- fontSize: cx(14),
216
- fontFamily: 'helvetica_neue_lt_std_roman',
217
- },
218
- modeSelectGroup: {
219
- marginHorizontal: cx(24),
220
- backgroundColor: '#f6f6f6',
221
- borderRadius: cx(4),
222
- },
223
- modeTip: {
224
- marginHorizontal: cx(8),
225
- color: '#000',
226
- fontSize: cx(14),
227
- fontWeight: 'bold',
228
- fontFamily: 'helvetica_neue_lt_std_bd',
229
- },
230
- modeSelectCard: {
231
- marginHorizontal: cx(8),
232
- },
233
- line: {
234
- height: cx(1),
235
- marginHorizontal: cx(12),
236
- backgroundColor: '#3C3C435B',
237
- },
238
- itemRoot: {
239
- flexDirection: 'row',
240
- alignItems: 'center',
241
- paddingHorizontal: cx(12),
242
- paddingBottom: cx(8),
243
- },
244
- itemTextGroup: {
245
- flex: 1,
246
- marginEnd: cx(12),
247
- justifyContent: 'center',
248
- },
249
- itemTitle: {
250
- color: '#000',
251
- fontSize: cx(14),
252
- fontFamily: 'helvetica_neue_lt_std_roman',
253
- },
254
- itemContent: {
255
- color: '#666',
256
- fontSize: cx(14),
257
- fontFamily: 'helvetica_neue_lt_std_roman',
258
- },
259
- itemCheckedIcon: {
260
- width: cx(32),
261
- height: cx(32),
262
- marginEnd: cx(4),
263
- },
264
- })
265
-
266
- export default LightBehaviorPage
268
+ export default withTheme(LightBehaviorPage)
@@ -12,16 +12,17 @@ import { useReactive, useUpdateEffect } from 'ahooks'
12
12
  import { useParams } from '@ledvance/base/src/hooks/Hooks'
13
13
 
14
14
  const { convertX: cx } = Utils.RatioUtils
15
+ const { withTheme } = Utils.ThemeUtils
15
16
 
16
17
  const RELAY_STATUS_OFF = 'off'
17
18
  const RELAY_STATUS_ON = 'on'
18
19
  const RELAY_STATUS_MEMORY = 'memory'
19
20
 
20
- const PlugBehaviorPage = () => {
21
+ const PlugBehaviorPage = (props: { theme?: any }) => {
21
22
  const params = useParams<PowerBehaviorPageParams>()
22
23
  const deviceInfo = useDeviceInfo()
23
24
  const [powerMemory, setPowerMemory] = usePowerBehavior(params.powerBehaviorCode)
24
-
25
+
25
26
  const state = useReactive({
26
27
  powerMemory,
27
28
  loading: false,
@@ -31,6 +32,64 @@ const PlugBehaviorPage = () => {
31
32
  state.powerMemory = powerMemory
32
33
  }, [powerMemory])
33
34
 
35
+ const styles = StyleSheet.create({
36
+ root: {
37
+ flex: 1,
38
+ },
39
+ tipText: {
40
+ marginHorizontal: cx(24),
41
+ color: props.theme.global.fontColor,
42
+ fontSize: cx(14),
43
+ fontFamily: 'helvetica_neue_lt_std_roman',
44
+ },
45
+ modeSelectGroup: {
46
+ marginHorizontal: cx(24),
47
+ backgroundColor: props.theme.container.background,
48
+ borderRadius: cx(4),
49
+ },
50
+ modeTip: {
51
+ marginHorizontal: cx(8),
52
+ color: props.theme.global.fontColor,
53
+ fontSize: cx(14),
54
+ fontWeight: 'bold',
55
+ fontFamily: 'helvetica_neue_lt_std_bd',
56
+ },
57
+ modeSelectCard: {
58
+ marginHorizontal: cx(8),
59
+ },
60
+ line: {
61
+ height: cx(1),
62
+ marginHorizontal: cx(12),
63
+ backgroundColor: props.theme.container.divider,
64
+ },
65
+ itemRoot: {
66
+ flexDirection: 'row',
67
+ alignItems: 'center',
68
+ paddingHorizontal: cx(12),
69
+ paddingBottom: cx(8),
70
+ },
71
+ itemTextGroup: {
72
+ flex: 1,
73
+ marginEnd: cx(12),
74
+ justifyContent: 'center',
75
+ },
76
+ itemTitle: {
77
+ color: props.theme.global.fontColor,
78
+ fontSize: cx(14),
79
+ fontFamily: 'helvetica_neue_lt_std_roman',
80
+ },
81
+ itemContent: {
82
+ color: props.theme.global.secondFontColor,
83
+ fontSize: cx(14),
84
+ fontFamily: 'helvetica_neue_lt_std_roman',
85
+ },
86
+ itemCheckedIcon: {
87
+ width: cx(32),
88
+ height: cx(32),
89
+ marginEnd: cx(4),
90
+ },
91
+ })
92
+
34
93
  return (
35
94
  <Page
36
95
  backText={deviceInfo.name}
@@ -47,6 +106,7 @@ const PlugBehaviorPage = () => {
47
106
  <Card style={styles.modeSelectCard}>
48
107
  <Spacer height={cx(12)} />
49
108
  <PowerOnBehaviorModeItem
109
+ styles={styles}
50
110
  enable={state.powerMemory === RELAY_STATUS_OFF}
51
111
  title={I18n.getLang('feature_summary_action_txt_2')}
52
112
  content={I18n.getLang('socket_settings_firstbox_status1_description')}
@@ -57,6 +117,7 @@ const PlugBehaviorPage = () => {
57
117
  <View style={styles.line} />
58
118
  <Spacer height={cx(8)} />
59
119
  <PowerOnBehaviorModeItem
120
+ styles={styles}
60
121
  enable={state.powerMemory === RELAY_STATUS_ON}
61
122
  title={I18n.getLang('feature_summary_action_txt_1')}
62
123
  content={I18n.getLang('socket_settings_firstbox_status2_description')}
@@ -67,6 +128,7 @@ const PlugBehaviorPage = () => {
67
128
  <View style={styles.line} />
68
129
  <Spacer height={cx(8)} />
69
130
  <PowerOnBehaviorModeItem
131
+ styles={styles}
70
132
  enable={state.powerMemory === RELAY_STATUS_MEMORY}
71
133
  title={I18n.getLang('sockets_specific_settings_relay_status_remember')}
72
134
  content={I18n.getLang('socket_settings_firstbox_status3_description')}
@@ -88,9 +150,11 @@ interface PowerOnBehaviorModeItemProps extends PropsWithChildren<ViewProps> {
88
150
  title: string
89
151
  content: string
90
152
  enable: boolean
153
+ styles: StyleSheet.NamedStyles<any>
91
154
  }
92
155
 
93
156
  function PowerOnBehaviorModeItem(props: PowerOnBehaviorModeItemProps) {
157
+ const { styles } = props
94
158
  return (
95
159
  <TouchableOpacity onPress={props.onPress}>
96
160
  <View style={styles.itemRoot}>
@@ -112,62 +176,4 @@ function PowerOnBehaviorModeItem(props: PowerOnBehaviorModeItemProps) {
112
176
  )
113
177
  }
114
178
 
115
- const styles = StyleSheet.create({
116
- root: {
117
- flex: 1,
118
- },
119
- tipText: {
120
- marginHorizontal: cx(24),
121
- color: '#000',
122
- fontSize: cx(14),
123
- fontFamily: 'helvetica_neue_lt_std_roman',
124
- },
125
- modeSelectGroup: {
126
- marginHorizontal: cx(24),
127
- backgroundColor: '#f6f6f6',
128
- borderRadius: cx(4),
129
- },
130
- modeTip: {
131
- marginHorizontal: cx(8),
132
- color: '#000',
133
- fontSize: cx(14),
134
- fontWeight: 'bold',
135
- fontFamily: 'helvetica_neue_lt_std_bd',
136
- },
137
- modeSelectCard: {
138
- marginHorizontal: cx(8),
139
- },
140
- line: {
141
- height: cx(1),
142
- marginHorizontal: cx(12),
143
- backgroundColor: '#3C3C435B',
144
- },
145
- itemRoot: {
146
- flexDirection: 'row',
147
- alignItems: 'center',
148
- paddingHorizontal: cx(12),
149
- paddingBottom: cx(8),
150
- },
151
- itemTextGroup: {
152
- flex: 1,
153
- marginEnd: cx(12),
154
- justifyContent: 'center',
155
- },
156
- itemTitle: {
157
- color: '#000',
158
- fontSize: cx(14),
159
- fontFamily: 'helvetica_neue_lt_std_roman',
160
- },
161
- itemContent: {
162
- color: '#666',
163
- fontSize: cx(14),
164
- fontFamily: 'helvetica_neue_lt_std_roman',
165
- },
166
- itemCheckedIcon: {
167
- width: cx(32),
168
- height: cx(32),
169
- marginEnd: cx(4),
170
- },
171
- })
172
-
173
- export default PlugBehaviorPage
179
+ export default withTheme(PlugBehaviorPage)