@ledvance/base 1.1.95 → 1.1.96

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.95",
7
+ "version": "1.1.96",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@reduxjs/toolkit": "^1.8.6",
@@ -1,7 +1,7 @@
1
1
  import React, { PropsWithChildren, useCallback, useEffect, useMemo } from 'react'
2
2
  import { Image, StyleSheet, Text, TouchableOpacity, View, ViewProps } from 'react-native'
3
3
  import { Modal, Utils } from 'tuya-panel-kit'
4
- import { useReactive } from 'ahooks'
4
+ import { useReactive, useUpdateEffect } from 'ahooks'
5
5
  import Card from './Card'
6
6
  import res from '@res'
7
7
  import I18n from '@i18n'
@@ -56,11 +56,12 @@ interface DrawToolViewProps extends PropsWithChildren<ViewProps> {
56
56
  hidLampAdjustView?: boolean
57
57
  hideDisableLight?: boolean
58
58
  hideColorize?: boolean
59
+ ledNumModalVisible?: boolean
59
60
  }
60
61
 
61
62
  const DrawToolView = (props: DrawToolViewProps) => {
62
63
  const state = useReactive({
63
- visible: false,
64
+ visible: props.ledNumModalVisible,
64
65
  ledNum: props.ledNum || 5,
65
66
  width: 0,
66
67
  })
@@ -75,6 +76,10 @@ const DrawToolView = (props: DrawToolViewProps) => {
75
76
  }
76
77
  }, [])
77
78
 
79
+ useUpdateEffect(() =>{
80
+ state.visible = props.ledNumModalVisible
81
+ }, [props.ledNumModalVisible])
82
+
78
83
  const onLayout = (event: any) => {
79
84
  const { width } = event.nativeEvent.layout
80
85
  state.width = width