mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-15 02:57:04 +05:30
fix: wrap DatabasePosts
content in a Box
This commit is contained in:
parent
9d85563cf2
commit
b2490cd014
1 changed files with 20 additions and 14 deletions
|
@ -7,6 +7,8 @@
|
||||||
package dev.msfjarvis.claw.android.ui.lists
|
package dev.msfjarvis.claw.android.ui.lists
|
||||||
|
|
||||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.lazy.LazyListState
|
import androidx.compose.foundation.lazy.LazyListState
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
|
@ -27,21 +29,25 @@ fun DatabasePosts(
|
||||||
postActions: PostActions,
|
postActions: PostActions,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
|
Box(modifier = modifier.fillMaxSize()) {
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
state = listState,
|
state = listState,
|
||||||
modifier = modifier,
|
|
||||||
) {
|
) {
|
||||||
items.forEach { (month, posts) ->
|
items.forEach { (month, posts) ->
|
||||||
stickyHeader { MonthHeader(month = month) }
|
stickyHeader(contentType = "month-header") { MonthHeader(month = month) }
|
||||||
items(posts, { it.shortId }) { item ->
|
items(
|
||||||
|
items = posts,
|
||||||
|
key = { it.shortId },
|
||||||
|
contentType = { "LobstersItem" },
|
||||||
|
) { item ->
|
||||||
ListItem(
|
ListItem(
|
||||||
item = item,
|
item = item,
|
||||||
isSaved = { true },
|
isSaved = { true },
|
||||||
postActions = postActions,
|
postActions = postActions,
|
||||||
)
|
)
|
||||||
|
|
||||||
Divider()
|
Divider()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue