@ledvance/base 1.0.35 → 1.0.37

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.
@@ -0,0 +1,72 @@
1
+ import React from 'react'
2
+ import { View, Text, TouchableOpacity } from 'react-native'
3
+ import { Utils, Popup } from 'tuya-panel-kit'
4
+
5
+ const { convertX: cx, height } = Utils.RatioUtils
6
+
7
+ interface InformationPopupProps{
8
+ title: string
9
+ confirmText: string
10
+ content: any
11
+ }
12
+
13
+ const InformationPopup = (props: InformationPopupProps) => {
14
+ console.log(props, '< --- props')
15
+
16
+ const titleNode = () => {
17
+ return (
18
+ <View style={{ flexDirection: 'row', height: cx(60), justifyContent:'space-between' }}>
19
+ <View style={{ flexDirection: 'column-reverse', flex: 1, alignItems: 'center',paddingLeft: cx(12) }}>
20
+ <Text style={{
21
+ fontSize: cx(16),
22
+ fontWeight: 'bold',
23
+ color: '#000000',
24
+ paddingBottom: cx(12),
25
+
26
+ }}>{props.title}</Text>
27
+ </View>
28
+ <TouchableOpacity
29
+ style={{
30
+ flexDirection: 'column-reverse',
31
+ alignItems:'center',
32
+ paddingBottom: cx(12),
33
+ paddingRight: cx(6)
34
+ }}
35
+ onPress={() => Popup.close()}
36
+ >
37
+ <Text
38
+ style={{
39
+ fontSize: cx(12),
40
+ color: '#FF6600',
41
+ }}
42
+ >
43
+ {props.confirmText}
44
+ </Text>
45
+ </TouchableOpacity>
46
+ </View>
47
+ )
48
+ }
49
+
50
+ Popup.custom({
51
+ content: <View style={{height: height - cx(60), padding: cx(24)}}>
52
+ {props.content}
53
+ </View>,
54
+ title: titleNode(),
55
+ footer: null,
56
+ confirmText: '',
57
+ cancelText: '',
58
+ onMaskPress: ({ close }) => {
59
+ close()
60
+ },
61
+ onConfirm: () => {
62
+ Popup.close()
63
+ },
64
+ footerWrapperStyle:{
65
+ display: 'none'
66
+ }
67
+ })
68
+
69
+
70
+ }
71
+
72
+ export default InformationPopup