mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 21:07:04 +05:30
common: extract PostDetails composable for comments
This commit is contained in:
parent
5b2b7de7d0
commit
84fd9a2c61
1 changed files with 19 additions and 10 deletions
|
@ -55,16 +55,8 @@ fun LobstersCard(
|
||||||
modifier = Modifier.padding(horizontal = 16.dp, vertical = 4.dp).fillMaxWidth(),
|
modifier = Modifier.padding(horizontal = 16.dp, vertical = 4.dp).fillMaxWidth(),
|
||||||
verticalArrangement = Arrangement.spacedBy(4.dp),
|
verticalArrangement = Arrangement.spacedBy(4.dp),
|
||||||
) {
|
) {
|
||||||
PostTitle(
|
PostDetails(
|
||||||
title = post.title,
|
post = post,
|
||||||
)
|
|
||||||
TagRow(
|
|
||||||
tags = post.tags,
|
|
||||||
)
|
|
||||||
SubmitterName(
|
|
||||||
text = "Submitted by ${post.submitterName}",
|
|
||||||
avatarUrl = "https://lobste.rs/${post.submitterAvatarUrl}",
|
|
||||||
contentDescription = "Submitted by ${post.submitterName}",
|
|
||||||
)
|
)
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth().padding(bottom = 8.dp),
|
modifier = Modifier.fillMaxWidth().padding(bottom = 8.dp),
|
||||||
|
@ -86,6 +78,23 @@ fun LobstersCard(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun PostDetails(
|
||||||
|
post: SavedPost,
|
||||||
|
) {
|
||||||
|
PostTitle(
|
||||||
|
title = post.title,
|
||||||
|
)
|
||||||
|
TagRow(
|
||||||
|
tags = post.tags,
|
||||||
|
)
|
||||||
|
SubmitterName(
|
||||||
|
text = "Submitted by ${post.submitterName}",
|
||||||
|
avatarUrl = "https://lobste.rs/${post.submitterAvatarUrl}",
|
||||||
|
contentDescription = "Submitted by ${post.submitterName}",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun PostTitle(
|
fun PostTitle(
|
||||||
title: String,
|
title: String,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue