@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
@@ -22,6 +22,7 @@ import { Result } from "@ledvance/base/src/models/modules/Result";
22
22
  import { useSystemTimeFormate } from "@ledvance/base/src/models/modules/NativePropsSlice";
23
23
 
24
24
  const { convertX: cx } = Utils.RatioUtils;
25
+ const { withTheme } = Utils.ThemeUtils
25
26
  const {parseTimer} = Utils.TimeUtils
26
27
 
27
28
  export interface RandomTimeDetailPageParams extends RandomTimePageParams {
@@ -30,7 +31,7 @@ export interface RandomTimeDetailPageParams extends RandomTimePageParams {
30
31
  onPost: (mode: 'add' | 'edit' | 'del', randomTime: RandomTimerUiItem) => Promise<Result<any>>
31
32
  }
32
33
  const minTimeGap = 30
33
- const RandomTimeDetailPage = () => {
34
+ const RandomTimeDetailPage = (props: { theme?: any }) => {
34
35
  const navigation = useNavigation()
35
36
  const params = useRoute().params as RandomTimeDetailPageParams
36
37
  const is24Hour = useSystemTimeFormate()
@@ -63,6 +64,35 @@ const RandomTimeDetailPage = () => {
63
64
  return state.randomTime.name?.length > 0 && state.randomTime.name?.length < 33 && !checkItemChanged && state.randomTime.channel !== undefined
64
65
  }, [JSON.stringify(state.randomTime), checkItemChanged])
65
66
 
67
+ const styles = StyleSheet.create({
68
+ cardContainer: {
69
+ marginHorizontal: cx(24)
70
+ },
71
+ itemTitle: {
72
+ color: props.theme.global.fontColor,
73
+ fontSize: cx(16),
74
+ fontWeight: 'bold',
75
+ fontFamily: 'helvetica_neue_lt_std_bd',
76
+ },
77
+ applyContent: {
78
+ backgroundColor: props.theme.container.background,
79
+ borderRadius: 4,
80
+ minHeight: cx(55),
81
+ flex: 1,
82
+ justifyContent: 'center',
83
+ paddingHorizontal: cx(10),
84
+ paddingTop: cx(10)
85
+ },
86
+ applyItem: {
87
+ paddingLeft: cx(5),
88
+ flexDirection: 'row',
89
+ justifyContent: 'space-between',
90
+ alignItems: 'center',
91
+ backgroundColor: props.theme.global.background,
92
+ height: cx(35),
93
+ },
94
+ })
95
+
66
96
  return (
67
97
  <Page
68
98
  backText={I18n.getLang('randomtimecycle_sockets_headline_text')}
@@ -122,7 +152,8 @@ const RandomTimeDetailPage = () => {
122
152
  {/* pick */}
123
153
  <TimerPicker
124
154
  itemTextColor='#aeadb5'
125
- style={{ paddingVertical: cx(0), marginVertical: cx(0) }}
155
+ style={{ paddingVertical: cx(0), marginVertical: cx(0), backgroundColor: props.theme.global.background }}
156
+ pickerFontColor={props.theme.global.fontColor}
126
157
  is12Hours={!is24Hour}
127
158
  startTime={state.randomTime.startTime}
128
159
  endTime={state.randomTime.endTime}
@@ -138,7 +169,9 @@ const RandomTimeDetailPage = () => {
138
169
  state.randomTime.weeks[rawIndex] = state.randomTime.weeks[rawIndex] === 1 ? 0 : 1
139
170
  }} />
140
171
  <Spacer />
141
- <Text style={styles.cardContainer}>{loopText(state.randomTime.weeks)}</Text>
172
+ <Text style={{ ...styles.cardContainer, color: props.theme.global.fontColor, fontSize: cx(14) }}>
173
+ {loopText(state.randomTime.weeks)}
174
+ </Text>
142
175
  <Spacer />
143
176
  {/* Apply for */}
144
177
  <View style={styles.cardContainer}>
@@ -146,15 +179,17 @@ const RandomTimeDetailPage = () => {
146
179
  <Spacer height={cx(10)} />
147
180
  <View style={[styles.applyContent, { paddingTop: state.randomTime.channel === undefined ? 0 : cx(10) }]}>
148
181
  {state.randomTime.channel === undefined ?
149
- <Text>{I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}</Text> :
182
+ <Text style={{color: props.theme.global.fontColor}}>
183
+ {I18n.getLang('timer_ceiling_fan_selectionfield_no_components_text')}
184
+ </Text> :
150
185
  <View style={[styles.applyItem, { marginBottom: cx(10), borderRadius: 4 }]}>
151
- <Text style={{ color: '#000', fontSize: cx(12) }}>{params.applyForList[params.isPlug ? state.randomTime.channel : 0]?.key}</Text>
186
+ <Text style={{ color: props.theme.global.fontColor, fontSize: cx(12) }}>{params.applyForList[params.isPlug ? state.randomTime.channel : 0]?.key}</Text>
152
187
  {params.applyForList.length > 1 && <TouchableOpacity
153
- onPress={() => {
154
- state.randomTime.channel = undefined
155
- }}
156
- style={{ paddingHorizontal: cx(5) }}>
157
- <Image style={{ width: cx(16), height: cx(16) }} source={res.ic_arrows_nav_clear} />
188
+ onPress={() => {
189
+ state.randomTime.channel = undefined
190
+ }}
191
+ style={{ paddingHorizontal: cx(5) }}>
192
+ <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor }} source={res.ic_arrows_nav_clear} />
158
193
  </TouchableOpacity>}
159
194
  </View>
160
195
  }
@@ -168,8 +203,8 @@ const RandomTimeDetailPage = () => {
168
203
  onPress={() => {
169
204
  state.randomTime.channel = params.isPlug ? index : 1
170
205
  }}>
171
- <Text style={{ color: '#000', fontSize: cx(12) }}>{item.key}</Text>
172
- <Image style={{ width: cx(16), height: cx(16) }} source={res.device_panel_timer_add} />
206
+ <Text style={{ color: props.theme.global.fontColor, fontSize: cx(12) }}>{item.key}</Text>
207
+ <Image style={{ width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor }} source={res.device_panel_timer_add} />
173
208
  </TouchableOpacity>
174
209
  )
175
210
  })}
@@ -177,52 +212,52 @@ const RandomTimeDetailPage = () => {
177
212
  <Spacer />
178
213
  {/* Devices */}
179
214
  {!!state.randomTime.color && !params.isPlug && <View style={styles.cardContainer}>
180
- <Text style={styles.itemTitle}>{I18n.getLang('timeschedule_add_schedule_subheadline2_text')}</Text>
181
- <Spacer height={cx(10)} />
182
- <Card>
183
- <LdvSwitch
184
- title={I18n.getLang('light_sources_tile_tw_lighting_headline')}
185
- color={'#fff'}
186
- colorAlpha={1}
187
- enable={true}
188
- setEnable={() => { }}
189
- showSwitch={false}
190
- />
191
- <LampAdjustView
192
- isSupportColor={!!params.isSupportColor}
193
- isSupportBrightness={!!params.isSupportBrightness}
194
- isSupportTemperature={!!params.isSupportTemperature}
195
- isColorMode={state.randomTime.isColorMode ?? false}
196
- reserveSV={true}
197
- setIsColorMode={(v) => state.randomTime.isColorMode = v}
198
- h={state.randomTime.color.h}
199
- s={state.randomTime.color.s}
200
- v={state.randomTime.color.v}
201
- colorTemp={state.randomTime.color.temperature}
202
- brightness={state.randomTime.color.brightness}
203
- onHSVChangeComplete={(h, s, v) => {
204
- state.randomTime.color = {
205
- ...state.randomTime.color,
206
- h,
207
- s,
208
- v
209
- }
210
- }}
211
- onCCTChangeComplete={(v) => {
212
- state.randomTime.color = {
213
- ...state.randomTime.color,
214
- temperature: v
215
- }
216
- }}
217
- onBrightnessChangeComplete={(v) => {
218
- state.randomTime.color = {
219
- ...state.randomTime.color,
220
- brightness: v
221
- }
222
- }}
223
- />
224
- </Card>
225
- <Spacer />
215
+ <Text style={styles.itemTitle}>{I18n.getLang('timeschedule_add_schedule_subheadline2_text')}</Text>
216
+ <Spacer height={cx(10)} />
217
+ <Card>
218
+ <LdvSwitch
219
+ title={I18n.getLang('light_sources_tile_tw_lighting_headline')}
220
+ color={props.theme.card.background}
221
+ colorAlpha={1}
222
+ enable={true}
223
+ setEnable={() => { }}
224
+ showSwitch={false}
225
+ />
226
+ <LampAdjustView
227
+ isSupportColor={!!params.isSupportColor}
228
+ isSupportBrightness={!!params.isSupportBrightness}
229
+ isSupportTemperature={!!params.isSupportTemperature}
230
+ isColorMode={state.randomTime.isColorMode ?? false}
231
+ reserveSV={true}
232
+ setIsColorMode={(v) => state.randomTime.isColorMode = v}
233
+ h={state.randomTime.color.h}
234
+ s={state.randomTime.color.s}
235
+ v={state.randomTime.color.v}
236
+ colorTemp={state.randomTime.color.temperature}
237
+ brightness={state.randomTime.color.brightness}
238
+ onHSVChangeComplete={(h, s, v) => {
239
+ state.randomTime.color = {
240
+ ...state.randomTime.color,
241
+ h,
242
+ s,
243
+ v
244
+ }
245
+ }}
246
+ onCCTChangeComplete={(v) => {
247
+ state.randomTime.color = {
248
+ ...state.randomTime.color,
249
+ temperature: v
250
+ }
251
+ }}
252
+ onBrightnessChangeComplete={(v) => {
253
+ state.randomTime.color = {
254
+ ...state.randomTime.color,
255
+ brightness: v
256
+ }
257
+ }}
258
+ />
259
+ </Card>
260
+ <Spacer />
226
261
  </View>}
227
262
  {/* summary */}
228
263
  <Summary
@@ -232,26 +267,26 @@ const RandomTimeDetailPage = () => {
232
267
  />
233
268
  <Spacer />
234
269
  {params.mode === 'edit' &&
235
- <View style={{ marginHorizontal: cx(24) }}>
236
- <DeleteButton
237
- text={I18n.getLang('edit_fixedtimecycle_bttn_text')}
238
- onPress={() => {
239
- showDialog({
240
- method: 'confirm',
241
- title: I18n.getLang('cancel_dialog_delete_item_randomtimecycle_titel'),
242
- subTitle: I18n.getLang('cancel_dialog_delete_item_fixedtimecycle_description'),
243
- onConfirm: async (_, { close }) => {
244
- close()
245
- state.loading = true
246
- const res = await params.onPost('del', state.randomTime)
247
- state.loading = false
248
- if (res.success) {
249
- navigation.goBack()
250
- }
251
- }
252
- })
253
- }} />
254
- </View>
270
+ <View style={{ marginHorizontal: cx(24) }}>
271
+ <DeleteButton
272
+ text={I18n.getLang('edit_fixedtimecycle_bttn_text')}
273
+ onPress={() => {
274
+ showDialog({
275
+ method: 'confirm',
276
+ title: I18n.getLang('cancel_dialog_delete_item_randomtimecycle_titel'),
277
+ subTitle: I18n.getLang('cancel_dialog_delete_item_fixedtimecycle_description'),
278
+ onConfirm: async (_, { close }) => {
279
+ close()
280
+ state.loading = true
281
+ const res = await params.onPost('del', state.randomTime)
282
+ state.loading = false
283
+ if (res.success) {
284
+ navigation.goBack()
285
+ }
286
+ }
287
+ })
288
+ }} />
289
+ </View>
255
290
  }
256
291
  <Spacer />
257
292
  </ScrollView>
@@ -259,76 +294,4 @@ const RandomTimeDetailPage = () => {
259
294
  )
260
295
  }
261
296
 
262
-
263
- const styles = StyleSheet.create({
264
- cardContainer: {
265
- marginHorizontal: cx(24)
266
- },
267
- itemTitle: {
268
- color: '#000',
269
- fontSize: cx(16),
270
- fontWeight: 'bold',
271
- fontFamily: 'helvetica_neue_lt_std_bd',
272
- },
273
- applyContent: {
274
- backgroundColor: '#f6f6f6',
275
- borderRadius: 4,
276
- minHeight: cx(55),
277
- flex: 1,
278
- justifyContent: 'center',
279
- paddingHorizontal: cx(10),
280
- paddingTop: cx(10)
281
- },
282
- applyItem: {
283
- paddingLeft: cx(5),
284
- flexDirection: 'row',
285
- justifyContent: 'space-between',
286
- alignItems: 'center',
287
- backgroundColor: '#fff',
288
- height: cx(35),
289
- },
290
- summaryContainer: {
291
- flexDirection: 'row',
292
- justifyContent: 'flex-start',
293
- marginBottom: cx(10)
294
- },
295
- summaryLeft: {
296
- flexDirection: 'row',
297
- justifyContent: 'flex-start',
298
- alignItems: 'center',
299
- },
300
- summaryImg: {
301
- width: cx(12),
302
- height: cx(12),
303
- marginRight: cx(6)
304
- },
305
- leftTitle: {
306
- fontSize: cx(14),
307
- color: '#000'
308
- },
309
- summaryRight: {
310
- flexDirection: 'column',
311
- marginLeft: cx(21),
312
- borderRadius: cx(16),
313
- backgroundColor: '#cbcbcb',
314
- },
315
- rightItem: {
316
- paddingHorizontal: cx(12),
317
- color: '#000',
318
- },
319
- rightTitle: {
320
- paddingLeft: cx(12),
321
- paddingRight: cx(12),
322
- fontSize: cx(10),
323
- textAlign: 'center',
324
- alignSelf: 'flex-start'
325
- },
326
- filletCorner: {
327
- flexDirection: 'row',
328
- backgroundColor: '#cbcbcb',
329
- borderRadius: cx(16),
330
- alignSelf: 'flex-start'
331
- }
332
- })
333
-
334
- export default RandomTimeDetailPage
297
+ export default withTheme(RandomTimeDetailPage)
@@ -15,12 +15,13 @@ import Card from '@ledvance/base/src/components/Card'
15
15
  import { convertMinutesTo12HourFormat, loopText } from '@ledvance/base/src/utils/common'
16
16
  import { cloneDeep } from 'lodash'
17
17
  import dayjs from 'dayjs'
18
- import { ApplyForItem } from '@ledvance/ui-biz-bundle/src/newModules/timeSchedule/Interface'
18
+ import { ApplyForItem } from '@ledvance/base/src/utils/interface'
19
19
  import { useParams } from '@ledvance/base/src/hooks/Hooks'
20
20
  import Tag from '@ledvance/base/src/components/Tag'
21
21
  import InfoText from '@ledvance/base/src/components/InfoText'
22
22
 
23
23
  const { convertX: cx } = Utils.RatioUtils
24
+ const { withTheme } = Utils.ThemeUtils
24
25
  const { parseTimer } = Utils.TimeUtils
25
26
 
26
27
  export interface RandomTimePageParams {
@@ -29,7 +30,7 @@ export interface RandomTimePageParams {
29
30
  fixedTimeDpCode?: string
30
31
  biorhythmDpCode?: string
31
32
  sleepDpCode?: string
32
- wakeUpDpCode?: string
33
+ wakeUpDpCode?: string
33
34
  }
34
35
  isPlug?: boolean
35
36
  showTags?: boolean
@@ -39,7 +40,7 @@ export interface RandomTimePageParams {
39
40
  isSupportBrightness?: boolean
40
41
  }
41
42
 
42
- const RandomTimePage = () => {
43
+ const RandomTimePage = (props: { theme?: any }) => {
43
44
  const navigation = useNavigation()
44
45
  const devInfo = useDeviceInfo()
45
46
  const params = useParams<RandomTimePageParams>()
@@ -93,6 +94,56 @@ const RandomTimePage = () => {
93
94
  return res
94
95
  }, [state.originList])
95
96
 
97
+
98
+ const styles = StyleSheet.create({
99
+ randomTimingCard: {
100
+ marginHorizontal: cx(24),
101
+ paddingHorizontal: cx(16),
102
+ },
103
+ switchLine: {
104
+ flexDirection: 'row',
105
+ alignItems: 'center',
106
+ },
107
+ time: {
108
+ flex: 1,
109
+ color: props.theme.global.fontColor,
110
+ fontSize: cx(16),
111
+ fontWeight: 'bold',
112
+ fontFamily: 'helvetica_neue_lt_std_bd',
113
+ },
114
+ switchBtn: {},
115
+ loopText: {
116
+ color: props.theme.global.fontColor,
117
+ fontSize: cx(14),
118
+ fontFamily: 'helvetica_neue_lt_std_roman',
119
+ },
120
+ categoryList: {
121
+ display: 'flex',
122
+ flexDirection: 'row',
123
+ flexWrap: 'wrap',
124
+ marginHorizontal: cx(24),
125
+ alignSelf: 'flex-start'
126
+ },
127
+ tagContainer: {
128
+ flexDirection: 'row',
129
+ marginBottom: cx(15)
130
+ },
131
+ tag: {
132
+ borderRadius: cx(16),
133
+ height: cx(16),
134
+ backgroundColor: props.theme.tag.background,
135
+ marginRight: cx(10),
136
+ paddingHorizontal: cx(12)
137
+ },
138
+ tagTitle: {
139
+ fontSize: cx(10),
140
+ textAlign: 'center',
141
+ fontFamily: 'PingFangSC-Medium',
142
+ color: props.theme.tag.fontColor
143
+ },
144
+ })
145
+
146
+
96
147
  const showTags = useMemo(() => (
97
148
  <View style={styles.categoryList}>
98
149
  {state.checkTags.map((tag, idx) => (
@@ -123,70 +174,71 @@ const RandomTimePage = () => {
123
174
  >
124
175
  <ScrollView nestedScrollEnabled={true}>
125
176
  <Text style={{
126
- color: '#000',
177
+ color: props.theme.global.fontColor,
127
178
  marginLeft: cx(24),
128
179
  }}>{I18n.getLang('timeschedule_overview_description_text')}</Text>
129
180
  <Spacer height={cx(10)} />
130
- {showMaxNumTip() && <InfoText
131
- style={{ marginHorizontal: cx(24), marginBottom: cx(5) }}
132
- icon={res.ic_warning_amber}
133
- iconStyle={{width: cx(16), height: cx(16)}}
134
- contentColor="#FF9500"
135
- text={I18n.getLang('randomtimecycle_warning_max_number_text')}
136
- textStyle={{fontSize: cx(12)}}
181
+ {showMaxNumTip() && <InfoText
182
+ style={{ marginHorizontal: cx(24), marginBottom: cx(5) }}
183
+ icon={res.ic_warning_amber}
184
+ iconStyle={{width: cx(16), height: cx(16)}}
185
+ contentColor={props.theme.global.warning}
186
+ text={I18n.getLang('randomtimecycle_warning_max_number_text')}
187
+ textStyle={{fontSize: cx(12)}}
137
188
  />}
138
189
  {params.showTags && !!state.originList.length && showTags}
139
190
  {state.randomTimeList.length > 0 ? <FlatList
140
- data={state.randomTimeList}
141
- renderItem={({ item }) => (
142
- <RandomTimeCard
143
- is24Hour={is24Hour}
144
- randomTime={item}
145
- showTags={params.showTags}
146
- tags={params.applyForList}
147
- onSwitch={async (v) => {
148
- state.loading = true
149
- await onPost('edit', {
150
- ...item,
151
- enable: v,
152
- })
153
- state.loading = false
154
- }}
155
- onPress={() => {
156
- navigateToEdit('edit', item)
157
- }}
158
- />
159
- )}
160
- keyExtractor={(item: any) => `${item?.index}`}
161
- ItemSeparatorComponent={() => <Spacer />}
162
- ListHeaderComponent={<Spacer height={cx(10)} />}
163
- ListFooterComponent={<Spacer />}
164
- /> :
191
+ data={state.randomTimeList}
192
+ renderItem={({ item }) => (
193
+ <RandomTimeCard
194
+ styles={styles}
195
+ is24Hour={is24Hour}
196
+ randomTime={item}
197
+ showTags={params.showTags}
198
+ tags={params.applyForList}
199
+ onSwitch={async (v) => {
200
+ state.loading = true
201
+ await onPost('edit', {
202
+ ...item,
203
+ enable: v,
204
+ })
205
+ state.loading = false
206
+ }}
207
+ onPress={() => {
208
+ navigateToEdit('edit', item)
209
+ }}
210
+ />
211
+ )}
212
+ keyExtractor={(item: any) => `${item?.index}`}
213
+ ItemSeparatorComponent={() => <Spacer />}
214
+ ListHeaderComponent={<Spacer height={cx(10)} />}
215
+ ListFooterComponent={<Spacer />}
216
+ /> :
165
217
  <View style={{ flex: 1, marginTop: cx(60), alignItems: 'center', marginHorizontal: cx(24) }}>
166
218
  <Image
167
219
  style={{ width: cx(225), height: cx(198) }}
168
220
  source={{ uri: res.ldv_timer_empty }}
169
221
  resizeMode="contain" />
170
- <InfoText
222
+ <InfoText
171
223
  icon={res.device_panel_schedule_alert}
172
224
  text={I18n.getLang(!state.originList.length ? 'timeschedule_overview_empty_information_text' : 'sleepwakeschedule_empty_filtering_information_text')}
173
225
  style={{ width: 'auto', alignItems: 'center' }}
174
- textStyle={{ color: '#000', fontSize: cx(12), flex: undefined }}
175
- iconStyle={{ width: cx(16), height: cx(16), tintColor: '#000' }}
226
+ textStyle={{ color: props.theme.global.secondFontColor, fontSize: cx(12), flex: undefined }}
227
+ iconStyle={{ width: cx(16), height: cx(16), tintColor: props.theme.global.secondFontColor }}
176
228
  />
177
229
  <Spacer />
178
230
  {!state.originList.length && <TextButton
179
- text={I18n.getLang('randomtimecycle_empty_bttn_text')}
180
- style={{
181
- backgroundColor: '#f60',
182
- borderRadius: cx(6),
183
- paddingVertical: cx(12),
184
- paddingHorizontal: cx(24),
185
- }}
186
- textStyle={{ color: '#fff' }}
187
- onPress={() => {
188
- navigateToEdit('add', newRandomTime(params.isPlug))
189
- }} />}
231
+ text={I18n.getLang('randomtimecycle_empty_bttn_text')}
232
+ style={{
233
+ backgroundColor: props.theme.button.primary,
234
+ borderRadius: cx(6),
235
+ paddingVertical: cx(12),
236
+ paddingHorizontal: cx(24),
237
+ }}
238
+ textStyle={{ color: props.theme.button.fontColor }}
239
+ onPress={() => {
240
+ navigateToEdit('add', newRandomTime(params.isPlug))
241
+ }} />}
190
242
  </View>}
191
243
  </ScrollView>
192
244
  </Page>
@@ -194,6 +246,7 @@ const RandomTimePage = () => {
194
246
  }
195
247
 
196
248
  const RandomTimeCard = (props: {
249
+ styles: StyleSheet.NamedStyles<any>
197
250
  is24Hour: boolean
198
251
  randomTime: RandomTimerUiItem,
199
252
  tags: ApplyForItem[]
@@ -201,7 +254,7 @@ const RandomTimeCard = (props: {
201
254
  onSwitch: (enable: boolean) => void,
202
255
  onPress: () => void
203
256
  }) => {
204
- const { is24Hour, randomTime, tags, showTags, onSwitch, onPress } = props
257
+ const { is24Hour, randomTime, tags, showTags, onSwitch, onPress, styles } = props
205
258
  return (
206
259
  <Card style={styles.randomTimingCard} onPress={onPress}>
207
260
  <Spacer height={cx(16)} />
@@ -219,11 +272,11 @@ const RandomTimeCard = (props: {
219
272
  <Text style={styles.loopText}>{randomTime.name}</Text>
220
273
  <Spacer height={cx(showTags ? 5 : 20)} />
221
274
  {showTags && <View style={styles.tagContainer}>
222
- <View style={styles.tag}>
223
- <Text style={styles.tagTitle}>
224
- {tags[randomTime.channel || 0]?.key}
225
- </Text>
226
- </View>
275
+ <View style={styles.tag}>
276
+ <Text style={styles.tagTitle}>
277
+ {tags[randomTime.channel || 0]?.key}
278
+ </Text>
279
+ </View>
227
280
  </View>}
228
281
  </Card>
229
282
  )
@@ -248,52 +301,4 @@ const newRandomTime = (isPlug?: boolean) => {
248
301
  }
249
302
  }
250
303
 
251
- const styles = StyleSheet.create({
252
- randomTimingCard: {
253
- marginHorizontal: cx(24),
254
- paddingHorizontal: cx(16),
255
- },
256
- switchLine: {
257
- flexDirection: 'row',
258
- alignItems: 'center',
259
- },
260
- time: {
261
- flex: 1,
262
- color: '#000',
263
- fontSize: cx(16),
264
- fontWeight: 'bold',
265
- fontFamily: 'helvetica_neue_lt_std_bd',
266
- },
267
- switchBtn: {},
268
- loopText: {
269
- color: '#000',
270
- fontSize: cx(14),
271
- fontFamily: 'helvetica_neue_lt_std_roman',
272
- },
273
- categoryList: {
274
- display: 'flex',
275
- flexDirection: 'row',
276
- flexWrap: 'wrap',
277
- marginHorizontal: cx(24),
278
- alignSelf: 'flex-start'
279
- },
280
- tagContainer: {
281
- flexDirection: 'row',
282
- marginBottom: cx(15)
283
- },
284
- tag: {
285
- borderRadius: cx(16),
286
- height: cx(16),
287
- backgroundColor: '#E6E7E8',
288
- marginRight: cx(10),
289
- paddingHorizontal: cx(12)
290
- },
291
- tagTitle: {
292
- fontSize: cx(10),
293
- textAlign: 'center',
294
- fontFamily: 'PingFangSC-Medium',
295
- color: '#000'
296
- },
297
- })
298
-
299
- export default RandomTimePage
304
+ export default withTheme(RandomTimePage)