@momo-kits/native-kits 0.114.2-beta.8 → 0.117.1-beta.1
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/HeaderTitle.kt +5 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +4 -3
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/{PromotionPopup.kt → PopupPromotion.kt} +9 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -5
- package/ios/Application/Components.swift +32 -20
- package/ios/Application/Screen.swift +27 -15
- package/ios/Checkbox/Checkbox.swift +1 -1
- package/ios/Popup/PopupDisplay.swift +17 -3
- package/ios/Popup/PopupPromotion.swift +60 -41
- package/local.properties +2 -2
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ import androidx.compose.runtime.Composable
|
|
|
4
4
|
import androidx.compose.ui.Modifier
|
|
5
5
|
import androidx.compose.ui.graphics.Color
|
|
6
6
|
import androidx.compose.ui.text.style.TextAlign
|
|
7
|
+
import androidx.compose.ui.unit.sp
|
|
7
8
|
import androidx.compose.ui.zIndex
|
|
8
9
|
import vn.momo.kits.components.Text
|
|
9
10
|
import vn.momo.kits.const.Typography
|
|
@@ -19,7 +20,10 @@ fun HeaderTitle(
|
|
|
19
20
|
modifier = Modifier.then(modifier).zIndex(1f),
|
|
20
21
|
text = title,
|
|
21
22
|
textAlign = textAlign,
|
|
22
|
-
style = Typography.actionSBold
|
|
23
|
+
style = Typography.actionSBold.copy(
|
|
24
|
+
fontSize = 15.sp,
|
|
25
|
+
lineHeight = 22.sp,
|
|
26
|
+
),
|
|
23
27
|
color = color,
|
|
24
28
|
maxLines = 1
|
|
25
29
|
)
|
|
@@ -11,6 +11,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
|
|
|
11
11
|
import androidx.compose.runtime.Composable
|
|
12
12
|
import androidx.compose.ui.Alignment
|
|
13
13
|
import androidx.compose.ui.Modifier
|
|
14
|
+
import androidx.compose.ui.graphics.Color
|
|
14
15
|
import androidx.compose.ui.unit.dp
|
|
15
16
|
import vn.momo.kits.const.AppTheme
|
|
16
17
|
import vn.momo.kits.const.Colors
|
|
@@ -27,8 +28,8 @@ fun CheckBox(
|
|
|
27
28
|
title: String = "",
|
|
28
29
|
) {
|
|
29
30
|
var borderColor = AppTheme.current.colors.text.default
|
|
30
|
-
var backgroundColor =
|
|
31
|
-
val iconSource = if (indeterminate) "
|
|
31
|
+
var backgroundColor = Color.Transparent
|
|
32
|
+
val iconSource = if (indeterminate) "navigation_minus" else "ic_checked"
|
|
32
33
|
|
|
33
34
|
if (checked) {
|
|
34
35
|
borderColor = AppTheme.current.colors.primary
|
|
@@ -36,7 +37,7 @@ fun CheckBox(
|
|
|
36
37
|
}
|
|
37
38
|
if (disabled) {
|
|
38
39
|
borderColor = AppTheme.current.colors.border.disable
|
|
39
|
-
backgroundColor =
|
|
40
|
+
backgroundColor = Color.Transparent
|
|
40
41
|
if (checked) {
|
|
41
42
|
borderColor = AppTheme.current.colors.background.tonal
|
|
42
43
|
backgroundColor = AppTheme.current.colors.background.tonal
|
|
@@ -25,15 +25,22 @@ import vn.momo.kits.const.Radius
|
|
|
25
25
|
import vn.momo.kits.const.Spacing
|
|
26
26
|
|
|
27
27
|
@Composable
|
|
28
|
-
fun
|
|
28
|
+
fun PopupPromotion(
|
|
29
29
|
source: String = "",
|
|
30
|
+
onPress: (() -> Unit) = {},
|
|
30
31
|
onClose: (() -> Unit) = {},
|
|
31
32
|
) {
|
|
32
33
|
Column(Modifier.semantics { testTag = "popup_notify" }) {
|
|
33
34
|
if (source.isNotEmpty()) {
|
|
34
35
|
Image(
|
|
35
36
|
source = source,
|
|
36
|
-
modifier = Modifier.fillMaxWidth()
|
|
37
|
+
modifier = Modifier.fillMaxWidth()
|
|
38
|
+
.aspectRatio(0.72f)
|
|
39
|
+
.clickable(
|
|
40
|
+
interactionSource = remember { MutableInteractionSource() },
|
|
41
|
+
indication = null,
|
|
42
|
+
onClick = onPress
|
|
43
|
+
),
|
|
37
44
|
)
|
|
38
45
|
}
|
|
39
46
|
Box(
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
package vn.momo.kits.modifier
|
|
2
2
|
|
|
3
|
-
import androidx.compose.foundation.clickable
|
|
4
|
-
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
5
|
-
import androidx.compose.runtime.remember
|
|
6
3
|
import androidx.compose.ui.Modifier
|
|
7
|
-
import androidx.compose.ui.composed
|
|
8
|
-
import androidx.compose.ui.semantics.Role
|
|
9
4
|
import androidx.compose.ui.semantics.contentDescription
|
|
10
5
|
import androidx.compose.ui.semantics.semantics
|
|
11
6
|
import androidx.compose.ui.semantics.testTag
|
|
@@ -45,13 +45,24 @@ func safeAreaTopInset() -> CGFloat {
|
|
|
45
45
|
public struct HeaderBackground: View {
|
|
46
46
|
var headerType: HeaderType = .default
|
|
47
47
|
var scrollState: CGFloat
|
|
48
|
+
var isTransparent: Bool = false
|
|
49
|
+
|
|
50
|
+
public init(
|
|
51
|
+
headerType: HeaderType = .default,
|
|
52
|
+
scrollState: CGFloat = 0,
|
|
53
|
+
isTransparent: Bool = false
|
|
54
|
+
) {
|
|
55
|
+
self.headerType = headerType
|
|
56
|
+
self.scrollState = scrollState
|
|
57
|
+
self.isTransparent = isTransparent
|
|
58
|
+
}
|
|
48
59
|
|
|
49
60
|
public var body: some View {
|
|
50
61
|
|
|
51
62
|
let statusBarHeight = safeAreaTopInset()
|
|
52
63
|
|
|
53
64
|
let opacity = 1 - CGFloat(scrollState) / 200
|
|
54
|
-
let backgroundColor =
|
|
65
|
+
let backgroundColor = isTransparent ? Color.clear : Colors.black01
|
|
55
66
|
|
|
56
67
|
Group {
|
|
57
68
|
if headerType == .default {
|
|
@@ -62,7 +73,9 @@ public struct HeaderBackground: View {
|
|
|
62
73
|
.fill(backgroundColor)
|
|
63
74
|
.frame(height: height)
|
|
64
75
|
.shadow(color: Colors.black20.opacity(0.2), radius: 10, x: 0, y: -2)
|
|
65
|
-
.overlay(
|
|
76
|
+
.overlay(
|
|
77
|
+
isTransparent ? nil :
|
|
78
|
+
Rectangle()
|
|
66
79
|
.fill(LinearGradient(
|
|
67
80
|
gradient: Gradient(colors: [
|
|
68
81
|
Color(red: 1, green: 0.8, blue: 0.87),
|
|
@@ -111,6 +124,7 @@ public struct Header: View {
|
|
|
111
124
|
var animatedHeader: AnimatedHeader? = nil
|
|
112
125
|
var scrollState: CGFloat = 0
|
|
113
126
|
var inputSearchProps: InputSearchProps? = nil
|
|
127
|
+
var tintColor: Color? = nil
|
|
114
128
|
|
|
115
129
|
@State private var colorFraction: CGFloat = 0
|
|
116
130
|
|
|
@@ -123,7 +137,8 @@ public struct Header: View {
|
|
|
123
137
|
opacity: CGFloat? = nil,
|
|
124
138
|
animatedHeader: AnimatedHeader? = nil,
|
|
125
139
|
scrollState: CGFloat = 0,
|
|
126
|
-
inputSearchProps: InputSearchProps? = nil
|
|
140
|
+
inputSearchProps: InputSearchProps? = nil,
|
|
141
|
+
tintColor: Color? = nil
|
|
127
142
|
) {
|
|
128
143
|
self.headerType = headerType
|
|
129
144
|
self.titlePosition = titlePosition
|
|
@@ -134,27 +149,27 @@ public struct Header: View {
|
|
|
134
149
|
self.animatedHeader = animatedHeader
|
|
135
150
|
self.scrollState = scrollState
|
|
136
151
|
self.inputSearchProps = inputSearchProps
|
|
152
|
+
self.tintColor = tintColor
|
|
137
153
|
}
|
|
138
154
|
|
|
139
155
|
public var body: some View {
|
|
140
156
|
|
|
141
|
-
let
|
|
142
|
-
let
|
|
143
|
-
let
|
|
157
|
+
// let tintIconColor = Colors.black17
|
|
158
|
+
let backgroundButton = tintColor == Colors.black01 ? Color.white.opacity(0.2) : Colors.black01.opacity(0.6)
|
|
159
|
+
let borderColor: Color = tintColor == Colors.black01 ? Color.black.opacity(0.6) : Color.black.opacity(0.2)
|
|
144
160
|
|
|
145
161
|
if headerType != .none {
|
|
146
|
-
|
|
162
|
+
VStack(spacing: 0) {
|
|
147
163
|
ZStack {
|
|
148
164
|
HStack {
|
|
149
165
|
if let goBack = goBack {
|
|
150
166
|
SwiftUI.Button(action: goBack) {
|
|
151
167
|
Circle()
|
|
152
|
-
.stroke(
|
|
168
|
+
.stroke(borderColor, lineWidth: 0.2)
|
|
153
169
|
.background(Circle().fill(backgroundButton))
|
|
154
170
|
.frame(width: 28, height: 28)
|
|
155
171
|
.overlay(
|
|
156
|
-
|
|
157
|
-
.foregroundColor(.black)
|
|
172
|
+
Icon(source: "arrow-back", size: 20, color: tintColor)
|
|
158
173
|
)
|
|
159
174
|
}
|
|
160
175
|
|
|
@@ -167,14 +182,11 @@ public struct Header: View {
|
|
|
167
182
|
}
|
|
168
183
|
|
|
169
184
|
}
|
|
170
|
-
.
|
|
171
|
-
.padding(.horizontal)
|
|
172
|
-
|
|
173
|
-
|
|
185
|
+
.padding(.horizontal, 12)
|
|
174
186
|
|
|
175
187
|
HStack {
|
|
176
188
|
if titlePosition == .left, goBack != nil {
|
|
177
|
-
Spacer().frame(width:
|
|
189
|
+
Spacer().frame(width: 38)
|
|
178
190
|
}
|
|
179
191
|
|
|
180
192
|
if inputSearchProps != nil {
|
|
@@ -201,22 +213,22 @@ public struct Header: View {
|
|
|
201
213
|
}
|
|
202
214
|
} else {
|
|
203
215
|
Text(title)
|
|
204
|
-
.font(.
|
|
205
|
-
.foregroundColor(
|
|
216
|
+
.font(Font.system(size: 17).weight(.bold)) .lineSpacing(22)
|
|
217
|
+
.foregroundColor(Colors.black17)
|
|
206
218
|
.frame(maxWidth: titlePosition == .center ? UIScreen.main.bounds.width - 252 : nil)
|
|
207
219
|
.frame(maxWidth: titlePosition == .center ? .infinity : UIScreen.main.bounds.width - 172, alignment: titlePosition == .center ? .center : .leading)
|
|
208
220
|
.lineLimit(1)
|
|
221
|
+
|
|
209
222
|
}
|
|
210
223
|
Spacer()
|
|
211
224
|
}
|
|
212
|
-
.frame(height: 52)
|
|
213
225
|
.padding(.horizontal)
|
|
214
226
|
}
|
|
215
227
|
.background(Color.clear)
|
|
216
228
|
}
|
|
217
|
-
|
|
229
|
+
.frame(height: 52)
|
|
218
230
|
}
|
|
219
|
-
|
|
231
|
+
}
|
|
220
232
|
}
|
|
221
233
|
|
|
222
234
|
|
|
@@ -9,6 +9,8 @@ import SwiftUI
|
|
|
9
9
|
|
|
10
10
|
public struct Screen<Content: View>: View {
|
|
11
11
|
var backgroundColor: Color?
|
|
12
|
+
var headerTransparent: Bool = false
|
|
13
|
+
var tintColor: Color? = Colors.black17
|
|
12
14
|
var isBack: Bool
|
|
13
15
|
var headerType: HeaderType
|
|
14
16
|
var verticalAlignment: VerticalAlignment
|
|
@@ -29,6 +31,8 @@ public struct Screen<Content: View>: View {
|
|
|
29
31
|
|
|
30
32
|
public init(
|
|
31
33
|
backgroundColor: Color? = nil,
|
|
34
|
+
headerTransparent: Bool = false,
|
|
35
|
+
tintColor: Color = Colors.black17,
|
|
32
36
|
isBack: Bool = true,
|
|
33
37
|
headerType: HeaderType = .default,
|
|
34
38
|
verticalAlignment: VerticalAlignment = .top,
|
|
@@ -48,6 +52,8 @@ public struct Screen<Content: View>: View {
|
|
|
48
52
|
@ViewBuilder content: @escaping () -> Content
|
|
49
53
|
) {
|
|
50
54
|
self.backgroundColor = backgroundColor
|
|
55
|
+
self.headerTransparent = headerTransparent
|
|
56
|
+
self.tintColor = tintColor
|
|
51
57
|
self.isBack = isBack
|
|
52
58
|
self.headerType = headerType
|
|
53
59
|
self.verticalAlignment = verticalAlignment
|
|
@@ -71,23 +77,25 @@ public struct Screen<Content: View>: View {
|
|
|
71
77
|
|
|
72
78
|
public var body: some View {
|
|
73
79
|
GeometryReader { geometry in
|
|
74
|
-
let
|
|
75
|
-
let statusBarHeight = safeAreaInsets.top
|
|
80
|
+
let topInset = geometry.safeAreaInsets.top
|
|
76
81
|
let keyboardHeight: CGFloat = 0
|
|
77
82
|
let keyboardSize: CGFloat = useAvoidKeyboard ? max(keyboardHeight, 0) : 0
|
|
83
|
+
let height = geometry.size.height
|
|
84
|
+
let bottomInset = geometry.safeAreaInsets.bottom
|
|
85
|
+
let screenHeight = height + topInset + bottomInset
|
|
78
86
|
|
|
79
87
|
ZStack {
|
|
80
88
|
(backgroundColor ?? Color.white).edgesIgnoringSafeArea(.all)
|
|
81
89
|
|
|
82
90
|
VStack(spacing: 0) {
|
|
83
|
-
ZStack {
|
|
84
|
-
if animatedHeader == nil {
|
|
85
|
-
HeaderBackground(headerType: headerType, scrollState: scrollOffset)
|
|
86
|
-
} else {
|
|
87
|
-
Color.white.opacity(Double(min(scrollOffset / 114, 1)))
|
|
88
|
-
.overlay(HeaderBackground(headerType: headerType, scrollState: scrollOffset))
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
+
ZStack(alignment: .top) {
|
|
92
|
+
// if animatedHeader == nil {
|
|
93
|
+
// HeaderBackground(headerType: headerType, scrollState: scrollOffset)
|
|
94
|
+
// } else {
|
|
95
|
+
// Color.white.opacity(Double(min(scrollOffset / 114, 1)))
|
|
96
|
+
// .overlay(HeaderBackground(headerType: headerType, scrollState: scrollOffset))
|
|
97
|
+
//
|
|
98
|
+
// }
|
|
91
99
|
|
|
92
100
|
Header(
|
|
93
101
|
headerType: headerType,
|
|
@@ -98,15 +106,19 @@ public struct Screen<Content: View>: View {
|
|
|
98
106
|
opacity: min(scrollOffset / 114, 1),
|
|
99
107
|
animatedHeader: animatedHeader,
|
|
100
108
|
scrollState: scrollOffset,
|
|
101
|
-
inputSearchProps: inputSearchProps
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
109
|
+
inputSearchProps: inputSearchProps,
|
|
110
|
+
tintColor: tintColor
|
|
111
|
+
)
|
|
112
|
+
.background(HeaderBackground(headerType: headerType, scrollState: scrollOffset, isTransparent: headerTransparent).edgesIgnoringSafeArea(.top))
|
|
113
|
+
.offset(y: topInset)
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
.offset(y: -topInset)
|
|
105
117
|
|
|
106
118
|
|
|
107
119
|
VStack(alignment: horizontalAlignment, spacing: 0) {
|
|
108
120
|
if animatedHeader != nil {
|
|
109
|
-
Spacer().frame(height:
|
|
121
|
+
Spacer().frame(height: topInset + 52 + layoutOffset)
|
|
110
122
|
}
|
|
111
123
|
|
|
112
124
|
if scrollable {
|
|
@@ -20,7 +20,7 @@ public enum PopupButtonType {
|
|
|
20
20
|
public struct PopupDisplay: View {
|
|
21
21
|
// MARK: Lifecycle
|
|
22
22
|
|
|
23
|
-
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 = {}) {
|
|
23
|
+
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
24
|
self._isPresented = isPresented
|
|
25
25
|
self.title = title
|
|
26
26
|
self.description = description
|
|
@@ -32,7 +32,12 @@ public struct PopupDisplay: View {
|
|
|
32
32
|
self.onClose = onClose
|
|
33
33
|
self.closeButtonTitle = closeButtonTitle
|
|
34
34
|
self.actionButtonTitle = actionButtonTitle
|
|
35
|
+
self.errorCode = errorCode
|
|
35
36
|
}
|
|
37
|
+
|
|
38
|
+
var placeholder: AnyView?
|
|
39
|
+
|
|
40
|
+
@State var error: Bool = false
|
|
36
41
|
|
|
37
42
|
// MARK: Public
|
|
38
43
|
|
|
@@ -62,7 +67,7 @@ public struct PopupDisplay: View {
|
|
|
62
67
|
}
|
|
63
68
|
.scaledToFill()
|
|
64
69
|
.frame(maxWidth: .infinity)
|
|
65
|
-
.clipShape(RoundedCorner(radius:
|
|
70
|
+
.clipShape(RoundedCorner(radius: 15, corners: [.topLeft, .topRight]))
|
|
66
71
|
.aspectRatio(2, contentMode: .fit)
|
|
67
72
|
}
|
|
68
73
|
VStack(alignment: .leading) {
|
|
@@ -79,10 +84,18 @@ public struct PopupDisplay: View {
|
|
|
79
84
|
.font(.paragraph)
|
|
80
85
|
.opacity(0.6)
|
|
81
86
|
.multilineTextAlignment(.leading)
|
|
82
|
-
.padding(.bottom,
|
|
87
|
+
.padding(.bottom, 8)
|
|
88
|
+
|
|
89
|
+
if(!errorCode.isEmpty) {
|
|
90
|
+
Text(errorCode)
|
|
91
|
+
.foregroundColor(Colors.black12)
|
|
92
|
+
.font(.description_xs_regular)
|
|
93
|
+
.lineLimit(1)
|
|
94
|
+
}
|
|
83
95
|
}
|
|
84
96
|
.frame(maxWidth: .infinity, alignment: .leading)
|
|
85
97
|
.padding(.horizontal, 24)
|
|
98
|
+
.padding(.bottom, 24)
|
|
86
99
|
|
|
87
100
|
if buttonDirection == .row {
|
|
88
101
|
if buttonType == .text {
|
|
@@ -120,6 +133,7 @@ public struct PopupDisplay: View {
|
|
|
120
133
|
var onClose: () -> Void
|
|
121
134
|
var actionButtonTitle: String
|
|
122
135
|
var closeButtonTitle: String
|
|
136
|
+
var errorCode: String
|
|
123
137
|
|
|
124
138
|
var RowTextButtons: some View {
|
|
125
139
|
HStack {
|
|
@@ -1,52 +1,71 @@
|
|
|
1
|
-
import SDWebImageSwiftUI
|
|
2
1
|
import SwiftUI
|
|
2
|
+
import SDWebImageSwiftUI
|
|
3
3
|
|
|
4
4
|
public struct PopupPromotion: View {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
self._isPresented = isPresented
|
|
9
|
-
self.onPressAction = onPressAction
|
|
10
|
-
self.buttonTitle = buttonTitle
|
|
11
|
-
self.onClose = onClose
|
|
12
|
-
self.url = url
|
|
13
|
-
}
|
|
5
|
+
var imageUrl: String
|
|
6
|
+
var onIconClose: (() -> Void)?
|
|
7
|
+
var onRequestClose: (((() -> Void)?) -> Void)? = nil
|
|
14
8
|
|
|
15
|
-
|
|
9
|
+
|
|
10
|
+
public init(
|
|
11
|
+
imageUrl: String,
|
|
12
|
+
onIconClose: (() -> Void)? = nil,
|
|
13
|
+
onRequestClose: (((() -> Void)?) -> Void)? = nil
|
|
16
14
|
|
|
15
|
+
) {
|
|
16
|
+
self.imageUrl = imageUrl
|
|
17
|
+
self.onIconClose = onIconClose
|
|
18
|
+
self.onRequestClose = onRequestClose
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
public var body: some View {
|
|
18
|
-
VStack(spacing:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}.clipped()
|
|
22
|
+
VStack(spacing: 8) {
|
|
23
|
+
WebImage(url: URL(string: imageUrl)!)
|
|
24
|
+
.resizable()
|
|
25
|
+
.placeholder {
|
|
26
|
+
Color.gray
|
|
27
|
+
.aspectRatio(0.72, contentMode: .fit)
|
|
28
|
+
.frame(maxWidth: UIScreen.main.bounds.width - Spacing.XL * 2)
|
|
29
|
+
.clipped()
|
|
30
|
+
}
|
|
31
|
+
.aspectRatio(0.72, contentMode: .fit)
|
|
32
|
+
.frame(maxWidth: UIScreen.main.bounds.width - Spacing.XL * 2)
|
|
33
|
+
.clipped()
|
|
34
|
+
|
|
35
|
+
buildCloseIcon()
|
|
33
36
|
}
|
|
34
|
-
.
|
|
35
|
-
.shadow(color: .black.opacity(0.08), radius: 2, x: 0, y: 0)
|
|
36
|
-
.shadow(color: .black.opacity(0.16), radius: 24, x: 0, y: 0)
|
|
37
|
-
.padding(.horizontal, 40)
|
|
37
|
+
.accessibility(identifier: "popup_promotion")
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
@ViewBuilder
|
|
41
|
+
private func buildCloseIcon() -> some View {
|
|
42
|
+
HStack {
|
|
43
|
+
Spacer()
|
|
44
|
+
SwiftUI.Button(action: {
|
|
45
|
+
onAction(callback: onIconClose)
|
|
46
|
+
}) {
|
|
47
|
+
ZStack {
|
|
48
|
+
Circle()
|
|
49
|
+
.strokeBorder(Colors.black01, lineWidth: 2)
|
|
50
|
+
.background(Circle().fill(Colors.black17))
|
|
51
|
+
.frame(width: 20, height: 20)
|
|
52
|
+
|
|
53
|
+
Icon(source: "navigation_close", size: 14, color: Colors.black01)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
.padding(8)
|
|
57
|
+
Spacer()
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private func onAction(callback: (() -> Void)?) {
|
|
62
|
+
if let onRequestClose = onRequestClose {
|
|
63
|
+
onRequestClose(callback)
|
|
64
|
+
} else {
|
|
65
|
+
callback?()
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
39
69
|
|
|
40
|
-
// MARK: Internal
|
|
41
70
|
|
|
42
|
-
@Binding var isPresented: Bool
|
|
43
|
-
var onPressAction: () -> Void
|
|
44
|
-
var onClose: () -> Void
|
|
45
|
-
var buttonTitle: String
|
|
46
|
-
var url: String
|
|
47
71
|
|
|
48
|
-
func onPressClose(){
|
|
49
|
-
isPresented = false
|
|
50
|
-
onClose()
|
|
51
|
-
}
|
|
52
|
-
}
|
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
|
-
#
|
|
8
|
-
sdk.dir=/Users/
|
|
7
|
+
#Wed Aug 21 14:20:12 ICT 2024
|
|
8
|
+
sdk.dir=/Users/huynhdung/Library/Android/sdk
|