@ledvance/base 1.2.98 → 1.3.0
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 +1 -1
- package/src/api/native.ts +2 -0
- package/src/components/AdvanceList.tsx +13 -4
- package/src/components/CircularProgress.tsx +7 -8
- package/src/components/Page.tsx +2 -0
- package/src/components/ldvTopName.tsx +4 -1
- package/src/components/segmentControl.tsx +3 -3
- package/src/i18n/strings.ts +11851 -11851
package/package.json
CHANGED
package/src/api/native.ts
CHANGED
|
@@ -4,12 +4,15 @@ import AdvanceCard, { AdvancedData } from './AdvanceCard'
|
|
|
4
4
|
import Spacer from './Spacer'
|
|
5
5
|
import { useNavigation } from '@react-navigation/core'
|
|
6
6
|
import { Utils } from 'tuya-panel-kit'
|
|
7
|
+
import { getMicrophoneAccess } from '@ledvance/base/src/api/native'
|
|
7
8
|
|
|
8
9
|
const { convertX: cx } = Utils.RatioUtils
|
|
9
10
|
|
|
11
|
+
const MusicRouterKey = ['ui_biz_music', 'group_ui_biz_music']
|
|
12
|
+
|
|
10
13
|
export interface AdvanceListProps {
|
|
11
14
|
advanceData: AdvancedData[],
|
|
12
|
-
onAdvanceItemClick?: (advanceData: AdvancedData, index: number) =>
|
|
15
|
+
onAdvanceItemClick?: (advanceData: AdvancedData, index: number) => void | undefined
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
function AdvanceList(props: AdvanceListProps) {
|
|
@@ -21,9 +24,15 @@ function AdvanceList(props: AdvanceListProps) {
|
|
|
21
24
|
<View style={styles.item}>
|
|
22
25
|
<AdvanceCard
|
|
23
26
|
data={item}
|
|
24
|
-
onPress={() => {
|
|
25
|
-
if
|
|
26
|
-
|
|
27
|
+
onPress={async () => {
|
|
28
|
+
if(MusicRouterKey.includes(item.router.key)){
|
|
29
|
+
getMicrophoneAccess().then(res =>{
|
|
30
|
+
if(!res) return
|
|
31
|
+
})
|
|
32
|
+
}else{
|
|
33
|
+
if (!onAdvanceItemClick || onAdvanceItemClick(item, index)) {
|
|
34
|
+
navigation.navigate(item.router.key, item.router.params)
|
|
35
|
+
}
|
|
27
36
|
}
|
|
28
37
|
}}>
|
|
29
38
|
{item.icons && <View style={{
|
|
@@ -9,20 +9,19 @@ export interface CircularProgressProps extends PropsWithChildren<ViewProps> {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export function CircularProgress(props: CircularProgressProps) {
|
|
12
|
-
return <Progress
|
|
13
|
-
foreColor={{
|
|
14
|
-
'0%': '#f60',
|
|
15
|
-
'100%': '#f60',
|
|
16
|
-
}}
|
|
12
|
+
return <Progress.Double
|
|
17
13
|
style={[{ width: props.size, height: props.size }, props.style]}
|
|
18
14
|
disabled={true}
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
thumbRadius={Math.trunc(props.strokeWidth / 2) - 0.5}
|
|
16
|
+
minThumbFill={'#f60'}
|
|
17
|
+
minThumbStroke={'#f60'}
|
|
21
18
|
thumbStroke={'#f60'}
|
|
22
19
|
thumbFill={'#f60'}
|
|
23
20
|
thumbStrokeWidth={0}
|
|
24
21
|
scaleHeight={props.strokeWidth}
|
|
25
|
-
|
|
22
|
+
minValue={0}
|
|
23
|
+
maxValue={props.progress}
|
|
24
|
+
foreColor={'#f60'}
|
|
26
25
|
startDegree={270}
|
|
27
26
|
andDegree={360}
|
|
28
27
|
renderCenterView={
|
package/src/components/Page.tsx
CHANGED
|
@@ -23,6 +23,7 @@ interface PageProps extends PropsWithChildren<ViewProps> {
|
|
|
23
23
|
headlineIcon?: string | number
|
|
24
24
|
onHeadlineIconClick?: () => void
|
|
25
25
|
headlineContent?: React.ReactNode
|
|
26
|
+
headlineTopContent?: React.ReactNode
|
|
26
27
|
showGreenery?: boolean
|
|
27
28
|
greeneryIcon?: string | undefined | number
|
|
28
29
|
loading?: boolean
|
|
@@ -88,6 +89,7 @@ const Page = (props: PageProps) => {
|
|
|
88
89
|
showGreenery={props.showGreenery}
|
|
89
90
|
greeneryIcon={props.greeneryIcon}
|
|
90
91
|
headlineContent={props.headlineContent}
|
|
92
|
+
headlineTopContent={props.headlineTopContent}
|
|
91
93
|
/>}
|
|
92
94
|
{props.children}
|
|
93
95
|
</View>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Spacer from '@ledvance/base/src/components/Spacer'
|
|
1
2
|
import React from 'react'
|
|
2
3
|
import {Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native'
|
|
3
4
|
import {Utils} from 'tuya-panel-kit'
|
|
@@ -13,6 +14,7 @@ interface LdvTopNameProps {
|
|
|
13
14
|
showGreenery?: boolean
|
|
14
15
|
greeneryIcon?: string | undefined | number
|
|
15
16
|
headlineContent?: React.ReactNode
|
|
17
|
+
headlineTopContent?: React.ReactNode
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
const LdvTopName = (props: LdvTopNameProps) => {
|
|
@@ -31,12 +33,13 @@ const LdvTopName = (props: LdvTopNameProps) => {
|
|
|
31
33
|
})
|
|
32
34
|
return (
|
|
33
35
|
<View style={styles.container}>
|
|
36
|
+
{props.headlineTopContent && props.headlineTopContent}
|
|
37
|
+
{!props.headlineTopContent && <Spacer height={cx(38)}/>}
|
|
34
38
|
<View
|
|
35
39
|
style={{
|
|
36
40
|
flexDirection: 'row',
|
|
37
41
|
justifyContent: 'space-between',
|
|
38
42
|
alignItems: 'center',
|
|
39
|
-
marginTop: cx(38),
|
|
40
43
|
}}>
|
|
41
44
|
<View style={{flexDirection: 'row', flex: 1}}>
|
|
42
45
|
<Text style={styles.title}>
|
|
@@ -6,7 +6,7 @@ const {convertX} = Utils.RatioUtils
|
|
|
6
6
|
|
|
7
7
|
export default function SegmentControl(props) {
|
|
8
8
|
|
|
9
|
-
const {title1, title2, isFirst, setIsFirst, style} = props
|
|
9
|
+
const {title1, title2, isFirst, setIsFirst, style, tabStyle} = props
|
|
10
10
|
|
|
11
11
|
return (<View style={{}}>
|
|
12
12
|
<View style={[{
|
|
@@ -25,7 +25,7 @@ export default function SegmentControl(props) {
|
|
|
25
25
|
borderRadius: convertX(6.9),
|
|
26
26
|
}, isFirst ?
|
|
27
27
|
{backgroundColor: '#fff', margin: convertX(2), borderRadius: 6.9} :
|
|
28
|
-
{backgroundColor: '#eeeeef'}]
|
|
28
|
+
{backgroundColor: '#eeeeef'}, tabStyle]
|
|
29
29
|
} onPress={() => setIsFirst(true)}>
|
|
30
30
|
<Text
|
|
31
31
|
style={{
|
|
@@ -48,7 +48,7 @@ export default function SegmentControl(props) {
|
|
|
48
48
|
},
|
|
49
49
|
!isFirst ?
|
|
50
50
|
{backgroundColor: '#fff'} :
|
|
51
|
-
{backgroundColor: '#eeeeef'}]
|
|
51
|
+
{backgroundColor: '#eeeeef'}, tabStyle]
|
|
52
52
|
}
|
|
53
53
|
onPress={() => setIsFirst(false)}>
|
|
54
54
|
<Text
|