@momo-kits/native-kits 0.117.1-beta.13 → 0.117.1-beta.15
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 +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +30 -19
- package/ios/Popup/PopupDisplay.swift +3 -5
- package/package.json +1 -1
|
@@ -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(
|
|
@@ -125,7 +125,7 @@ fun PopupNotify(
|
|
|
125
125
|
content(Modifier.padding(top = Spacing.S))
|
|
126
126
|
if (error.isNotEmpty()) {
|
|
127
127
|
Text(
|
|
128
|
-
text = error,
|
|
128
|
+
text = "Mã lỗi: " + error,
|
|
129
129
|
style = Typography.descriptionXsRegular,
|
|
130
130
|
color = AppTheme.current.colors.text.hint,
|
|
131
131
|
maxLines = 1,
|
|
@@ -17,6 +17,7 @@ import androidx.compose.ui.graphics.Color
|
|
|
17
17
|
import androidx.compose.ui.unit.dp
|
|
18
18
|
import vn.momo.kits.const.Colors
|
|
19
19
|
import vn.momo.kits.const.Spacing
|
|
20
|
+
import vn.momo.kits.modifier.setAutomationId
|
|
20
21
|
import vn.momo.kits.utils.ifTrue
|
|
21
22
|
|
|
22
23
|
@Composable
|
|
@@ -24,6 +25,8 @@ fun Switch(
|
|
|
24
25
|
value: Boolean = false,
|
|
25
26
|
onChange: (Boolean) -> Unit = {},
|
|
26
27
|
disabled: Boolean = false,
|
|
28
|
+
title: String? = "",
|
|
29
|
+
accessibilityId: String? = ""
|
|
27
30
|
) {
|
|
28
31
|
val circleBackgroundColor = value.ifTrue(Colors.black_01, Colors.black_03)
|
|
29
32
|
var backgroundColor = value.ifTrue(Colors.green_03, Colors.black_07)
|
|
@@ -32,27 +35,35 @@ fun Switch(
|
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
Box(
|
|
35
|
-
modifier = Modifier.
|
|
36
|
-
Modifier.width(38.dp).height(20.dp).border(
|
|
37
|
-
0.dp, Color.Unspecified,
|
|
38
|
-
RoundedCornerShape(20.dp)
|
|
39
|
-
).background(backgroundColor, RoundedCornerShape(20.dp)).clip(RoundedCornerShape(20.dp))
|
|
40
|
-
.clickable(
|
|
41
|
-
enabled = !disabled,
|
|
42
|
-
onClick = { onChange(!value) }
|
|
43
|
-
)
|
|
44
|
-
.padding(horizontal = Spacing.XS)
|
|
45
|
-
),
|
|
46
|
-
contentAlignment = value.ifTrue(Alignment.CenterEnd, Alignment.CenterStart)
|
|
38
|
+
modifier = Modifier.setAutomationId( accessibilityId ?: "toggle_${title ?: "unknown"}_${value}")
|
|
47
39
|
) {
|
|
48
40
|
Box(
|
|
49
|
-
modifier = Modifier.
|
|
50
|
-
.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
modifier = Modifier.then(
|
|
42
|
+
Modifier.width(38.dp).height(20.dp).border(
|
|
43
|
+
0.dp, Color.Unspecified,
|
|
44
|
+
RoundedCornerShape(20.dp)
|
|
45
|
+
).background(backgroundColor, RoundedCornerShape(20.dp))
|
|
46
|
+
.clip(RoundedCornerShape(20.dp))
|
|
47
|
+
.clickable(
|
|
48
|
+
enabled = !disabled,
|
|
49
|
+
onClick = { onChange(!value) }
|
|
50
|
+
)
|
|
51
|
+
.padding(horizontal = Spacing.XS)
|
|
52
|
+
),
|
|
53
|
+
contentAlignment = value.ifTrue(Alignment.CenterEnd, Alignment.CenterStart)
|
|
54
|
+
) {
|
|
55
|
+
Box(
|
|
56
|
+
modifier = Modifier.size(14.dp)
|
|
57
|
+
.border(0.dp, Color.Unspecified, RoundedCornerShape(percent = 100))
|
|
58
|
+
.background(circleBackgroundColor, RoundedCornerShape(percent = 100)),
|
|
59
|
+
contentAlignment = Alignment.Center
|
|
60
|
+
)
|
|
61
|
+
{
|
|
62
|
+
Box(
|
|
63
|
+
Modifier.size(6.dp)
|
|
64
|
+
.background(backgroundColor, RoundedCornerShape(percent = 100))
|
|
65
|
+
)
|
|
66
|
+
}
|
|
56
67
|
}
|
|
57
68
|
}
|
|
58
69
|
}
|
|
@@ -88,8 +88,7 @@ public struct PopupDisplay: View {
|
|
|
88
88
|
ScrollView(showsIndicators: false) {
|
|
89
89
|
Text(description)
|
|
90
90
|
.font(.paragraph)
|
|
91
|
-
.foregroundColor(.
|
|
92
|
-
.opacity(0.6)
|
|
91
|
+
.foregroundColor(Colors.black17)
|
|
93
92
|
.multilineTextAlignment(.leading)
|
|
94
93
|
.background(GeometryReader { geo in
|
|
95
94
|
Color.clear
|
|
@@ -102,8 +101,7 @@ public struct PopupDisplay: View {
|
|
|
102
101
|
} else {
|
|
103
102
|
Text(description)
|
|
104
103
|
.font(.paragraph)
|
|
105
|
-
.foregroundColor(.
|
|
106
|
-
.opacity(0.6)
|
|
104
|
+
.foregroundColor(Colors.black17)
|
|
107
105
|
.multilineTextAlignment(.leading)
|
|
108
106
|
.background(GeometryReader { geo in
|
|
109
107
|
Color.clear
|
|
@@ -116,7 +114,7 @@ public struct PopupDisplay: View {
|
|
|
116
114
|
}.padding(.bottom, 8)
|
|
117
115
|
|
|
118
116
|
if(!errorCode.isEmpty) {
|
|
119
|
-
Text(errorCode)
|
|
117
|
+
Text("Mã lỗi: " + errorCode)
|
|
120
118
|
.foregroundColor(Colors.black12)
|
|
121
119
|
.font(.description_xs_regular)
|
|
122
120
|
.lineLimit(1)
|