mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-17 22:37:03 +05:30
ui: Add Modifier params to [Hottest|Saved]Posts composables
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
ca77d3cf2a
commit
43fb668c7d
2 changed files with 4 additions and 2 deletions
|
@ -14,6 +14,7 @@ import dev.msfjarvis.lobsters.urllauncher.UrlLauncherAmbient
|
|||
@Composable
|
||||
fun HottestPosts(
|
||||
viewModel: LobstersViewModel,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
val posts by viewModel.posts.collectAsState()
|
||||
val listState = rememberLazyListState()
|
||||
|
@ -25,7 +26,7 @@ fun HottestPosts(
|
|||
LazyColumnForIndexed(
|
||||
items = posts,
|
||||
state = listState,
|
||||
modifier = Modifier.padding(horizontal = 8.dp)
|
||||
modifier = Modifier.padding(horizontal = 8.dp).then(modifier)
|
||||
) { index, item ->
|
||||
if (posts.lastIndex == index) {
|
||||
viewModel.getMorePosts()
|
||||
|
|
|
@ -14,6 +14,7 @@ import dev.msfjarvis.lobsters.urllauncher.UrlLauncherAmbient
|
|||
@Composable
|
||||
fun SavedPosts(
|
||||
viewModel: LobstersViewModel,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
val posts by viewModel.savedPosts.collectAsState()
|
||||
val listState = rememberLazyListState()
|
||||
|
@ -25,7 +26,7 @@ fun SavedPosts(
|
|||
LazyColumnFor(
|
||||
items = posts,
|
||||
state = listState,
|
||||
modifier = Modifier.padding(horizontal = 8.dp)
|
||||
modifier = Modifier.padding(horizontal = 8.dp).then(modifier)
|
||||
) { item ->
|
||||
LobstersItem(
|
||||
post = item,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue