@ledvance/base 1.1.1 → 1.1.2

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.1.1",
7
+ "version": "1.1.2",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@reduxjs/toolkit": "^1.8.6",
@@ -43,6 +43,7 @@ const ColorAdjustView = (props: ColorAdjustViewProps) => {
43
43
  props.onHSVChangeComplete(hsv.h, hsv.s, hsv.v)
44
44
  }
45
45
  }}/>
46
+ <Spacer height={cx(10)}/>
46
47
  <LdvSaturation
47
48
  value={props.s}
48
49
  onValueChange={s => {
@@ -1,5 +1,8 @@
1
1
  import React from 'react'
2
- import { StyleSheet, View, TouchableOpacity } from 'react-native'
2
+ import {StyleSheet, TouchableOpacity, View} from 'react-native'
3
+ import {Utils} from 'tuya-panel-kit'
4
+
5
+ const {convertX: cx} = Utils.RatioUtils
3
6
 
4
7
  const temperatures = [
5
8
  {
@@ -50,22 +53,17 @@ const colors = [
50
53
  ]
51
54
 
52
55
  const LdvPresetView = (props) => {
53
- const { type, onPress } = props
56
+ const {type, onPress} = props
54
57
  let dataSource = type == 'temperature' ? temperatures : colors
55
58
  return (<View style={styles.container}>
56
- {dataSource.map((item, index) => {
57
- return (
58
- <TouchableOpacity
59
- key={index}
60
- style={[styles.item, { backgroundColor: item.color }]}
61
- onPress={() => {
62
- console.log('LdvPresetView')
63
- onPress(item)
64
- }} />
65
- )
66
- })}
59
+ {dataSource.map((item, index) =>
60
+ <TouchableOpacity
61
+ key={index}
62
+ style={[styles.item, {backgroundColor: item.color}]}
63
+ onPress={() => {
64
+ onPress(item)
65
+ }}/>)}
67
66
  </View>)
68
-
69
67
  }
70
68
 
71
69
  const styles = StyleSheet.create({
@@ -74,14 +72,13 @@ const styles = StyleSheet.create({
74
72
  flexDirection: 'row',
75
73
  justifyContent: 'space-between',
76
74
  alignItems: 'center',
77
- marginHorizontal: 16,
75
+ marginHorizontal: cx(16),
78
76
  },
79
-
80
77
  item: {
81
- width: 28,
82
- height: 28,
83
- borderRadius: 14,
84
- borderWidth: 1,
78
+ width: cx(28),
79
+ height: cx(28),
80
+ borderRadius: cx(14),
81
+ borderWidth: cx(1),
85
82
  borderColor: 'rgb(230, 231, 232)',
86
83
  },
87
84
  })