@ledvance/base 1.0.35 → 1.0.36
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
CHANGED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Card from './Card'
|
|
3
|
+
import {View, ViewProps} from 'react-native'
|
|
4
|
+
import LdvSwitch from './ldvSwitch'
|
|
5
|
+
import I18n from '@i18n'
|
|
6
|
+
import LdvSlider from './ldvSlider'
|
|
7
|
+
import Spacer from './Spacer'
|
|
8
|
+
|
|
9
|
+
interface FanAdjustViewProps extends ViewProps {
|
|
10
|
+
fanEnable: boolean
|
|
11
|
+
fanSpeed: number
|
|
12
|
+
onFanSwitch: (fanEnable: boolean) => void
|
|
13
|
+
onFanSpeedChange?: (fanSpeed: number) => void
|
|
14
|
+
onFanSpeedChangeComplete: (fanSpeed: number) => void
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const FanAdjustView = (props: FanAdjustViewProps) => {
|
|
18
|
+
return (
|
|
19
|
+
<Card
|
|
20
|
+
style={props.style}>
|
|
21
|
+
<LdvSwitch
|
|
22
|
+
title={I18n.getLang('add_new_dynamic_mood_ceiling_fan_field_headline')}
|
|
23
|
+
enable={props.fanEnable}
|
|
24
|
+
setEnable={props.onFanSwitch}
|
|
25
|
+
color={''}
|
|
26
|
+
colorAlpha={1}/>
|
|
27
|
+
{props.fanEnable && (
|
|
28
|
+
<View>
|
|
29
|
+
<LdvSlider
|
|
30
|
+
title={I18n.getLang('add_new_dynamic_mood_ceiling_fan_field_text')}
|
|
31
|
+
value={props.fanSpeed}
|
|
32
|
+
min={1}
|
|
33
|
+
max={3}
|
|
34
|
+
onValueChange={props.onFanSpeedChange}
|
|
35
|
+
onSlidingComplete={props.onFanSpeedChangeComplete}
|
|
36
|
+
subTitleStr={props.fanSpeed + '/3'}/>
|
|
37
|
+
<Spacer/>
|
|
38
|
+
</View>
|
|
39
|
+
)}
|
|
40
|
+
</Card>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default FanAdjustView
|