@momo-kits/native-kits 0.117.1-beta.11 → 0.117.1-beta.12
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.
|
@@ -110,7 +110,8 @@ fun PopupNotify(
|
|
|
110
110
|
image.ifNotNull(
|
|
111
111
|
Image(
|
|
112
112
|
source = image,
|
|
113
|
-
modifier = Modifier.fillMaxWidth().aspectRatio(1.777f)
|
|
113
|
+
modifier = Modifier.fillMaxWidth().aspectRatio(1.777f),
|
|
114
|
+
options = Options(alignment = Alignment.Center)
|
|
114
115
|
), null
|
|
115
116
|
)
|
|
116
117
|
|
|
@@ -6,6 +6,7 @@ import SwiftUI
|
|
|
6
6
|
public enum PopupButtonDirection {
|
|
7
7
|
case row
|
|
8
8
|
case column
|
|
9
|
+
case auto
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
// MARK: - PopupButtonType
|
|
@@ -38,6 +39,10 @@ public struct PopupDisplay: View {
|
|
|
38
39
|
// MARK: Public
|
|
39
40
|
|
|
40
41
|
public var body: some View {
|
|
42
|
+
var shouldUseColumn: Bool {
|
|
43
|
+
buttonDirection == .column || (buttonDirection == .auto && (closeButtonTitle.count > 12 || actionButtonTitle.count > 12))
|
|
44
|
+
}
|
|
45
|
+
|
|
41
46
|
VStack(spacing: 12) {
|
|
42
47
|
ZStack(alignment: .topTrailing) {
|
|
43
48
|
SwiftUI.Button(action: onClose) {
|
|
@@ -94,17 +99,17 @@ public struct PopupDisplay: View {
|
|
|
94
99
|
.padding(.horizontal, 24)
|
|
95
100
|
.padding(.bottom, 16)
|
|
96
101
|
|
|
97
|
-
if
|
|
102
|
+
if shouldUseColumn {
|
|
98
103
|
if buttonType == .text {
|
|
99
|
-
|
|
104
|
+
ColumnTextButtons
|
|
100
105
|
} else {
|
|
101
|
-
|
|
106
|
+
ColumnButtons
|
|
102
107
|
}
|
|
103
108
|
} else {
|
|
104
109
|
if buttonType == .text {
|
|
105
|
-
|
|
110
|
+
RowTextButtons
|
|
106
111
|
} else {
|
|
107
|
-
|
|
112
|
+
RowButtons
|
|
108
113
|
}
|
|
109
114
|
}
|
|
110
115
|
|
|
@@ -27,8 +27,9 @@ public struct PopupPromotion: View {
|
|
|
27
27
|
.frame(maxWidth: UIScreen.main.bounds.width - Spacing.XL * 2)
|
|
28
28
|
.clipped()
|
|
29
29
|
}
|
|
30
|
+
.scaledToFill()
|
|
30
31
|
.aspectRatio(0.72, contentMode: .fit)
|
|
31
|
-
.frame(maxWidth: UIScreen.main.bounds.width - Spacing.XL * 2)
|
|
32
|
+
.frame(maxWidth: UIScreen.main.bounds.width - Spacing.XL * 2, alignment: .center)
|
|
32
33
|
.clipped()
|
|
33
34
|
.onTapGesture {
|
|
34
35
|
onAction?()
|