@ledvance/ui-biz-bundle 1.1.90 → 1.1.92
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/modules/flags/FlagEditPage.tsx +180 -179
- package/src/modules/flags/FlagItem.tsx +26 -42
- package/src/modules/flags/FlagPage.tsx +27 -26
- package/src/modules/history/HistoryPage.tsx +111 -103
- package/src/modules/music/MusicPage.tsx +90 -88
- package/src/modules/timer/TimerPage.tsx +13 -9
- package/src/newModules/biorhythm/BiorhythmEditPage.tsx +54 -54
- package/src/newModules/biorhythm/BiorhythmPage.tsx +163 -162
- package/src/newModules/biorhythm/IconSelect.tsx +5 -4
- package/src/newModules/childLock/ChildLockPage.tsx +49 -47
- package/src/newModules/energyConsumption/component/EnergyModal.tsx +2 -2
- package/src/newModules/fixedTime/FixedTimeDetailPage.tsx +127 -124
- package/src/newModules/fixedTime/FixedTimePage.tsx +108 -104
- package/src/newModules/lightMode/LightModePage.tsx +74 -67
- package/src/newModules/mood/AddMoodPage.tsx +18 -15
- package/src/newModules/mood/DynamicMoodEditorPage.tsx +103 -100
- package/src/newModules/mood/MixDynamicMoodEditor.tsx +107 -104
- package/src/newModules/mood/MoodItem.tsx +59 -55
- package/src/newModules/mood/MoodPage.tsx +58 -57
- package/src/newModules/mood/RecommendMoodItem.tsx +27 -24
- package/src/newModules/mood/StaticMoodEditorPage.tsx +77 -85
- package/src/newModules/overchargeSwitch/OverchargeSwitchPage.tsx +36 -48
- package/src/newModules/powerOnBehavior/LightBehaviorPage.tsx +137 -135
- package/src/newModules/powerOnBehavior/PlugBehaviorPage.tsx +67 -61
- package/src/newModules/randomTime/RandomTimeDetailPage.tsx +114 -151
- package/src/newModules/randomTime/RandomTimePage.tsx +110 -105
- package/src/newModules/randomTime/Summary.tsx +61 -57
- package/src/newModules/remoteControl/RemoteControlPage.tsx +4 -3
- package/src/newModules/select/SelectPage.tsx +65 -62
- package/src/newModules/sleepWakeUp/SleepWakeUpActions.ts +16 -8
- package/src/newModules/sleepWakeUp/SleepWakeUpDetailPage.tsx +131 -123
- package/src/newModules/sleepWakeUp/SleepWakeUpPage.tsx +144 -140
- package/src/newModules/switchGradient/SwitchGradientPage.tsx +24 -25
- package/src/newModules/swithInching/SwithInching.tsx +154 -152
- package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +83 -83
- package/src/newModules/timeSchedule/components/ManuaSettings.tsx +3 -2
- package/src/newModules/swithInching/pickerView.tsx +0 -91
|
@@ -21,14 +21,15 @@ 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
|
-
|
|
24
|
+
const { withTheme } = Utils.ThemeUtils
|
|
25
|
+
const {parseTimer} = Utils.TimeUtils
|
|
25
26
|
export interface FixedTimePageParams {
|
|
26
27
|
fixedTimeDpCode: string
|
|
27
28
|
conflictDps: {
|
|
28
29
|
randomTimeDpCode?: string
|
|
29
30
|
biorhythmDpCode?: string
|
|
30
31
|
sleepDpCode?: string
|
|
31
|
-
wakeUpDpCode?: string
|
|
32
|
+
wakeUpDpCode?: string
|
|
32
33
|
}
|
|
33
34
|
isPlug?: boolean
|
|
34
35
|
showTags?: boolean
|
|
@@ -38,7 +39,7 @@ export interface FixedTimePageParams {
|
|
|
38
39
|
isSupportBrightness?: boolean
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
const FixedTimePage = () => {
|
|
42
|
+
const FixedTimePage = (props: { theme?: any }) => {
|
|
42
43
|
const navigation = useNavigation()
|
|
43
44
|
const devInfo = useDeviceInfo()
|
|
44
45
|
const params = useParams<FixedTimePageParams>()
|
|
@@ -92,6 +93,55 @@ const FixedTimePage = () => {
|
|
|
92
93
|
return res
|
|
93
94
|
}, [state.originList])
|
|
94
95
|
|
|
96
|
+
|
|
97
|
+
const styles = StyleSheet.create({
|
|
98
|
+
randomTimingCard: {
|
|
99
|
+
marginHorizontal: cx(24),
|
|
100
|
+
paddingHorizontal: cx(16),
|
|
101
|
+
},
|
|
102
|
+
switchLine: {
|
|
103
|
+
flexDirection: 'row',
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
},
|
|
106
|
+
time: {
|
|
107
|
+
flex: 1,
|
|
108
|
+
color: props.theme.global.fontColor,
|
|
109
|
+
fontSize: cx(16),
|
|
110
|
+
fontWeight: 'bold',
|
|
111
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
112
|
+
},
|
|
113
|
+
switchBtn: {},
|
|
114
|
+
loopText: {
|
|
115
|
+
color: props.theme.global.fontColor,
|
|
116
|
+
fontSize: cx(14),
|
|
117
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
118
|
+
},
|
|
119
|
+
categoryList: {
|
|
120
|
+
display: 'flex',
|
|
121
|
+
flexDirection: 'row',
|
|
122
|
+
flexWrap: 'wrap',
|
|
123
|
+
marginHorizontal: cx(24),
|
|
124
|
+
alignSelf: 'flex-start'
|
|
125
|
+
},
|
|
126
|
+
tagContainer: {
|
|
127
|
+
flexDirection: 'row',
|
|
128
|
+
marginBottom: cx(15)
|
|
129
|
+
},
|
|
130
|
+
tag: {
|
|
131
|
+
borderRadius: cx(16),
|
|
132
|
+
height: cx(16),
|
|
133
|
+
backgroundColor: props.theme.tag.background,
|
|
134
|
+
marginRight: cx(10),
|
|
135
|
+
paddingHorizontal: cx(12)
|
|
136
|
+
},
|
|
137
|
+
tagTitle: {
|
|
138
|
+
fontSize: cx(10),
|
|
139
|
+
textAlign: 'center',
|
|
140
|
+
fontFamily: 'PingFangSC-Medium',
|
|
141
|
+
color: props.theme.tag.fontColor,
|
|
142
|
+
},
|
|
143
|
+
})
|
|
144
|
+
|
|
95
145
|
const showTags = useMemo(() => (
|
|
96
146
|
<View style={styles.categoryList}>
|
|
97
147
|
{state.checkTags.map((tag, idx) => (
|
|
@@ -122,46 +172,47 @@ const FixedTimePage = () => {
|
|
|
122
172
|
>
|
|
123
173
|
<ScrollView nestedScrollEnabled={true}>
|
|
124
174
|
<Text style={{
|
|
125
|
-
color:
|
|
175
|
+
color: props.theme.global.fontColor,
|
|
126
176
|
marginLeft: cx(24),
|
|
127
177
|
fontSize: cx(12)
|
|
128
178
|
}}>{I18n.getLang('timeschedule_overview_description_text')}</Text>
|
|
129
179
|
<Spacer height={cx(10)} />
|
|
130
180
|
{showMaxNumTip() && <InfoText
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
181
|
+
style={{ marginHorizontal: cx(24), marginBottom: cx(5) }}
|
|
182
|
+
icon={res.ic_warning_amber}
|
|
183
|
+
iconStyle={{ width: cx(16), height: cx(16) }}
|
|
184
|
+
contentColor="#FF9500"
|
|
185
|
+
text={I18n.getLang('fixedtimecycle_warning_max_number_text')}
|
|
186
|
+
textStyle={{ fontSize: cx(12) }}
|
|
137
187
|
/>}
|
|
138
188
|
{params.showTags && !!state.originList.length && showTags}
|
|
139
189
|
{state.fixedTimeList.length > 0 ? <FlatList
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
190
|
+
data={state.fixedTimeList}
|
|
191
|
+
renderItem={({ item }) => (
|
|
192
|
+
<FixedTimeCard
|
|
193
|
+
styles={styles}
|
|
194
|
+
is24Hour={is24Hour}
|
|
195
|
+
fixedTime={item}
|
|
196
|
+
showTags={params.showTags}
|
|
197
|
+
tags={params.applyForList}
|
|
198
|
+
onSwitch={async (v) => {
|
|
199
|
+
state.loading = true
|
|
200
|
+
await onPost('edit', {
|
|
201
|
+
...item,
|
|
202
|
+
enable: v
|
|
203
|
+
})
|
|
204
|
+
state.loading = false
|
|
205
|
+
}}
|
|
206
|
+
onPress={() => {
|
|
207
|
+
navigateToEdit('edit', item)
|
|
208
|
+
}}
|
|
209
|
+
/>
|
|
210
|
+
)}
|
|
211
|
+
keyExtractor={(item: any) => `${item?.index}`}
|
|
212
|
+
ItemSeparatorComponent={() => <Spacer />}
|
|
213
|
+
ListHeaderComponent={<Spacer height={cx(10)} />}
|
|
214
|
+
ListFooterComponent={<Spacer />}
|
|
215
|
+
/> :
|
|
165
216
|
<View style={{ flex: 1, marginTop: cx(60), alignItems: 'center', marginHorizontal: cx(24) }}>
|
|
166
217
|
<Image
|
|
167
218
|
style={{ width: cx(225), height: cx(198) }}
|
|
@@ -171,22 +222,22 @@ const FixedTimePage = () => {
|
|
|
171
222
|
icon={res.device_panel_schedule_alert}
|
|
172
223
|
text={I18n.getLang(!state.originList.length ? 'fixedTimeCycle_information_text' : 'fixedTimeCycle_empty_filtering_information_text')}
|
|
173
224
|
style={{ width: 'auto', alignItems: 'center' }}
|
|
174
|
-
textStyle={{ color:
|
|
175
|
-
iconStyle={{ width: cx(16), height: cx(16), tintColor:
|
|
225
|
+
textStyle={{ color: props.theme.global.fontColor, fontSize: cx(12), flex: undefined }}
|
|
226
|
+
iconStyle={{ width: cx(16), height: cx(16), tintColor: props.theme.global.fontColor, }}
|
|
176
227
|
/>
|
|
177
228
|
<Spacer />
|
|
178
229
|
{!state.originList.length && <TextButton
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
230
|
+
text={I18n.getLang('fixedTimeCycle_bttn_text')}
|
|
231
|
+
style={{
|
|
232
|
+
backgroundColor: props.theme.button.primary,
|
|
233
|
+
borderRadius: cx(6),
|
|
234
|
+
paddingVertical: cx(12),
|
|
235
|
+
paddingHorizontal: cx(24),
|
|
236
|
+
}}
|
|
237
|
+
textStyle={{ color: props.theme.button.fontColor, }}
|
|
238
|
+
onPress={() => {
|
|
239
|
+
navigateToEdit('add', newFixedTime(!!params.isPlug))
|
|
240
|
+
}} />}
|
|
190
241
|
</View>}
|
|
191
242
|
</ScrollView>
|
|
192
243
|
|
|
@@ -201,8 +252,9 @@ const FixedTimeCard = memo((props: {
|
|
|
201
252
|
showTags?: boolean,
|
|
202
253
|
onSwitch: (enable: boolean) => void,
|
|
203
254
|
onPress: () => void
|
|
255
|
+
styles: StyleSheet.NamedStyles<any>
|
|
204
256
|
}) => {
|
|
205
|
-
const { is24Hour, fixedTime, tags, showTags, onSwitch, onPress } = props
|
|
257
|
+
const { is24Hour, fixedTime, tags, showTags, onSwitch, onPress, styles } = props
|
|
206
258
|
return (
|
|
207
259
|
<Card style={styles.randomTimingCard} onPress={onPress}>
|
|
208
260
|
<Spacer height={cx(16)} />
|
|
@@ -215,16 +267,16 @@ const FixedTimeCard = memo((props: {
|
|
|
215
267
|
thumbStyle={{ elevation: 0 }}
|
|
216
268
|
onValueChange={onSwitch} />
|
|
217
269
|
</View>
|
|
218
|
-
<Text style={styles.loopText}>{loopText(fixedTime.weeks)}</Text>
|
|
270
|
+
<Text style={styles.loopText}>{loopText(fixedTime.weeks, parseTimer(fixedTime.endTime * 60))}</Text>
|
|
219
271
|
<Spacer height={cx(5)} />
|
|
220
272
|
<Text style={styles.loopText}>{fixedTime.name}</Text>
|
|
221
273
|
<Spacer height={cx(showTags ? 5 : 20)} />
|
|
222
274
|
{showTags && <View style={styles.tagContainer}>
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
275
|
+
<View style={styles.tag}>
|
|
276
|
+
<Text style={styles.tagTitle}>
|
|
277
|
+
{tags[fixedTime.channel || 0]?.key}
|
|
278
|
+
</Text>
|
|
279
|
+
</View>
|
|
228
280
|
</View>}
|
|
229
281
|
</Card>
|
|
230
282
|
)
|
|
@@ -251,52 +303,4 @@ const newFixedTime = (isPlug: boolean) => {
|
|
|
251
303
|
}
|
|
252
304
|
}
|
|
253
305
|
|
|
254
|
-
|
|
255
|
-
randomTimingCard: {
|
|
256
|
-
marginHorizontal: cx(24),
|
|
257
|
-
paddingHorizontal: cx(16),
|
|
258
|
-
},
|
|
259
|
-
switchLine: {
|
|
260
|
-
flexDirection: 'row',
|
|
261
|
-
alignItems: 'center',
|
|
262
|
-
},
|
|
263
|
-
time: {
|
|
264
|
-
flex: 1,
|
|
265
|
-
color: '#000',
|
|
266
|
-
fontSize: cx(16),
|
|
267
|
-
fontWeight: 'bold',
|
|
268
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
269
|
-
},
|
|
270
|
-
switchBtn: {},
|
|
271
|
-
loopText: {
|
|
272
|
-
color: '#000',
|
|
273
|
-
fontSize: cx(14),
|
|
274
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
275
|
-
},
|
|
276
|
-
categoryList: {
|
|
277
|
-
display: 'flex',
|
|
278
|
-
flexDirection: 'row',
|
|
279
|
-
flexWrap: 'wrap',
|
|
280
|
-
marginHorizontal: cx(24),
|
|
281
|
-
alignSelf: 'flex-start'
|
|
282
|
-
},
|
|
283
|
-
tagContainer: {
|
|
284
|
-
flexDirection: 'row',
|
|
285
|
-
marginBottom: cx(15)
|
|
286
|
-
},
|
|
287
|
-
tag: {
|
|
288
|
-
borderRadius: cx(16),
|
|
289
|
-
height: cx(16),
|
|
290
|
-
backgroundColor: '#E6E7E8',
|
|
291
|
-
marginRight: cx(10),
|
|
292
|
-
paddingHorizontal: cx(12)
|
|
293
|
-
},
|
|
294
|
-
tagTitle: {
|
|
295
|
-
fontSize: cx(10),
|
|
296
|
-
textAlign: 'center',
|
|
297
|
-
fontFamily: 'PingFangSC-Medium',
|
|
298
|
-
color: '#000'
|
|
299
|
-
},
|
|
300
|
-
})
|
|
301
|
-
|
|
302
|
-
export default FixedTimePage
|
|
306
|
+
export default withTheme(FixedTimePage)
|
|
@@ -12,6 +12,7 @@ import { useParams } from '@ledvance/base/src/hooks/Hooks'
|
|
|
12
12
|
import {Result} from "@ledvance/base/src/models/modules/Result";
|
|
13
13
|
|
|
14
14
|
const { convertX: cx } = Utils.RatioUtils
|
|
15
|
+
const { withTheme } = Utils.ThemeUtils
|
|
15
16
|
|
|
16
17
|
const LIGHT_MODE_RELAY = 'relay'
|
|
17
18
|
const LIGHT_MODE_POS = 'pos'
|
|
@@ -28,7 +29,7 @@ export const useLightMode = (code: string): [LightMode, (v: LightMode) => Promis
|
|
|
28
29
|
return useDp(code)
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
const LightModePage = () => {
|
|
32
|
+
const LightModePage = (props: { theme?: any }) => {
|
|
32
33
|
const params = useParams<LightModePageParams>()
|
|
33
34
|
const deviceInfo = useDeviceInfo()
|
|
34
35
|
const [lightMode, setLightMode] = useLightMode(params.lightModeCode)
|
|
@@ -42,6 +43,71 @@ const LightModePage = () => {
|
|
|
42
43
|
state.lightMode = lightMode
|
|
43
44
|
}, [lightMode])
|
|
44
45
|
|
|
46
|
+
const styles = StyleSheet.create({
|
|
47
|
+
root: {
|
|
48
|
+
flex: 1,
|
|
49
|
+
},
|
|
50
|
+
desc: {
|
|
51
|
+
marginHorizontal: cx(24),
|
|
52
|
+
color: props.theme.global.fontColor,
|
|
53
|
+
fontSize: cx(14),
|
|
54
|
+
fontWeight: 'bold',
|
|
55
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
56
|
+
},
|
|
57
|
+
tipText: {
|
|
58
|
+
marginHorizontal: cx(24),
|
|
59
|
+
color: props.theme.global.fontColor,
|
|
60
|
+
fontSize: cx(14),
|
|
61
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
62
|
+
},
|
|
63
|
+
modeSelectGroup: {
|
|
64
|
+
marginHorizontal: cx(24),
|
|
65
|
+
backgroundColor: props.theme.container.background,
|
|
66
|
+
borderRadius: cx(4),
|
|
67
|
+
},
|
|
68
|
+
modeTip: {
|
|
69
|
+
marginHorizontal: cx(8),
|
|
70
|
+
color: props.theme.global.fontColor,
|
|
71
|
+
fontSize: cx(14),
|
|
72
|
+
fontWeight: 'bold',
|
|
73
|
+
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
74
|
+
},
|
|
75
|
+
modeSelectCard: {
|
|
76
|
+
marginHorizontal: cx(8),
|
|
77
|
+
},
|
|
78
|
+
line: {
|
|
79
|
+
height: cx(1),
|
|
80
|
+
marginHorizontal: cx(12),
|
|
81
|
+
backgroundColor: props.theme.container.divider,
|
|
82
|
+
},
|
|
83
|
+
itemRoot: {
|
|
84
|
+
flexDirection: 'row',
|
|
85
|
+
alignItems: 'center',
|
|
86
|
+
paddingHorizontal: cx(12),
|
|
87
|
+
paddingBottom: cx(8),
|
|
88
|
+
},
|
|
89
|
+
itemTextGroup: {
|
|
90
|
+
flex: 1,
|
|
91
|
+
marginEnd: cx(12),
|
|
92
|
+
justifyContent: 'center',
|
|
93
|
+
},
|
|
94
|
+
itemTitle: {
|
|
95
|
+
color: props.theme.global.fontColor,
|
|
96
|
+
fontSize: cx(14),
|
|
97
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
98
|
+
},
|
|
99
|
+
itemContent: {
|
|
100
|
+
color: props.theme.global.secondFontColor,
|
|
101
|
+
fontSize: cx(14),
|
|
102
|
+
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
103
|
+
},
|
|
104
|
+
itemCheckedIcon: {
|
|
105
|
+
width: cx(32),
|
|
106
|
+
height: cx(32),
|
|
107
|
+
marginEnd: cx(4),
|
|
108
|
+
},
|
|
109
|
+
})
|
|
110
|
+
|
|
45
111
|
return (
|
|
46
112
|
<Page
|
|
47
113
|
backText={deviceInfo.name}
|
|
@@ -61,6 +127,7 @@ const LightModePage = () => {
|
|
|
61
127
|
<Card style={styles.modeSelectCard}>
|
|
62
128
|
<Spacer height={cx(12)} />
|
|
63
129
|
<LightModeItem
|
|
130
|
+
styles={styles}
|
|
64
131
|
enable={state.lightMode === LIGHT_MODE_RELAY}
|
|
65
132
|
title={I18n.getLang('matterplug_option1title')}
|
|
66
133
|
content={I18n.getLang('matterplug_option1description')}
|
|
@@ -71,6 +138,7 @@ const LightModePage = () => {
|
|
|
71
138
|
<View style={styles.line} />
|
|
72
139
|
<Spacer height={cx(8)} />
|
|
73
140
|
<LightModeItem
|
|
141
|
+
styles={styles}
|
|
74
142
|
enable={state.lightMode === LIGHT_MODE_POS}
|
|
75
143
|
title={I18n.getLang('matterplug_option2title')}
|
|
76
144
|
content={I18n.getLang('matterplug_option2description')}
|
|
@@ -81,6 +149,7 @@ const LightModePage = () => {
|
|
|
81
149
|
<View style={styles.line} />
|
|
82
150
|
<Spacer height={cx(8)} />
|
|
83
151
|
<LightModeItem
|
|
152
|
+
styles={styles}
|
|
84
153
|
enable={state.lightMode === LIGHT_MODE_OFF}
|
|
85
154
|
title={I18n.getLang('matterplug_option3title')}
|
|
86
155
|
content={I18n.getLang('matterplug_option3description')}
|
|
@@ -91,6 +160,7 @@ const LightModePage = () => {
|
|
|
91
160
|
<Spacer height={cx(8)} />
|
|
92
161
|
<View style={styles.line} />
|
|
93
162
|
<LightModeItem
|
|
163
|
+
styles={styles}
|
|
94
164
|
enable={state.lightMode === LIGHT_MODE_ON}
|
|
95
165
|
title={I18n.getLang('matterplug_option4title')}
|
|
96
166
|
content={I18n.getLang('matterplug_option4description')}
|
|
@@ -108,6 +178,7 @@ const LightModePage = () => {
|
|
|
108
178
|
}
|
|
109
179
|
|
|
110
180
|
interface LightModeItemProps extends PropsWithChildren<ViewProps> {
|
|
181
|
+
styles: StyleSheet.NamedStyles<any>
|
|
111
182
|
onPress: () => void
|
|
112
183
|
title: string
|
|
113
184
|
content: string
|
|
@@ -115,6 +186,7 @@ interface LightModeItemProps extends PropsWithChildren<ViewProps> {
|
|
|
115
186
|
}
|
|
116
187
|
|
|
117
188
|
function LightModeItem(props: LightModeItemProps) {
|
|
189
|
+
const { styles } = props
|
|
118
190
|
return (
|
|
119
191
|
<TouchableOpacity onPress={props.onPress}>
|
|
120
192
|
<View style={styles.itemRoot}>
|
|
@@ -136,69 +208,4 @@ function LightModeItem(props: LightModeItemProps) {
|
|
|
136
208
|
)
|
|
137
209
|
}
|
|
138
210
|
|
|
139
|
-
|
|
140
|
-
root: {
|
|
141
|
-
flex: 1,
|
|
142
|
-
},
|
|
143
|
-
desc: {
|
|
144
|
-
marginHorizontal: cx(24),
|
|
145
|
-
color: '#000',
|
|
146
|
-
fontSize: cx(14),
|
|
147
|
-
fontWeight: 'bold',
|
|
148
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
149
|
-
},
|
|
150
|
-
tipText: {
|
|
151
|
-
marginHorizontal: cx(24),
|
|
152
|
-
color: '#000',
|
|
153
|
-
fontSize: cx(14),
|
|
154
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
155
|
-
},
|
|
156
|
-
modeSelectGroup: {
|
|
157
|
-
marginHorizontal: cx(24),
|
|
158
|
-
backgroundColor: '#f6f6f6',
|
|
159
|
-
borderRadius: cx(4),
|
|
160
|
-
},
|
|
161
|
-
modeTip: {
|
|
162
|
-
marginHorizontal: cx(8),
|
|
163
|
-
color: '#000',
|
|
164
|
-
fontSize: cx(14),
|
|
165
|
-
fontWeight: 'bold',
|
|
166
|
-
fontFamily: 'helvetica_neue_lt_std_bd',
|
|
167
|
-
},
|
|
168
|
-
modeSelectCard: {
|
|
169
|
-
marginHorizontal: cx(8),
|
|
170
|
-
},
|
|
171
|
-
line: {
|
|
172
|
-
height: cx(1),
|
|
173
|
-
marginHorizontal: cx(12),
|
|
174
|
-
backgroundColor: '#3C3C435B',
|
|
175
|
-
},
|
|
176
|
-
itemRoot: {
|
|
177
|
-
flexDirection: 'row',
|
|
178
|
-
alignItems: 'center',
|
|
179
|
-
paddingHorizontal: cx(12),
|
|
180
|
-
paddingBottom: cx(8),
|
|
181
|
-
},
|
|
182
|
-
itemTextGroup: {
|
|
183
|
-
flex: 1,
|
|
184
|
-
marginEnd: cx(12),
|
|
185
|
-
justifyContent: 'center',
|
|
186
|
-
},
|
|
187
|
-
itemTitle: {
|
|
188
|
-
color: '#000',
|
|
189
|
-
fontSize: cx(14),
|
|
190
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
191
|
-
},
|
|
192
|
-
itemContent: {
|
|
193
|
-
color: '#666',
|
|
194
|
-
fontSize: cx(14),
|
|
195
|
-
fontFamily: 'helvetica_neue_lt_std_roman',
|
|
196
|
-
},
|
|
197
|
-
itemCheckedIcon: {
|
|
198
|
-
width: cx(32),
|
|
199
|
-
height: cx(32),
|
|
200
|
-
marginEnd: cx(4),
|
|
201
|
-
},
|
|
202
|
-
})
|
|
203
|
-
|
|
204
|
-
export default LightModePage
|
|
211
|
+
export default withTheme(LightModePage)
|
|
@@ -19,6 +19,7 @@ import { difference, head, range } from 'lodash';
|
|
|
19
19
|
import { RecommendMood, getRecommendMixMoods, getRecommendMoods } from './MoodInfo';
|
|
20
20
|
|
|
21
21
|
const cx = Utils.RatioUtils.convertX;
|
|
22
|
+
const { withTheme } = Utils.ThemeUtils
|
|
22
23
|
|
|
23
24
|
export interface AddMoodPageParams {
|
|
24
25
|
isStatic: boolean;
|
|
@@ -32,7 +33,7 @@ interface AddMoodPageState {
|
|
|
32
33
|
data: RecommendMood[];
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
const AddMoodPage = () => {
|
|
36
|
+
const AddMoodPage = (props: { theme?: any }) => {
|
|
36
37
|
const navigation = useNavigation();
|
|
37
38
|
const routeParams = useRoute().params as AddMoodPageParams;
|
|
38
39
|
const moduleParams = routeParams.moduleParams;
|
|
@@ -77,6 +78,21 @@ const AddMoodPage = () => {
|
|
|
77
78
|
[routeParams]
|
|
78
79
|
);
|
|
79
80
|
|
|
81
|
+
|
|
82
|
+
const styles = StyleSheet.create({
|
|
83
|
+
root: {
|
|
84
|
+
flex: 1,
|
|
85
|
+
flexDirection: 'column',
|
|
86
|
+
},
|
|
87
|
+
desc: {
|
|
88
|
+
color: props.theme.global.fontColor,
|
|
89
|
+
fontSize: cx(16),
|
|
90
|
+
marginHorizontal: cx(24),
|
|
91
|
+
marginTop: cx(12),
|
|
92
|
+
},
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
|
|
80
96
|
return (
|
|
81
97
|
<Page
|
|
82
98
|
backText={Strings.getLang('add_new_static_mood_system_back')}
|
|
@@ -120,20 +136,7 @@ const AddMoodPage = () => {
|
|
|
120
136
|
);
|
|
121
137
|
};
|
|
122
138
|
|
|
123
|
-
|
|
124
|
-
root: {
|
|
125
|
-
flex: 1,
|
|
126
|
-
flexDirection: 'column',
|
|
127
|
-
},
|
|
128
|
-
desc: {
|
|
129
|
-
color: '#000',
|
|
130
|
-
fontSize: cx(16),
|
|
131
|
-
marginHorizontal: cx(24),
|
|
132
|
-
marginTop: cx(12),
|
|
133
|
-
},
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
export default AddMoodPage;
|
|
139
|
+
export default withTheme(AddMoodPage)
|
|
137
140
|
|
|
138
141
|
const defStripConfig = {
|
|
139
142
|
version: 0,
|