fix: comment bar visibility for top-level comments; closes #277 (#278)

This commit is contained in:
Diego Beraldin 2023-12-10 22:54:05 +01:00 committed by GitHub
parent ae08e6c7a4
commit 78b850e0fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 9 deletions

View File

@ -26,6 +26,8 @@ import com.github.diegoberaldin.raccoonforlemmy.core.utils.toLocalDp
import com.github.diegoberaldin.raccoonforlemmy.domain.lemmy.data.CommentModel
import com.github.diegoberaldin.raccoonforlemmy.domain.lemmy.data.UserModel
private const val INDENT_AMOUNT = 3
@Composable
fun CollapsedCommentCard(
comment: CommentModel,
@ -58,7 +60,7 @@ fun CollapsedCommentCard(
) {
Box(
modifier = Modifier.padding(
start = (10 * comment.depth).dp
start = (INDENT_AMOUNT * comment.depth).dp
),
) {
Column(
@ -102,13 +104,15 @@ fun CollapsedCommentCard(
onOptionSelected = onOptionSelected,
)
}
Box(
modifier = Modifier
.padding(top = Spacing.xxs)
.width(barWidth)
.height(commentHeight.toLocalDp())
.background(color = barColor)
)
if (comment.depth > 0) {
Box(
modifier = Modifier
.padding(top = Spacing.xxs)
.width(barWidth)
.height(commentHeight.toLocalDp())
.background(color = barColor)
)
}
}
}
}

View File

@ -122,7 +122,7 @@ fun CommentCard(
onOptionSelected = onOptionSelected,
)
}
if (!hideIndent) {
if (!hideIndent && comment.depth > 0) {
Box(
modifier = Modifier
.padding(top = Spacing.xxs)