mirror of
https://github.com/LiveFastEatTrashRaccoon/RaccoonForLemmy.git
synced 2025-02-03 13:57:32 +01:00
fix: highlighted comment background
This commit is contained in:
parent
e56f531468
commit
bb24ac38d4
@ -16,7 +16,6 @@ import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.layout.onGloballyPositioned
|
||||
import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.unit.Density
|
||||
@ -34,7 +33,6 @@ import com.github.diegoberaldin.raccoonforlemmy.domain.lemmy.repository.CommentR
|
||||
@Composable
|
||||
fun CommentCard(
|
||||
comment: CommentModel,
|
||||
background: Color = MaterialTheme.colorScheme.background,
|
||||
modifier: Modifier = Modifier,
|
||||
separateUpAndDownVotes: Boolean = false,
|
||||
hideAuthor: Boolean = false,
|
||||
@ -59,7 +57,7 @@ fun CommentCard(
|
||||
),
|
||||
) {
|
||||
Column(
|
||||
modifier = modifier.background(background)
|
||||
modifier = modifier
|
||||
) {
|
||||
var commentHeight by remember { mutableStateOf(0f) }
|
||||
val barWidth = 2.dp
|
||||
|
@ -480,22 +480,28 @@ class PostDetailScreen(
|
||||
},
|
||||
content = {
|
||||
CommentCard(
|
||||
modifier = Modifier.onClick {
|
||||
model.reduce(
|
||||
PostDetailMviModel.Intent.ToggleExpandComment(
|
||||
commentId,
|
||||
modifier = Modifier
|
||||
.background(MaterialTheme.colorScheme.background)
|
||||
.let {
|
||||
if (comment.id == highlightCommentId) {
|
||||
it.background(
|
||||
MaterialTheme.colorScheme.surfaceColorAtElevation(
|
||||
5.dp
|
||||
).copy(
|
||||
alpha = 0.75f
|
||||
)
|
||||
)
|
||||
} else {
|
||||
it
|
||||
}
|
||||
}
|
||||
.onClick {
|
||||
model.reduce(
|
||||
PostDetailMviModel.Intent.ToggleExpandComment(
|
||||
commentId,
|
||||
)
|
||||
)
|
||||
)
|
||||
},
|
||||
background = if (comment.id == highlightCommentId) {
|
||||
MaterialTheme.colorScheme.surfaceColorAtElevation(
|
||||
5.dp
|
||||
).copy(
|
||||
alpha = 0.75f
|
||||
)
|
||||
} else {
|
||||
MaterialTheme.colorScheme.background
|
||||
},
|
||||
},
|
||||
comment = comment,
|
||||
separateUpAndDownVotes = uiState.separateUpAndDownVotes,
|
||||
autoLoadImages = uiState.autoLoadImages,
|
||||
|
Loading…
x
Reference in New Issue
Block a user