ui: Add Modifier params to [Hottest|Saved]Posts composables

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-10-29 16:27:12 +05:30
parent ca77d3cf2a
commit 43fb668c7d
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80
2 changed files with 4 additions and 2 deletions

View file

@ -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()

View file

@ -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,