@ledvance/base 1.0.34 → 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
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/base",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.0.34",
7
+ "version": "1.0.36",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@reduxjs/toolkit": "^1.8.6",
@@ -0,0 +1,36 @@
1
+ import React from "react";
2
+ import { TouchableOpacity, Text, StyleProp, ViewStyle, TextStyle } from 'react-native'
3
+ import { Utils } from 'tuya-panel-kit'
4
+
5
+ const cx = Utils.RatioUtils.convertX
6
+ interface DeleteButtonProps {
7
+ text: string,
8
+ onPress: () => void,
9
+ style?: StyleProp<ViewStyle>,
10
+ textStyle?: StyleProp<TextStyle>
11
+ }
12
+
13
+ const DeleteButton = (props: DeleteButtonProps) => {
14
+ const { text, onPress, style, textStyle } = props
15
+ return (
16
+ <TouchableOpacity
17
+ onPress={onPress}
18
+ style={[{
19
+ width: '100%',
20
+ height: cx(50),
21
+ backgroundColor: '#666',
22
+ alignItems: 'center',
23
+ justifyContent: 'center',
24
+ borderRadius: cx(8)
25
+ }, style]}
26
+ >
27
+ <Text style={[{
28
+ color: '#fff',
29
+ fontSize: cx(16),
30
+ fontFamily: 'helvetica_neue_lt_std_bd'
31
+ }, textStyle]}>{text}</Text>
32
+ </TouchableOpacity>
33
+ )
34
+ }
35
+
36
+ export default DeleteButton
@@ -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