Skip to content
Snippets Groups Projects
Verified Commit bae8c286 authored by Torsten Grote's avatar Torsten Grote
Browse files

Don't make AuthorView clickable in blogs

because we only have the WRAPPED_POST which is in the Blog Group of the re-poster. Therefore, it isn't easy to get the Blog GroupId of the re-posted author. It may even be that we don't have a group, because the re-posted author isn't a contact or their blog wasn't shared with us.
parent cd42c925
No related branches found
No related tags found
1 merge request!357Blog navigation + Let unread FABs info depend on (unread) posts
Pipeline #15198 passed
...@@ -174,16 +174,11 @@ private fun BlogPostViewHeader( ...@@ -174,16 +174,11 @@ private fun BlogPostViewHeader(
) )
if (item is BlogCommentItem) { if (item is BlogCommentItem) {
val postHeader = item.postHeader val postHeader = item.postHeader
// This isn't clickable, because item.type is WRAPPED_POST, so not easy to get the GroupId of the blog
AuthorView( AuthorView(
author = postHeader.author, author = postHeader.author,
authorInfo = postHeader.authorInfo, authorInfo = postHeader.authorInfo,
timestamp = postHeader.timestamp, timestamp = postHeader.timestamp,
onAuthorClicked = if (onAuthorClicked == null) null else {
{ onAuthorClicked(item.postHeader.groupId) }
},
authorClickTooltip = if (onAuthorClicked == null) null else {
i18nF("blog.open.from.author", item.postHeader.author.name)
},
) )
} }
} }
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
package org.briarproject.briar.desktop.ui package org.briarproject.briar.desktop.ui
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement.spacedBy import androidx.compose.foundation.layout.Arrangement.spacedBy
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.material.MaterialTheme import androidx.compose.material.MaterialTheme
...@@ -38,9 +36,7 @@ import org.briarproject.briar.api.identity.AuthorInfo.Status.OURSELVES ...@@ -38,9 +36,7 @@ import org.briarproject.briar.api.identity.AuthorInfo.Status.OURSELVES
import org.briarproject.briar.desktop.contact.ProfileCircle import org.briarproject.briar.desktop.contact.ProfileCircle
import org.briarproject.briar.desktop.utils.TimeUtils import org.briarproject.briar.desktop.utils.TimeUtils
import org.briarproject.briar.desktop.utils.UiUtils.getContactDisplayName import org.briarproject.briar.desktop.utils.UiUtils.getContactDisplayName
import org.briarproject.briar.desktop.utils.UiUtils.modifyIf
@OptIn(ExperimentalFoundationApi::class)
@Composable @Composable
fun AuthorView( fun AuthorView(
author: Author, author: Author,
...@@ -48,33 +44,26 @@ fun AuthorView( ...@@ -48,33 +44,26 @@ fun AuthorView(
timestamp: Long, timestamp: Long,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
avatarSize: Dp = 27.dp, avatarSize: Dp = 27.dp,
onAuthorClicked: (() -> Unit)? = null,
authorClickTooltip: String? = null,
) { ) {
Row( Row(
modifier = modifier, modifier = modifier,
horizontalArrangement = spacedBy(8.dp), horizontalArrangement = spacedBy(8.dp),
verticalAlignment = CenterVertically, verticalAlignment = CenterVertically,
) { ) {
Tooltip( Row(
text = authorClickTooltip ?: "",
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
horizontalArrangement = spacedBy(8.dp),
verticalAlignment = CenterVertically,
) { ) {
Row( ProfileCircle(avatarSize, author.id, authorInfo)
modifier = Modifier.modifyIf(onAuthorClicked != null, Modifier.clickable { onAuthorClicked?.invoke() }), Text(
horizontalArrangement = spacedBy(8.dp), modifier = Modifier.weight(1f, fill = false),
verticalAlignment = CenterVertically, text = getContactDisplayName(author.name, authorInfo.alias),
) { fontWeight = if (authorInfo.status == OURSELVES) Bold else null,
ProfileCircle(avatarSize, author.id, authorInfo) maxLines = 1,
Text( overflow = Ellipsis,
modifier = Modifier.weight(1f, fill = false), )
text = getContactDisplayName(author.name, authorInfo.alias), TrustIndicatorShort(authorInfo.status)
fontWeight = if (authorInfo.status == OURSELVES) Bold else null,
maxLines = 1,
overflow = Ellipsis,
)
TrustIndicatorShort(authorInfo.status)
}
} }
Text( Text(
text = TimeUtils.getFormattedTimestamp(timestamp), text = TimeUtils.getFormattedTimestamp(timestamp),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment