@momo-kits/native-kits 0.118.1-beta.1 → 0.118.1-beta.2
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.
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +2 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +1 -1
- package/ios/Popup/PopupDisplay.swift +44 -11
- package/ios/Popup/PopupPromotion.swift +2 -1
- package/package.json +1 -2
|
@@ -29,10 +29,10 @@ fun HeaderDefault(
|
|
|
29
29
|
val height = statusBarHeight + HEADER_HEIGHT.dp
|
|
30
30
|
Box(
|
|
31
31
|
modifier = Modifier.fillMaxWidth().height(height)
|
|
32
|
-
.background(backgroundColor
|
|
32
|
+
.background(if(headerTransparent && backgroundColor != null) backgroundColor else AppTheme.current.colors.background.surface)
|
|
33
33
|
.bottomBorder(
|
|
34
34
|
strokeWidth = 1.dp,
|
|
35
|
-
color = backgroundColor
|
|
35
|
+
color = if(headerTransparent && backgroundColor != null) backgroundColor else AppTheme.current.colors.border.default
|
|
36
36
|
)
|
|
37
37
|
) {
|
|
38
38
|
Box(
|
|
@@ -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
|
|
@@ -37,7 +38,14 @@ public struct PopupDisplay: View {
|
|
|
37
38
|
|
|
38
39
|
// MARK: Public
|
|
39
40
|
|
|
41
|
+
@State private var textHeight: CGFloat = .zero
|
|
42
|
+
@State private var isScrollable = false
|
|
43
|
+
|
|
40
44
|
public var body: some View {
|
|
45
|
+
var shouldUseColumn: Bool {
|
|
46
|
+
buttonDirection == .column || (buttonDirection == .auto && (closeButtonTitle.count > 12 || actionButtonTitle.count > 12))
|
|
47
|
+
}
|
|
48
|
+
|
|
41
49
|
VStack(spacing: 12) {
|
|
42
50
|
ZStack(alignment: .topTrailing) {
|
|
43
51
|
SwiftUI.Button(action: onClose) {
|
|
@@ -75,12 +83,37 @@ public struct PopupDisplay: View {
|
|
|
75
83
|
.lineLimit(2)
|
|
76
84
|
.accessibility(identifier: "title_popup_permission")
|
|
77
85
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
Group {
|
|
87
|
+
if isScrollable {
|
|
88
|
+
ScrollView(showsIndicators: false) {
|
|
89
|
+
Text(description)
|
|
90
|
+
.font(.paragraph)
|
|
91
|
+
.foregroundColor(.black)
|
|
92
|
+
.opacity(0.6)
|
|
93
|
+
.multilineTextAlignment(.leading)
|
|
94
|
+
.background(GeometryReader { geo in
|
|
95
|
+
Color.clear
|
|
96
|
+
.onAppear {
|
|
97
|
+
textHeight = geo.size.height
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
.frame(height: 60)
|
|
102
|
+
} else {
|
|
103
|
+
Text(description)
|
|
104
|
+
.font(.paragraph)
|
|
105
|
+
.foregroundColor(.black)
|
|
106
|
+
.opacity(0.6)
|
|
107
|
+
.multilineTextAlignment(.leading)
|
|
108
|
+
.background(GeometryReader { geo in
|
|
109
|
+
Color.clear
|
|
110
|
+
.onAppear {
|
|
111
|
+
textHeight = geo.size.height
|
|
112
|
+
isScrollable = textHeight > 60 // adjust threshold to ~3 lines
|
|
113
|
+
}
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
}.padding(.bottom, 8)
|
|
84
117
|
|
|
85
118
|
if(!errorCode.isEmpty) {
|
|
86
119
|
Text(errorCode)
|
|
@@ -94,17 +127,17 @@ public struct PopupDisplay: View {
|
|
|
94
127
|
.padding(.horizontal, 24)
|
|
95
128
|
.padding(.bottom, 16)
|
|
96
129
|
|
|
97
|
-
if
|
|
130
|
+
if shouldUseColumn {
|
|
98
131
|
if buttonType == .text {
|
|
99
|
-
|
|
132
|
+
ColumnTextButtons
|
|
100
133
|
} else {
|
|
101
|
-
|
|
134
|
+
ColumnButtons
|
|
102
135
|
}
|
|
103
136
|
} else {
|
|
104
137
|
if buttonType == .text {
|
|
105
|
-
|
|
138
|
+
RowTextButtons
|
|
106
139
|
} else {
|
|
107
|
-
|
|
140
|
+
RowButtons
|
|
108
141
|
}
|
|
109
142
|
}
|
|
110
143
|
|
|
@@ -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?()
|