@momo-kits/native-kits 0.117.1-beta.1 → 0.117.1-beta.3

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.
@@ -17,6 +17,7 @@ import androidx.compose.runtime.remember
17
17
  import androidx.compose.ui.Alignment
18
18
  import androidx.compose.ui.Modifier
19
19
  import androidx.compose.ui.draw.clip
20
+ import androidx.compose.ui.layout.ContentScale
20
21
  import androidx.compose.ui.semantics.semantics
21
22
  import androidx.compose.ui.semantics.testTag
22
23
  import androidx.compose.ui.unit.dp
@@ -41,6 +42,7 @@ fun PopupPromotion(
41
42
  indication = null,
42
43
  onClick = onPress
43
44
  ),
45
+ options = Options(alignment = Alignment.Center, contentScale = ContentScale.Fit)
44
46
  )
45
47
  }
46
48
  Box(
@@ -34,17 +34,13 @@ public struct PopupDisplay: View {
34
34
  self.actionButtonTitle = actionButtonTitle
35
35
  self.errorCode = errorCode
36
36
  }
37
-
38
- var placeholder: AnyView?
39
-
40
- @State var error: Bool = false
41
37
 
42
38
  // MARK: Public
43
39
 
44
40
  public var body: some View {
45
41
  VStack(spacing: 12) {
46
42
  ZStack(alignment: .topTrailing) {
47
- SwiftUI.Button(action: onPressClose) {
43
+ SwiftUI.Button(action: onClose) {
48
44
  Image(systemName: "xmark.circle.fill")
49
45
  .resizable()
50
46
  .frame(width: 22, height: 22)
@@ -56,20 +52,20 @@ public struct PopupDisplay: View {
56
52
  .zIndex(1)
57
53
  .accessibility(identifier: "ic_popup_close")
58
54
 
59
- VStack {
60
- if(!url.isEmpty) {
61
- WebImage(url: URL(string: url), isAnimating: .constant(true))
62
- .resizable()
63
- .placeholder {
64
- Rectangle()
65
- .fill(Color.gray.opacity(0.3))
66
- .frame(maxWidth: .infinity, maxHeight: 184)
67
- }
68
- .scaledToFill()
69
- .frame(maxWidth: .infinity)
70
- .clipShape(RoundedCorner(radius: 15, corners: [.topLeft, .topRight]))
71
- .aspectRatio(2, contentMode: .fit)
72
- }
55
+ VStack {
56
+ if(!url.isEmpty) {
57
+ WebImage(url: URL(string: url), isAnimating: .constant(true))
58
+ .resizable()
59
+ .placeholder {
60
+ Rectangle()
61
+ .fill(Color.gray.opacity(0.3))
62
+ .frame(maxWidth: .infinity, maxHeight: 184)
63
+ }
64
+ .scaledToFill()
65
+ .frame(maxWidth: .infinity)
66
+ .clipShape(RoundedCorner(radius: 15, corners: [.topLeft, .topRight]))
67
+ .aspectRatio(2, contentMode: .fit)
68
+ }
73
69
  VStack(alignment: .leading) {
74
70
  Text(title)
75
71
  .foregroundColor(.black)
@@ -85,7 +81,7 @@ public struct PopupDisplay: View {
85
81
  .opacity(0.6)
86
82
  .multilineTextAlignment(.leading)
87
83
  .padding(.bottom, 8)
88
-
84
+
89
85
  if(!errorCode.isEmpty) {
90
86
  Text(errorCode)
91
87
  .foregroundColor(Colors.black12)
@@ -134,7 +130,7 @@ public struct PopupDisplay: View {
134
130
  var actionButtonTitle: String
135
131
  var closeButtonTitle: String
136
132
  var errorCode: String
137
-
133
+
138
134
  var RowTextButtons: some View {
139
135
  HStack {
140
136
  SwiftUI.Button(action: onPressCloseButton) {
@@ -195,9 +191,4 @@ public struct PopupDisplay: View {
195
191
  .padding(.bottom, 24)
196
192
  }
197
193
 
198
-
199
- func onPressClose(){
200
- isPresented = false
201
- onClose()
202
- }
203
194
  }
@@ -4,20 +4,19 @@ import SDWebImageSwiftUI
4
4
  public struct PopupPromotion: View {
5
5
  var imageUrl: String
6
6
  var onIconClose: (() -> Void)?
7
- var onRequestClose: (((() -> Void)?) -> Void)? = nil
7
+ var onAction: (() -> Void)?
8
+
8
9
 
9
-
10
10
  public init(
11
11
  imageUrl: String,
12
12
  onIconClose: (() -> Void)? = nil,
13
- onRequestClose: (((() -> Void)?) -> Void)? = nil
14
-
13
+ onAction: (() -> Void)? = nil
15
14
  ) {
16
15
  self.imageUrl = imageUrl
17
16
  self.onIconClose = onIconClose
18
- self.onRequestClose = onRequestClose
17
+ self.onAction = onAction
19
18
  }
20
-
19
+
21
20
  public var body: some View {
22
21
  VStack(spacing: 8) {
23
22
  WebImage(url: URL(string: imageUrl)!)
@@ -31,25 +30,28 @@ public struct PopupPromotion: View {
31
30
  .aspectRatio(0.72, contentMode: .fit)
32
31
  .frame(maxWidth: UIScreen.main.bounds.width - Spacing.XL * 2)
33
32
  .clipped()
34
-
33
+ .onTapGesture {
34
+ onAction?()
35
+ }
36
+
35
37
  buildCloseIcon()
36
38
  }
37
39
  .accessibility(identifier: "popup_promotion")
38
40
  }
39
-
41
+
40
42
  @ViewBuilder
41
43
  private func buildCloseIcon() -> some View {
42
44
  HStack {
43
45
  Spacer()
44
46
  SwiftUI.Button(action: {
45
- onAction(callback: onIconClose)
47
+ onIconClose?()
46
48
  }) {
47
49
  ZStack {
48
50
  Circle()
49
51
  .strokeBorder(Colors.black01, lineWidth: 2)
50
52
  .background(Circle().fill(Colors.black17))
51
53
  .frame(width: 20, height: 20)
52
-
54
+
53
55
  Icon(source: "navigation_close", size: 14, color: Colors.black01)
54
56
  }
55
57
  }
@@ -57,14 +59,7 @@ public struct PopupPromotion: View {
57
59
  Spacer()
58
60
  }
59
61
  }
60
-
61
- private func onAction(callback: (() -> Void)?) {
62
- if let onRequestClose = onRequestClose {
63
- onRequestClose(callback)
64
- } else {
65
- callback?()
66
- }
67
- }
62
+
68
63
  }
69
64
 
70
65
 
package/local.properties CHANGED
@@ -4,5 +4,5 @@
4
4
  # Location of the SDK. This is only used by Gradle.
5
5
  # For customization when using a Version Control System, please read the
6
6
  # header note.
7
- #Wed Aug 21 14:20:12 ICT 2024
8
- sdk.dir=/Users/huynhdung/Library/Android/sdk
7
+ #Thu Jan 09 10:43:10 ICT 2025
8
+ sdk.dir=/Users/sophia/Library/Android/sdk
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.117.1-beta.1",
3
+ "version": "0.117.1-beta.3",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},