@momo-kits/native-kits 0.89.33-rc.2 → 0.89.33-rc.4

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.
@@ -50,7 +50,6 @@ import vn.momo.kits.const.AppTheme
50
50
  import vn.momo.kits.const.Colors
51
51
  import vn.momo.kits.const.Spacing
52
52
  import vn.momo.kits.const.Typography
53
- import vn.momo.kits.modifier.shadow
54
53
  import vn.momo.kits.platform.getStatusBarHeight
55
54
  import vn.momo.kits.utils.bottomBorder
56
55
 
@@ -67,7 +66,6 @@ data class AnimatedHeader(
67
66
  @Composable
68
67
  fun HeaderBackground(
69
68
  headerType: HeaderType = HeaderType.DEFAULT,
70
- useShadow: Boolean? = true,
71
69
  scrollState: Int
72
70
  ) {
73
71
  val statusBarHeight = AppStatusBar.current ?: getStatusBarHeight()
@@ -140,21 +138,12 @@ fun HeaderBackground(
140
138
  }
141
139
  }
142
140
  }
141
+
143
142
  else -> {
144
143
  Box(modifier = Modifier.fillMaxWidth())
145
144
  }
146
145
  }
147
- Box(
148
- modifier = Modifier.fillMaxWidth().height(statusBarHeight + 52.dp)
149
- .alpha(1 - opacityAni)
150
- .background(Colors.black_01)
151
- .then(
152
- if (useShadow == true) Modifier.shadow() else Modifier.bottomBorder(
153
- 1.dp,
154
- Colors.black_04
155
- )
156
- )
157
- )
146
+
158
147
  }
159
148
 
160
149
  @Composable
@@ -163,11 +152,9 @@ fun Header(
163
152
  titlePosition: TitlePosition,
164
153
  title: String,
165
154
  headerRight: @Composable (() -> Unit)? = null,
166
- isBack: Boolean = true,
167
- goBack: (() -> Unit) = { },
155
+ goBack: (() -> Unit)? = null,
168
156
  opacity: Float? = null,
169
157
  animatedHeader: AnimatedHeader? = null,
170
- useSearchInput: Boolean? = false,
171
158
  scrollState: Int = 0,
172
159
  inputSearchProps: InputSearchProps?
173
160
  ) {
@@ -207,7 +194,7 @@ fun Header(
207
194
  horizontalArrangement = Arrangement.SpaceBetween
208
195
  ) {
209
196
  Box {
210
- if (isBack) {
197
+ if (goBack != null) {
211
198
  Box(
212
199
  modifier = Modifier
213
200
  .size(28.dp)
@@ -239,12 +226,11 @@ fun Header(
239
226
  }
240
227
  }
241
228
  }
242
- if (useSearchInput == false) {
243
- Box(Modifier.graphicsLayer {
244
- alpha = if (animatedHeader !== null) opacity ?: 1f else 1f
245
- }) {
246
- headerRight?.invoke()
247
- }
229
+
230
+ Box(Modifier.graphicsLayer {
231
+ alpha = if (animatedHeader !== null) opacity ?: 1f else 1f
232
+ }) {
233
+ headerRight?.invoke()
248
234
  }
249
235
  }
250
236
 
@@ -255,13 +241,12 @@ fun Header(
255
241
  .padding(horizontal = Spacing.M),
256
242
  verticalAlignment = Alignment.CenterVertically,
257
243
  ) {
258
- if (isBack) {
244
+ if (goBack != null && titlePosition == TitlePosition.LEFT) {
259
245
  Spacer(Modifier.width(40.dp))
260
246
  }
261
- if (useSearchInput == true && inputSearchProps != null) {
247
+ if (inputSearchProps != null) {
262
248
  InputSearch(inputSearchProps = inputSearchProps.copy(backgroundColor = backgroundSearch))
263
- }
264
- else{
249
+ } else{
265
250
  Box(
266
251
  Modifier.weight(1f).graphicsLayer {
267
252
  alpha = if (animatedHeader !== null) opacity ?: 1f else 1f
@@ -56,7 +56,7 @@ fun Screen(
56
56
  horizontalAlignment: Alignment.Horizontal = Alignment.Start,
57
57
  title: String = "Stack",
58
58
  titlePosition: TitlePosition = TitlePosition.LEFT,
59
- goBack: (() -> Unit) = { },
59
+ goBack: (() -> Unit)? = null,
60
60
  scrollable: Boolean = true,
61
61
  scrollState: ScrollState = rememberScrollState(),
62
62
  onContentLayout: ((LayoutCoordinates) -> Unit)? = null,
@@ -66,8 +66,6 @@ fun Screen(
66
66
  fabProps: FabProps? = null,
67
67
  animatedHeader: AnimatedHeader? = null,
68
68
  layoutOffset: Dp = 56.dp,
69
- useShadow: Boolean? = true,
70
- useSearchInput: Boolean? = false,
71
69
  inputSearchProps: InputSearchProps? = null,
72
70
  content: @Composable () -> Unit,
73
71
  ) {
@@ -106,7 +104,6 @@ fun Screen(
106
104
  ) {
107
105
  HeaderBackground(
108
106
  headerType = headerType,
109
- useShadow = useShadow,
110
107
  scrollState = scrollState.value
111
108
  )
112
109
  }
@@ -118,10 +115,8 @@ fun Screen(
118
115
  titlePosition = titlePosition,
119
116
  headerRight = headerRight,
120
117
  goBack = goBack,
121
- isBack = isBack,
122
118
  opacity = opacity,
123
119
  animatedHeader = animatedHeader,
124
- useSearchInput = useSearchInput,
125
120
  inputSearchProps = inputSearchProps,
126
121
  scrollState = scrollState.value
127
122
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.89.33-rc.2",
3
+ "version": "0.89.33-rc.4",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},