@ledvance/ui-biz-bundle 1.1.97 → 1.1.98

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/ui-biz-bundle",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.1.97",
7
+ "version": "1.1.98",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
10
  "@ledvance/base": "^1.x",
@@ -1,14 +1,14 @@
1
1
  import React from 'react'
2
- import {SwitchButton, Utils} from "tuya-panel-kit";
2
+ import { SwitchButton, Utils } from "tuya-panel-kit";
3
3
  import Page from "@ledvance/base/src/components/Page";
4
4
  import I18n from "@ledvance/base/src/i18n/index";
5
- import {useDeviceInfo, useDp} from "@ledvance/base/src/models/modules/NativePropsSlice";
6
- import {useReactive} from "ahooks";
5
+ import { useDeviceInfo, useDp } from "@ledvance/base/src/models/modules/NativePropsSlice";
6
+ import { useReactive } from "ahooks";
7
7
  import Spacer from "@ledvance/base/src/components/Spacer";
8
- import {View, Text, StyleSheet, Image} from "react-native";
9
- import {Result} from "@ledvance/base/src/models/modules/Result";
8
+ import { View, Text, StyleSheet, Image } from "react-native";
9
+ import { Result } from "@ledvance/base/src/models/modules/Result";
10
10
  import res from "@ledvance/base/src/res";
11
- import {useParams} from "@ledvance/base/src/hooks/Hooks";
11
+ import { useParams } from "@ledvance/base/src/hooks/Hooks";
12
12
  import ThemeType from '@ledvance/base/src/config/themeType'
13
13
 
14
14
  const { convertX: cx } = Utils.RatioUtils
@@ -16,6 +16,8 @@ const { withTheme } = Utils.ThemeUtils
16
16
 
17
17
  export interface ChildLockPageParams {
18
18
  childLockCode: string
19
+ descriptionText?: string
20
+ switchTriggerEvent?: (v: boolean) => void
19
21
  }
20
22
 
21
23
  export function useChildLock(childLockCode: string): [boolean, (v: boolean) => Promise<Result<any>>] {
@@ -64,7 +66,7 @@ const ChildLockPage = (props: { theme?: ThemeType }) => {
64
66
  shadowColor: props.theme?.card.shadowColor,
65
67
  shadowOpacity: 0.2,
66
68
  shadowRadius: 8,
67
- elevation:8,
69
+ elevation: 8,
68
70
  shadowOffset: {
69
71
  width: 0,
70
72
  height: 4,
@@ -81,7 +83,7 @@ const ChildLockPage = (props: { theme?: ThemeType }) => {
81
83
  <View style={styles.tipInfoContainer}>
82
84
  <Image style={styles.image} source={res.ic_info} />
83
85
  <Text style={{ color: props.theme?.global.fontColor }}>
84
- {I18n.getLang('childlock_overview_description_text')}
86
+ {params.descriptionText ? params.descriptionText : I18n.getLang('childlock_overview_description_text')}
85
87
  </Text>
86
88
  </View>
87
89
  <View style={[styles.titleBGView, styles.shadow]}>
@@ -91,8 +93,9 @@ const ChildLockPage = (props: { theme?: ThemeType }) => {
91
93
  <SwitchButton value={childLock} onValueChange={async v => {
92
94
  state.loading = true
93
95
  await setChildLock(v)
96
+ params.switchTriggerEvent && params.switchTriggerEvent(v)
94
97
  state.loading = false
95
- } } />
98
+ }} />
96
99
  </View>
97
100
  </Page>)
98
101
  }