mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 22:17:03 +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(),
|
||||
verticalArrangement = Arrangement.spacedBy(4.dp),
|
||||
) {
|
||||
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}",
|
||||
PostDetails(
|
||||
post = post,
|
||||
)
|
||||
Row(
|
||||
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
|
||||
fun PostTitle(
|
||||
title: String,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue