@momo-kits/native-kits 0.117.1-beta.16 → 0.117.1-beta.17
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.
|
@@ -57,6 +57,7 @@ fun PopupNotify(
|
|
|
57
57
|
secondary: PopupAction? = null,
|
|
58
58
|
buttonDirection: PopupActionDirection = PopupActionDirection.ROW,
|
|
59
59
|
onIconClose: () -> Unit,
|
|
60
|
+
isShowCloseIcon: Boolean = true,
|
|
60
61
|
) {
|
|
61
62
|
var isScroll by remember { mutableStateOf(false) }
|
|
62
63
|
val layoutResult = remember { mutableStateOf<TextLayoutResult?>(null) }
|
|
@@ -144,34 +145,36 @@ fun PopupNotify(
|
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
147
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
148
|
+
if(isShowCloseIcon) {
|
|
149
|
+
Box(
|
|
150
|
+
Modifier
|
|
151
|
+
.width(22.dp)
|
|
152
|
+
.height(22.dp)
|
|
153
|
+
.offset(x = -(1).dp, y = (-11).dp)
|
|
154
|
+
.background(
|
|
155
|
+
color = AppTheme.current.colors.text.default,
|
|
156
|
+
shape = RoundedCornerShape(Radius.M)
|
|
157
|
+
)
|
|
158
|
+
.border(
|
|
159
|
+
width = 2.dp,
|
|
160
|
+
color = AppTheme.current.colors.background.surface,
|
|
161
|
+
shape = RoundedCornerShape(Radius.M)
|
|
162
|
+
)
|
|
163
|
+
.clip(RoundedCornerShape(100))
|
|
164
|
+
.clickable(
|
|
165
|
+
interactionSource = remember { MutableInteractionSource() },
|
|
166
|
+
indication = null,
|
|
167
|
+
onClick = { onClose { onIconClose() } }
|
|
168
|
+
),
|
|
169
|
+
contentAlignment = Alignment.Center
|
|
170
|
+
) {
|
|
171
|
+
Icon(
|
|
172
|
+
source = "navigation_close",
|
|
158
173
|
color = AppTheme.current.colors.background.surface,
|
|
159
|
-
|
|
174
|
+
size = 16.dp,
|
|
175
|
+
modifier = Modifier.setAutomationId("ic_popup_close")
|
|
160
176
|
)
|
|
161
|
-
|
|
162
|
-
.clickable(
|
|
163
|
-
interactionSource = remember { MutableInteractionSource() },
|
|
164
|
-
indication = null,
|
|
165
|
-
onClick = { onClose { onIconClose() } }
|
|
166
|
-
),
|
|
167
|
-
contentAlignment = Alignment.Center
|
|
168
|
-
) {
|
|
169
|
-
Icon(
|
|
170
|
-
source = "navigation_close",
|
|
171
|
-
color = AppTheme.current.colors.background.surface,
|
|
172
|
-
size = 16.dp,
|
|
173
|
-
modifier = Modifier.setAutomationId("ic_popup_close")
|
|
174
|
-
)
|
|
177
|
+
}
|
|
175
178
|
}
|
|
176
179
|
}
|
|
177
180
|
}
|
|
@@ -21,7 +21,7 @@ public enum PopupButtonType {
|
|
|
21
21
|
public struct PopupDisplay: View {
|
|
22
22
|
// MARK: Lifecycle
|
|
23
23
|
|
|
24
|
-
public init(isPresented: Binding<Bool>, title: String = "", description: String = "", url: String = "", buttonDirection: PopupButtonDirection = .column, buttonType: PopupButtonType = .button, actionButtonTitle: String = "", closeButtonTitle: String = "", onPressAction: @escaping () -> Void = {}, onPressCloseButton: @escaping () -> Void = {}, onClose: @escaping () -> Void = {}, errorCode: String = "") {
|
|
24
|
+
public init(isPresented: Binding<Bool>, title: String = "", description: String = "", url: String = "", buttonDirection: PopupButtonDirection = .column, buttonType: PopupButtonType = .button, actionButtonTitle: String = "", closeButtonTitle: String = "", onPressAction: @escaping () -> Void = {}, onPressCloseButton: @escaping () -> Void = {}, onClose: @escaping () -> Void = {}, errorCode: String = "", isShowCloseIcon: Bool = true) {
|
|
25
25
|
self._isPresented = isPresented
|
|
26
26
|
self.title = title
|
|
27
27
|
self.description = description
|
|
@@ -34,6 +34,7 @@ public struct PopupDisplay: View {
|
|
|
34
34
|
self.closeButtonTitle = closeButtonTitle
|
|
35
35
|
self.actionButtonTitle = actionButtonTitle
|
|
36
36
|
self.errorCode = errorCode
|
|
37
|
+
self.isShowCloseIcon = isShowCloseIcon
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
// MARK: Public
|
|
@@ -48,17 +49,19 @@ public struct PopupDisplay: View {
|
|
|
48
49
|
|
|
49
50
|
VStack(spacing: 12) {
|
|
50
51
|
ZStack(alignment: .topTrailing) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
if(isShowCloseIcon) {
|
|
53
|
+
SwiftUI.Button(action: onClose) {
|
|
54
|
+
Image(systemName: "xmark.circle.fill")
|
|
55
|
+
.resizable()
|
|
56
|
+
.frame(width: 22, height: 22)
|
|
57
|
+
.overlay(RoundedRectangle(cornerRadius: Radius.L).stroke(Colors.black01, lineWidth: 2))
|
|
58
|
+
}.foregroundColor(Colors.black20)
|
|
59
|
+
.background(Colors.black01.cornerRadius(15))
|
|
60
|
+
.padding(.trailing, -11)
|
|
61
|
+
.padding(.top, -11)
|
|
62
|
+
.zIndex(1)
|
|
63
|
+
.accessibility(identifier: "ic_popup_close")
|
|
64
|
+
}
|
|
62
65
|
|
|
63
66
|
VStack {
|
|
64
67
|
if(!url.isEmpty) {
|
|
@@ -162,6 +165,7 @@ public struct PopupDisplay: View {
|
|
|
162
165
|
var actionButtonTitle: String
|
|
163
166
|
var closeButtonTitle: String
|
|
164
167
|
var errorCode: String
|
|
168
|
+
var isShowCloseIcon: Bool
|
|
165
169
|
|
|
166
170
|
var RowTextButtons: some View {
|
|
167
171
|
HStack {
|
|
@@ -199,7 +203,9 @@ public struct PopupDisplay: View {
|
|
|
199
203
|
|
|
200
204
|
var RowButtons: some View {
|
|
201
205
|
HStack {
|
|
202
|
-
|
|
206
|
+
if(!closeButtonTitle.isEmpty) {
|
|
207
|
+
Button(title: closeButtonTitle, action: onPressCloseButton, type: .secondary, size: .medium).accessibility(identifier: "btn_popup_cancel")
|
|
208
|
+
}
|
|
203
209
|
Button(title: actionButtonTitle, action: onPressAction, size: .medium)
|
|
204
210
|
.accessibility(identifier: "btn_popup_allow")
|
|
205
211
|
}
|
|
@@ -215,8 +221,9 @@ public struct PopupDisplay: View {
|
|
|
215
221
|
action: onPressAction,
|
|
216
222
|
size: .medium
|
|
217
223
|
).accessibility(identifier: "btn_popup_allow")
|
|
218
|
-
|
|
219
|
-
|
|
224
|
+
if(!closeButtonTitle.isEmpty) {
|
|
225
|
+
Button(title: closeButtonTitle, action: onPressCloseButton, type: .secondary, size: .medium).accessibility(identifier: "btn_popup_cancel")
|
|
226
|
+
}
|
|
220
227
|
}
|
|
221
228
|
.frame(maxWidth: .infinity, alignment: .trailing)
|
|
222
229
|
.padding(.horizontal, 24)
|