mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-08-08 06:46:11 +00:00
Refine private chat header actions
This commit is contained in:
parent
9f81a1e40d
commit
70185ae86f
@ -475,6 +475,19 @@ fun ConversationHeaderAction(
|
||||
content = content
|
||||
)
|
||||
|
||||
/** A read-only status slot matching the footprint of [ConversationHeaderAction]. */
|
||||
@Composable
|
||||
fun ConversationHeaderStatus(
|
||||
modifier: Modifier = Modifier,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
Box(
|
||||
modifier = modifier.size(HeaderTapTarget),
|
||||
contentAlignment = Alignment.Center,
|
||||
content = { content() }
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun NicknameEditor(
|
||||
value: String,
|
||||
|
||||
@ -2054,8 +2054,21 @@ fun PrivateChatSheet(
|
||||
)
|
||||
}
|
||||
|
||||
// Encryption state, and the verification badge that qualifies it. Both are
|
||||
// read-only for Nostr peers, which have no Noise session at all.
|
||||
if (isVerified) {
|
||||
ConversationHeaderStatus {
|
||||
Icon(
|
||||
imageVector = Icons.Filled.Verified,
|
||||
contentDescription = stringResource(
|
||||
R.string.fingerprint_verified_label
|
||||
),
|
||||
modifier = Modifier.size(HeaderIconSize),
|
||||
tint = colorScheme.primary
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Keep the lock nearest the close action: from right to left the security
|
||||
// cluster reads close, encryption, verification, then favorite.
|
||||
if (!isNostrPeer && !isNostrReachableFavorite) {
|
||||
ConversationHeaderAction(
|
||||
onClick = { viewModel.showSecurityVerificationSheet() },
|
||||
@ -2070,22 +2083,6 @@ fun PrivateChatSheet(
|
||||
}
|
||||
}
|
||||
|
||||
if (isVerified) {
|
||||
Box(
|
||||
modifier = Modifier.size(HeaderIconSize),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Filled.Verified,
|
||||
contentDescription = stringResource(
|
||||
R.string.fingerprint_verified_label
|
||||
),
|
||||
modifier = Modifier.size(HeaderIconSize),
|
||||
tint = colorScheme.primary
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
val dismiss = LocalSheetDismiss.current
|
||||
CloseButton(onClick = { dismiss?.invoke() ?: onDismiss() })
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user