@momo-kits/native-kits 0.168.1-beta.28 → 0.168.1-beta.29

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.
@@ -22,6 +22,7 @@ public struct PopupNotifyProps {
22
22
  public var buttonDirection: PopupActionDirection
23
23
  public var onIconClose: () -> Void
24
24
  public var isShowCloseIcon: Bool
25
+ public var highlightText: [String]
25
26
 
26
27
  public init(
27
28
  image: String = "",
@@ -32,7 +33,8 @@ public struct PopupNotifyProps {
32
33
  secondary: PopupAction? = nil,
33
34
  buttonDirection: PopupActionDirection = .row,
34
35
  onIconClose: @escaping () -> Void,
35
- isShowCloseIcon: Bool = true
36
+ isShowCloseIcon: Bool = true,
37
+ highlightText: [String] = []
36
38
  ) {
37
39
  self.image = image
38
40
  self.title = title
@@ -43,6 +45,7 @@ public struct PopupNotifyProps {
43
45
  self.buttonDirection = buttonDirection
44
46
  self.onIconClose = onIconClose
45
47
  self.isShowCloseIcon = isShowCloseIcon
48
+ self.highlightText = highlightText
46
49
  }
47
50
  }
48
51
 
@@ -161,7 +164,8 @@ public struct PopupNotify: View {
161
164
  MomoText(
162
165
  props.description,
163
166
  typography: .bodyDefaultRegular,
164
- accessibilityId: "description_popup_permission"
167
+ accessibilityId: "description_popup_permission",
168
+ highlightText: props.highlightText
165
169
  )
166
170
  .frame(maxWidth: .infinity, alignment: .leading)
167
171
  .popupReadHeight($descriptionHeight)
@@ -281,8 +281,8 @@ public struct MomoText: View {
281
281
  self.fontFamily = fontFamily
282
282
  }
283
283
 
284
- init(_ content: String, typography: TypographyStyle, highlightText: [String]) {
285
- self.init(content, typography: typography)
284
+ init(_ content: String, typography: TypographyStyle, accessibilityId: String? = nil, highlightText: [String]) {
285
+ self.init(content, typography: typography, accessibilityId: accessibilityId)
286
286
  self.highlightText = highlightText
287
287
  }
288
288
 
@@ -13,6 +13,14 @@ struct PopupNotifyDemo: View {
13
13
 
14
14
  // MARK: - Preview
15
15
 
16
+ // Figma Risk - eKYC (node 51445-177824)
17
+ private let popupHighlightTitle = "Tạm khoá giao dịch để báo vệ bạn"
18
+ private let popupHighlightSentence =
19
+ "Mỗi ngày có ít nhất 20 người bị lừa đảo hơn 100 triệu đồng trong các giao dịch có dấu hiệu tương tự"
20
+ private let popupHighlightDescription =
21
+ "Hệ thống AI của MoMo đánh giá giao dịch này có dấu hiệu rủi ro. \(popupHighlightSentence)\n"
22
+ + "Hãy kiểm tra lại người nhận và lý do chuyển tiền trước khi quyết định tiếp tục."
23
+
16
24
  @available(iOS 16.0, *)
17
25
  private struct PopupNotifyPreview: View {
18
26
  @EnvironmentObject private var navigator: Navigator
@@ -21,6 +29,22 @@ private struct PopupNotifyPreview: View {
21
29
  BasicColumnBox("PopupNotify", alignment: .leading) {
22
30
  MoMoUIKits.Button(title: "Show popup", action: { show() }, size: .large)
23
31
  }
32
+ BasicColumnBox("Highlight text", alignment: .leading) {
33
+ MoMoUIKits.Button(title: "Show highlight popup", action: { showHighlight() }, type: .secondary, size: .large)
34
+ }
35
+ }
36
+
37
+ private func showHighlight() {
38
+ navigator.showModal {
39
+ PopupNotify(props: PopupNotifyProps(
40
+ title: popupHighlightTitle,
41
+ description: popupHighlightDescription,
42
+ primary: PopupAction(title: "Primary", onPress: { navigator.hideOverplay() }),
43
+ secondary: PopupAction(title: "Secondary", onPress: { navigator.hideOverplay() }),
44
+ onIconClose: { navigator.hideOverplay() },
45
+ highlightText: [popupHighlightSentence]
46
+ ))
47
+ }
24
48
  }
25
49
 
26
50
  private func show() {
@@ -53,6 +77,7 @@ private struct PopupNotifyPlayground: View {
53
77
  @State private var image = "https://static.momocdn.net/app/img/popup_permission/img_permission_popup_camera.png"
54
78
  @State private var title = "Title"
55
79
  @State private var description = "Check lại một nhịp auto chuyển sang dạng CTA."
80
+ @State private var highlightText = ""
56
81
  @State private var error = "9004"
57
82
  @State private var primaryTitle = "Primary"
58
83
  @State private var secondaryTitle = "Secondary"
@@ -68,6 +93,7 @@ private struct PopupNotifyPlayground: View {
68
93
  .string("Image", $image),
69
94
  .string("Title", $title),
70
95
  .string("Description", $description),
96
+ .string("HighlightText: [String] (comma-separated)", $highlightText),
71
97
  .string("Error", $error),
72
98
  .string("PrimaryTitle", $primaryTitle),
73
99
  .string("SecondaryTitle", $secondaryTitle),
@@ -88,7 +114,9 @@ private struct PopupNotifyPlayground: View {
88
114
  secondary: PopupAction(title: secondaryTitle, onPress: { navigator.hideOverplay() }),
89
115
  buttonDirection: (direction?.value as? PopupActionDirection) ?? .auto,
90
116
  onIconClose: { navigator.hideOverplay() },
91
- isShowCloseIcon: showClose
117
+ isShowCloseIcon: showClose,
118
+ highlightText: highlightText.components(separatedBy: ",")
119
+ .map { $0.trimmingCharacters(in: .whitespaces) }
92
120
  ))
93
121
  }
94
122
  }
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.168.1-beta.28",
3
+ "version": "0.168.1-beta.29",
4
4
  "private": false,
5
5
  "dependeNavigationncies": {},
6
- "devDependencies": {},
7
6
  "license": "MoMo"
8
7
  }