@ledvance/ui-biz-bundle 1.1.86 → 1.1.89

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 (29) hide show
  1. package/package.json +1 -1
  2. package/src/modules/flags/FlagHash.ts +346 -0
  3. package/src/modules/flags/FlagPage.tsx +10 -2
  4. package/src/modules/history/HistoryPage.tsx +233 -223
  5. package/src/modules/history/SwitchHistoryPageActions.ts +5 -5
  6. package/src/modules/timer/TimerPage.tsx +2 -2
  7. package/src/modules/timer/TimerPageAction.ts +2 -2
  8. package/src/newModules/biorhythm/BiorhythmEditPage.tsx +1 -1
  9. package/src/newModules/biorhythm/BiorhythmPage.tsx +1 -1
  10. package/src/newModules/energyConsumption/EnergyConsumptionChart.tsx +22 -30
  11. package/src/newModules/energyConsumption/EnergyConsumptionDetail.tsx +5 -5
  12. package/src/newModules/energyConsumption/EnergyConsumptionPage.tsx +4 -4
  13. package/src/newModules/energyConsumption/component/EnergyModal.tsx +1 -1
  14. package/src/newModules/energyConsumption/component/Overview.tsx +1 -1
  15. package/src/newModules/fixedTime/FixedTimeDetailPage.tsx +9 -11
  16. package/src/newModules/mood/AddMoodPage.tsx +1 -1
  17. package/src/newModules/mood/MoodActions.ts +13 -6
  18. package/src/newModules/mood/MoodInfo.ts +170 -18
  19. package/src/newModules/mood/MoodPage.tsx +69 -53
  20. package/src/newModules/mood/StaticMoodEditorPage.tsx +8 -0
  21. package/src/newModules/randomTime/RandomTimeDetailPage.tsx +2 -1
  22. package/src/newModules/randomTime/RandomTimePage.tsx +1 -1
  23. package/src/newModules/sleepWakeUp/Interface.ts +2 -0
  24. package/src/newModules/sleepWakeUp/SleepWakeUpActions.ts +21 -6
  25. package/src/newModules/sleepWakeUp/SleepWakeUpDetailPage.tsx +10 -33
  26. package/src/newModules/sleepWakeUp/SleepWakeUpPage.tsx +4 -3
  27. package/src/newModules/swithInching/SwithInching.tsx +4 -4
  28. package/src/newModules/timeSchedule/TimeScheduleDetailPage.tsx +1 -1
  29. package/src/newModules/timeSchedule/TimeSchedulePage.tsx +1 -1
@@ -1,249 +1,259 @@
1
1
  import Page from '@ledvance/base/src/components/Page'
2
- import {useDeviceInfo} from '@ledvance/base/src/models/modules/NativePropsSlice'
3
- import React, {useCallback, useEffect} from 'react'
4
- import I18n from '@ledvance/base/src/i18n'
5
- import {getSwitchHistoryData, SwitchHistoryUIItemData} from './SwitchHistoryPageActions'
2
+ import { useDeviceInfo } from '@ledvance/base/src/models/modules/NativePropsSlice'
3
+ import React, { useCallback, useEffect } from 'react'
4
+ import I18n, { I18nKey } from '@ledvance/base/src/i18n'
5
+ import { getSwitchHistoryData, SwitchHistoryUIItemData } from './SwitchHistoryPageActions'
6
6
  import res from '@ledvance/base/src/res'
7
- import {Utils} from 'tuya-panel-kit'
8
- import {useReactive} from 'ahooks'
9
- import {FlatList, Image, StyleSheet, Text, View} from 'react-native'
7
+ import { Utils } from 'tuya-panel-kit'
8
+ import { useReactive } from 'ahooks'
9
+ import { FlatList, Image, StyleSheet, Text, View } from 'react-native'
10
10
  import Spacer from '@ledvance/base/src/components/Spacer'
11
- import {RouteProp, useRoute} from '@react-navigation/core'
12
11
  import { isEmpty } from 'lodash'
13
12
  import Tag from "@ledvance/base/src/components/Tag"
14
13
  import { exportHistoryFile } from '@ledvance/base/src/utils/common'
14
+ import { useParams } from '@ledvance/base/src/hooks/Hooks'
15
15
 
16
16
  const cx = Utils.RatioUtils.convertX
17
17
 
18
- type SwitchHistoryPageRouteParams = {
19
- params: { dpIds: string[], tags?: object, headlineText: string, backText?: string, stringOff?:string, stringOn?: string, showLimit?: boolean, actionKey?:string}
20
- }
21
-
22
- type Props = {
23
- route: RouteProp<SwitchHistoryPageRouteParams, 'params'>
18
+ export type SwitchHistoryPageRouteParams = {
19
+ dpIds: string[],
20
+ tags?: object,
21
+ headlineText?: string,
22
+ backText?: string,
23
+ showLimit?: boolean,
24
+ getActionsText: (dpData: any) => I18nKey
24
25
  }
25
26
 
26
27
  const SwitchHistoryPage = () => {
27
- const deviceInfo = useDeviceInfo()
28
- const { dpIds, tags ,headlineText, backText, stringOff, stringOn, actionKey, showLimit } = useRoute<Props['route']>().params
28
+ const deviceInfo = useDeviceInfo()
29
+ const { dpIds, tags, headlineText, backText, showLimit, getActionsText } = useParams<SwitchHistoryPageRouteParams>()
29
30
 
30
- const state = useReactive<SwitchHistoryPageState>({
31
- refreshing: true,
32
- refreshType: 'refresh',
33
- onRefresh: Symbol(),
34
- data: [],
35
- dataOffset: 0,
36
- hasNext: true,
37
- filterTags: tags ? Object.keys(tags).reduce((pre, cur)=> {
38
- pre[cur] = false
39
- return pre
40
- }, {}) : {}
41
- })
31
+ const state = useReactive<SwitchHistoryPageState>({
32
+ refreshing: true,
33
+ refreshType: 'refresh',
34
+ onRefresh: Symbol(),
35
+ data: [],
36
+ dataOffset: 0,
37
+ hasNext: true,
38
+ filterTags: tags ? Object.keys(tags).reduce((pre, cur) => {
39
+ pre[cur] = false
40
+ return pre
41
+ }, {}) : {}
42
+ })
42
43
 
43
- const loadData: (refreshType: RefreshType) => void = useCallback(async refreshType => {
44
- state.refreshType = refreshType
45
- if (state.refreshType === 'refresh') {
46
- state.dataOffset = 0
47
- state.onRefresh = Symbol()
48
- } else if (state.hasNext) {
49
- state.onRefresh = Symbol()
50
- }
51
- }, [])
44
+ const loadData: (refreshType: RefreshType) => void = useCallback(async refreshType => {
45
+ state.refreshType = refreshType
46
+ if (state.refreshType === 'refresh') {
47
+ state.dataOffset = 0
48
+ state.onRefresh = Symbol()
49
+ } else if (state.hasNext) {
50
+ state.onRefresh = Symbol()
51
+ }
52
+ }, [])
52
53
 
53
- const changeFilter = useCallback((v:boolean, tag: string) =>{
54
- state.filterTags = {
55
- ...state.filterTags,
56
- [tag]: v
57
- }
58
- }, [])
54
+ const changeFilter = useCallback((v: boolean, tag: string) => {
55
+ state.filterTags = {
56
+ ...state.filterTags,
57
+ [tag]: v
58
+ }
59
+ }, [])
59
60
 
60
- const getRequestIds = useCallback(() =>{
61
- const tagValue = Object.values(state.filterTags)
62
- const isAllData = tagValue.every(tag => tag) || tagValue.every(tag => !tag)
63
- const checkedTags = Object.keys(state.filterTags).reduce((pre:string[], cur) => {
64
- if(state.filterTags[cur]) pre.push(cur)
65
- return pre
66
- }, [])
67
- return isAllData ? dpIds : checkedTags
68
- }, [state.filterTags])
61
+ const getRequestIds = useCallback(() => {
62
+ const tagValue = Object.values(state.filterTags)
63
+ const isAllData = tagValue.every(tag => tag) || tagValue.every(tag => !tag)
64
+ const checkedTags = Object.keys(state.filterTags).reduce((pre: string[], cur) => {
65
+ if (state.filterTags[cur]) pre.push(cur)
66
+ return pre
67
+ }, [])
68
+ return isAllData ? dpIds : checkedTags
69
+ }, [state.filterTags])
69
70
 
70
71
 
71
- useEffect(() => {
72
- getSwitchHistoryData(deviceInfo.devId, getRequestIds(), state.dataOffset, 100, stringOn, stringOff, actionKey, showLimit)
73
- .then(res => {
74
- state.refreshing = false
75
- state.data = res.data
76
- state.dataOffset = res.currentOffset
77
- state.hasNext = res.hasNext
78
- })
79
- }, [state.onRefresh, state.filterTags])
72
+ useEffect(() => {
73
+ getSwitchHistoryData(deviceInfo.devId, getRequestIds(), state.dataOffset, getActionsText, 100, showLimit)
74
+ .then(res => {
75
+ state.refreshing = false
76
+ state.data = res.data
77
+ state.dataOffset = res.currentOffset
78
+ state.hasNext = res.hasNext
79
+ })
80
+ }, [state.onRefresh, state.filterTags])
80
81
 
81
- const downFile = () => {
82
- exportHistoryFile(state.data)
83
- }
82
+ const downFile = () => {
83
+ exportHistoryFile(state.data)
84
+ }
84
85
 
85
- return (
86
- <Page
87
- backText={backText || deviceInfo.name}
88
- headlineText={headlineText || I18n.getLang('history_socket_headline_text')}
89
- headlineIcon={res.download_icon}
90
- onHeadlineIconClick={downFile}
91
- >
92
- <View style={styles.content}>
93
- <Text style={styles.titleText}>{I18n.getLang('history_contact_sensor_description_text')}</Text>
94
- <Spacer/>
95
- {!isEmpty(state.filterTags) && !!state.data.length &&
96
- <View style={{
97
- display: 'flex',
98
- flexDirection: 'row',
99
- flexWrap: 'wrap',
100
- marginHorizontal: cx(24),
101
- marginBottom: cx(12),
102
- alignSelf: 'flex-start'
103
- }}>
104
- {
105
- Object.keys(state.filterTags)?.map((tag) => {
106
- return <Tag
107
- key={tag}
108
- text={tags && tags[tag]}
109
- checked={state.filterTags[tag]}
110
- onCheckedChange={(v) => changeFilter(v, tag)}
111
- style={{ marginTop: cx(5), marginHorizontal: cx(5) }}
112
- />
113
- })
114
- }
115
- </View>
116
- }
117
- <FlatList
118
- data={state.data}
119
- style={styles.list}
120
- renderItem={({item}) => <SwitchHistoryItem {...{itemData :item, tags}}/>}
121
- keyExtractor={(_, index) => `${index}`}
122
- ListFooterComponent={<Spacer/>}
123
- ListEmptyComponent={(
124
- <View style={styles.listEmptyView}>
125
- <Spacer height={cx(26)}/>
126
- <Image
127
- style={styles.listEmptyImage}
128
- source={{uri: res.ldv_timer_empty}}/>
129
- <Spacer height={cx(14)}/>
130
- <View style={{flexDirection: 'row', alignItems: 'center'}}>
131
- <Image style={styles.listEmptyTextIcon} source={res.ic_info}/>
132
- <Spacer width={cx(4)} height={0}/>
133
- <Text style={styles.listEmptyText}>{I18n.getLang('history_overview_empty_information_text')}</Text>
134
- </View>
135
- </View>
136
- )}
137
- refreshing={state.refreshing}
138
- onEndReachedThreshold={.1}
139
- onRefresh={async () => {
140
- await loadData('refresh')
141
- }}
142
- onEndReached={async () => {
143
- await loadData('loadMore')
144
- }}/>
86
+ return (
87
+ <Page
88
+ backText={backText || deviceInfo.name}
89
+ headlineText={headlineText || I18n.getLang('history_socket_headline_text')}
90
+ headlineIcon={res.download_icon}
91
+ onHeadlineIconClick={downFile}
92
+ >
93
+ <View style={styles.content}>
94
+ <Text style={styles.titleText}>{I18n.getLang('history_contact_sensor_description_text')}</Text>
95
+ <Spacer />
96
+ {!isEmpty(state.filterTags) && !!state.data.length &&
97
+ <View style={{
98
+ display: 'flex',
99
+ flexDirection: 'row',
100
+ flexWrap: 'wrap',
101
+ marginHorizontal: cx(24),
102
+ marginBottom: cx(12),
103
+ alignSelf: 'flex-start'
104
+ }}>
105
+ {
106
+ Object.keys(state.filterTags)?.map((tag) => {
107
+ return <Tag
108
+ key={tag}
109
+ text={tags && tags[tag]}
110
+ checked={state.filterTags[tag]}
111
+ onCheckedChange={(v) => changeFilter(v, tag)}
112
+ style={{ marginTop: cx(5), marginHorizontal: cx(5) }}
113
+ />
114
+ })
115
+ }
116
+ </View>
117
+ }
118
+ <FlatList
119
+ data={state.data}
120
+ style={styles.list}
121
+ renderItem={({ item }) => <SwitchHistoryItem {...{ itemData: item, tags }} />}
122
+ keyExtractor={(_, index) => `${index}`}
123
+ ListFooterComponent={<Spacer />}
124
+ ListEmptyComponent={(
125
+ <View style={styles.listEmptyView}>
126
+ <Spacer height={cx(26)} />
127
+ <Image
128
+ style={styles.listEmptyImage}
129
+ source={{ uri: res.ldv_timer_empty }} />
130
+ <Spacer height={cx(14)} />
131
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
132
+ <Image style={styles.listEmptyTextIcon} source={res.ic_info} />
133
+ <Spacer width={cx(4)} height={0} />
134
+ <Text style={styles.listEmptyText}>{I18n.getLang('history_overview_empty_information_text')}</Text>
135
+ </View>
145
136
  </View>
146
- </Page>
147
- )
137
+ )}
138
+ refreshing={state.refreshing}
139
+ onEndReachedThreshold={.1}
140
+ onRefresh={async () => {
141
+ await loadData('refresh')
142
+ }}
143
+ onEndReached={async () => {
144
+ await loadData('loadMore')
145
+ }} />
146
+ </View>
147
+ </Page>
148
+ )
148
149
  }
149
150
 
150
151
  interface SwitchHistoryItemBean {
151
- itemData: SwitchHistoryUIItemData
152
- tags?: object
152
+ itemData: SwitchHistoryUIItemData
153
+ tags?: object
153
154
  }
154
155
 
155
- const SwitchHistoryItem = (props: SwitchHistoryItemBean) => {
156
- const { itemData, tags} = props
157
- return (
158
- <View style={styles.switchHistoryItem}>
159
- <Text style={styles.switchHistoryItemTitle}>{itemData.title}</Text>
160
- <Spacer height={cx(10)}/>
161
- {itemData.actions.map((actionData, index) => (
162
- <View style={styles.switchHistoryItemActionItem} key={`${index}`}>
163
- <View style={styles.switchHistoryItemActionItemLineGroup}>
164
- <View style={styles.switchHistoryItemActionItemLine}/>
165
- <View style={styles.switchHistoryItemActionItemPoint}/>
166
- <View style={styles.switchHistoryItemActionItemLine}/>
167
- </View>
168
- <Spacer width={cx(20)} height={0}/>
169
- <Text style={styles.switchHistoryItemActionItemText}>{`${actionData.time}`}</Text>
170
- <Spacer width={cx(20)} height={0}/>
171
- <Text style={styles.switchHistoryItemActionItemText}>{`${actionData.action}`}</Text>
172
- {!!tags && <View style={styles.switchHistoryItemTag}><Text >{tags[actionData.dpId]}</Text></View>}
173
- </View>
174
- ))}
175
- <Spacer/>
156
+ const SwitchHistoryItem = (props: SwitchHistoryItemBean) => {
157
+ const { itemData, tags } = props
158
+ return (
159
+ <View style={styles.switchHistoryItem}>
160
+ <Text style={styles.switchHistoryItemTitle}>{itemData.title}</Text>
161
+ <Spacer height={cx(10)} />
162
+ {itemData.actions.map((actionData, index) => (
163
+ <View style={styles.switchHistoryItemActionItem} key={`${index}`}>
164
+ <View style={styles.switchHistoryItemActionItemLineGroup}>
165
+ <View style={styles.switchHistoryItemActionItemLine} />
166
+ <View style={styles.switchHistoryItemActionItemPoint} />
167
+ </View>
168
+ <Spacer width={cx(15)} height={0} />
169
+ <Text style={styles.switchHistoryItemActionItemText}>{`${actionData.time}`}</Text>
170
+ <Spacer width={cx(10)} height={0} />
171
+ <View style={{ flex: 1, display: 'flex', flexDirection: 'row', flexWrap: 'wrap',alignItems: 'baseline'
172
+ }}>
173
+ <Text style={styles.switchHistoryItemActionItemText}>{`${actionData.action}`}</Text>
174
+ {!!tags && <View style={styles.switchHistoryItemTag}><Text style={{ fontSize: cx(14), color: '#000' }}>{tags[actionData.dpId]}</Text></View>}
175
+ </View>
176
176
  </View>
177
- )
177
+ ))}
178
+ <Spacer />
179
+ </View>
180
+ )
178
181
  }
179
182
 
180
183
  const styles = StyleSheet.create({
181
- content: {
182
- flex: 1,
183
- },
184
- list: {
185
- flex: 1,
186
- },
187
- listEmptyView: {
188
- alignItems: 'center',
189
- },
190
- listEmptyImage: {
191
- width: cx(200),
192
- height: cx(200),
193
- },
194
- listEmptyTextIcon: {
195
- width: cx(16),
196
- height: cx(16),
197
- tintColor: '#000',
198
- },
199
- listEmptyText: {
200
- color: '#000',
201
- fontSize: cx(12),
202
- fontFamily: 'helvetica_neue_lt_std_roman',
203
- },
204
- titleText: {
205
- marginHorizontal: cx(24),
206
- color: '#000',
207
- fontSize: cx(16),
208
- fontFamily: 'helvetica_neue_lt_std_roman',
209
- },
210
- switchHistoryItem: {
211
- marginHorizontal: cx(24),
212
- },
213
- switchHistoryItemTitle: {
214
- color: '#000',
215
- fontSize: cx(18),
216
- fontFamily: 'helvetica_neue_lt_std_bd',
217
- },
218
- switchHistoryItemActionItem: {
219
- flexDirection: 'row',
220
- alignItems: 'center',
221
- },
222
- switchHistoryItemActionItemLineGroup: {
223
- alignItems: 'center',
224
- },
225
- switchHistoryItemActionItemLine: {
226
- width: cx(1),
227
- height: cx(11.5),
228
- backgroundColor: '#E6E7E8',
229
- },
230
- switchHistoryItemActionItemPoint: {
231
- width: cx(7),
232
- height: cx(7),
233
- backgroundColor: '#f60',
234
- borderRadius: cx(4),
235
- },
236
- switchHistoryItemActionItemText: {
237
- color: '#000',
238
- fontSize: cx(16),
239
- fontFamily: 'helvetica_neue_lt_std_roman',
240
- },
241
- switchHistoryItemTag:{
242
- paddingHorizontal: cx(10),
243
- borderRadius: cx(10),
244
- backgroundColor: '#cbcbcb',
245
- marginLeft: cx(5)
246
- }
184
+ content: {
185
+ flex: 1,
186
+ },
187
+ list: {
188
+ flex: 1,
189
+ },
190
+ listEmptyView: {
191
+ alignItems: 'center',
192
+ },
193
+ listEmptyImage: {
194
+ width: cx(200),
195
+ height: cx(200),
196
+ },
197
+ listEmptyTextIcon: {
198
+ width: cx(16),
199
+ height: cx(16),
200
+ tintColor: '#000',
201
+ },
202
+ listEmptyText: {
203
+ color: '#000',
204
+ fontSize: cx(12),
205
+ fontFamily: 'helvetica_neue_lt_std_roman',
206
+ },
207
+ titleText: {
208
+ marginHorizontal: cx(24),
209
+ color: '#000',
210
+ fontSize: cx(16),
211
+ fontFamily: 'helvetica_neue_lt_std_roman',
212
+ },
213
+ switchHistoryItem: {
214
+ marginHorizontal: cx(24),
215
+ },
216
+ switchHistoryItemTitle: {
217
+ color: '#000',
218
+ fontSize: cx(18),
219
+ fontFamily: 'helvetica_neue_lt_std_bd',
220
+ },
221
+ switchHistoryItemActionItem: {
222
+ flexDirection: 'row',
223
+ alignItems: 'center',
224
+ flex: 1
225
+ },
226
+ switchHistoryItemActionItemLineGroup: {
227
+ width: cx(7),
228
+ minHeight: cx(30),
229
+ height: '100%',
230
+ alignItems: 'center',
231
+ },
232
+ switchHistoryItemActionItemLine: {
233
+ width: cx(1),
234
+ flex: 1,
235
+ backgroundColor: '#E6E7E8',
236
+ },
237
+ switchHistoryItemActionItemPoint: {
238
+ width: cx(7),
239
+ height: cx(7),
240
+ backgroundColor: '#f60',
241
+ borderRadius: cx(4),
242
+ position: 'absolute',
243
+ top: '50%',
244
+ transform: [{ translateY: cx(-3) }]
245
+ },
246
+ switchHistoryItemActionItemText: {
247
+ color: '#000',
248
+ fontSize: cx(16),
249
+ fontFamily: 'helvetica_neue_lt_std_roman',
250
+ },
251
+ switchHistoryItemTag: {
252
+ paddingHorizontal: cx(10),
253
+ borderRadius: cx(10),
254
+ backgroundColor: '#cbcbcb',
255
+ marginLeft: cx(5),
256
+ }
247
257
  })
248
258
 
249
259
  export default SwitchHistoryPage
@@ -252,11 +262,11 @@ type RefreshType = 'refresh' | 'loadMore'
252
262
 
253
263
 
254
264
  interface SwitchHistoryPageState {
255
- refreshing: boolean
256
- refreshType: RefreshType
257
- onRefresh: symbol
258
- data: SwitchHistoryUIItemData[]
259
- hasNext: boolean
260
- dataOffset: number
261
- filterTags: object
265
+ refreshing: boolean
266
+ refreshType: RefreshType
267
+ onRefresh: symbol
268
+ data: SwitchHistoryUIItemData[]
269
+ hasNext: boolean
270
+ dataOffset: number
271
+ filterTags: object
262
272
  }
@@ -1,7 +1,7 @@
1
1
  import { getDpReportSataData, PagingResult } from '@ledvance/base/src/models/TuyaApi'
2
2
  import { cloneDeep, groupBy, isEqual, uniqWith } from 'lodash'
3
3
  import dayjs from 'dayjs'
4
- import I18n from '@ledvance/base/src/i18n'
4
+ import I18n, { I18nKey } from '@ledvance/base/src/i18n'
5
5
  import duration from 'dayjs/plugin/duration'
6
6
  dayjs.extend(duration)
7
7
  export interface SwitchHistoryUIItemData {
@@ -39,9 +39,9 @@ const formateLimitTime = (time: number) =>{
39
39
  // return ` ${hours > 0 ? hours + 'h' : ''} ${(minutes > 0 || hours > 0) ? minutes + 'min' : ''} ${seconds}sec`
40
40
  }
41
41
 
42
- type getSwitchHistoryDataFunType = (deviceId: string, dpIds: string[], offset: number, limit?: number, stringOn?:string, stringOff?:string, actionKey?:string, showLimit?:boolean) => Promise<PagingResult<SwitchHistoryUIItemData[]>>
42
+ type getSwitchHistoryDataFunType = (deviceId: string, dpIds: string[], offset: number, getActionsText: (dpData: any) => I18nKey, limit?: number, showLimit?:boolean) => Promise<PagingResult<SwitchHistoryUIItemData[]>>
43
43
 
44
- export const getSwitchHistoryData: getSwitchHistoryDataFunType = async (deviceId: string, dpIds: string[], offset: number, limit: number = 100, stringOn, stringOff, actionKey, showLimit) => {
44
+ export const getSwitchHistoryData: getSwitchHistoryDataFunType = async (deviceId: string, dpIds: string[], offset: number, getActionsText, limit: number = 100, showLimit) => {
45
45
  const res = await getDpReportSataData(deviceId, dpIds, 0, offset + limit)
46
46
  const uniqData = uniqWith(res.dps, isEqual)
47
47
  const reverseData = cloneDeep(uniqData).reverse()
@@ -51,13 +51,13 @@ export const getSwitchHistoryData: getSwitchHistoryDataFunType = async (deviceId
51
51
  limitTime: reverseData[idx + 1] ? formateLimitTime(reverseData[idx + 1].timeStamp - item.timeStamp) : ''
52
52
  }
53
53
  })
54
- const key = actionKey || 'true'
55
54
  const dateActionsMap = groupBy(limitTimeData.reverse().map(dpData => {
55
+ const key = getActionsText(dpData)
56
56
  const dayjsDate = dayjs(dpData.timeStr)
57
57
  return {
58
58
  date: `${dayjsDate.format('DD/MM/YYYY')} (${weekList[dayjsDate.format('ddd')]})`,
59
59
  time: dayjsDate.format('HH:mm:ss'),
60
- action: I18n.formatValue(dpData.value === key ? (stringOn || 'history_powerstrip_field1_text') : (stringOff || 'history_powerstrip_field1_text2'), '', showLimit ? dpData.limitTime : ''),
60
+ action: I18n.formatValue(key, '', showLimit ? dpData.limitTime : ''),
61
61
  dpId: dpData.dpId,
62
62
  }
63
63
  }), 'date')
@@ -229,7 +229,7 @@ const TimerPage = (props: {theme?: any}) => {
229
229
  <Text style={styles.itemTitle}>{I18n.getLang('timeschedule_add_schedule_subheadline_text')}</Text>
230
230
  <View
231
231
  style={{
232
- backgroundColor: props.theme.card.board,
232
+ backgroundColor: props.theme.card.border,
233
233
  borderRadius: 4,
234
234
  minHeight: cx(50),
235
235
  flex: 1,
@@ -267,7 +267,7 @@ const TimerPage = (props: {theme?: any}) => {
267
267
  text={I18n.getLang('timer_sockets_button_text')}
268
268
  onPress={onStartPress}
269
269
  textStyle={{ fontSize: cx(14) }}
270
- style={{ backgroundColor: !state.selectedSkill.length ? props.theme.button.disabled : props.theme.button.active }}
270
+ style={{ backgroundColor: !state.selectedSkill.length ? props.theme.button.disabled : props.theme.button.primary }}
271
271
  />
272
272
  <Spacer />
273
273
  </>}
@@ -137,7 +137,7 @@ export function timeFormatToRealTime(mCountdown: number) {
137
137
  return `${after.getHours()}:${after.getMinutes().toString().padStart(2, '0')}`
138
138
  }
139
139
 
140
- export function timeFormat(time: number): string {
140
+ export function timeFormat(time: number, hideUnit?: boolean): string {
141
141
  let hour = Math.trunc(time / 3600)
142
142
  const beforeMin = (time % 3600) / 60
143
143
  let min = Math.ceil(beforeMin)
@@ -145,5 +145,5 @@ export function timeFormat(time: number): string {
145
145
  hour += 1
146
146
  min = 0
147
147
  }
148
- return `${hour > 0 ? `${hour} h ` : ''}${min > 0 ? `${min}` : ''}`
148
+ return `${hour > 0 ? `${hour} h ` : ''}${min > 0 ? `${min} ${hideUnit ? '' : 'min'}` : ''}`
149
149
  }
@@ -96,7 +96,7 @@ const BiorhythmEditPage = () => {
96
96
 
97
97
  const canSaveMoodData = useMemo(() =>{
98
98
  return state.planData.name.length > 0 && state.planData.name.length < 33 && !nameRepeatFlag && !checkBiorhythmDataChanged && !minimumTipEnable()
99
- }, [nameRepeatFlag, state.planData.name, checkBiorhythmDataChanged])
99
+ }, [nameRepeatFlag, state.planData.name, checkBiorhythmDataChanged, minimumTipEnable()])
100
100
 
101
101
  return (
102
102
  <Page
@@ -262,7 +262,7 @@ const BiorhythmPage = () => {
262
262
  backText={deviceInfo.name}
263
263
  onBackClick={navigation.goBack}
264
264
  headlineText={I18n.getLang('add_new_trigger_time_system_back_text')}
265
- headlineContent={<Switch
265
+ headlineIconContent={<Switch
266
266
  value={state.enable}
267
267
  thumbColor={'#f60'}
268
268
  trackColor={{ false: '#00000026', true: '#ff660036' }}