mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-22 21:51:57 +02:00
Showing pubkeys prominently in the Profile Page.
This commit is contained in:
@@ -9,6 +9,7 @@ import androidx.compose.foundation.text.ClickableText
|
|||||||
import androidx.compose.material.*
|
import androidx.compose.material.*
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.Bolt
|
import androidx.compose.material.icons.filled.Bolt
|
||||||
|
import androidx.compose.material.icons.filled.ContentCopy
|
||||||
import androidx.compose.material.icons.filled.EditNote
|
import androidx.compose.material.icons.filled.EditNote
|
||||||
import androidx.compose.material.icons.filled.Link
|
import androidx.compose.material.icons.filled.Link
|
||||||
import androidx.compose.material.icons.filled.MoreVert
|
import androidx.compose.material.icons.filled.MoreVert
|
||||||
@@ -349,20 +350,21 @@ private fun ProfileHeader(
|
|||||||
) {
|
) {
|
||||||
MessageButton(baseUser, navController)
|
MessageButton(baseUser, navController)
|
||||||
|
|
||||||
NPubCopyButton(baseUser)
|
// No need for this button anymore
|
||||||
|
// NPubCopyButton(baseUser)
|
||||||
|
|
||||||
if (accountUser == baseUser) {
|
if (accountUser == baseUser) {
|
||||||
EditButton(account)
|
EditButton(account)
|
||||||
} else {
|
}
|
||||||
if (account.isHidden(baseUser)) {
|
|
||||||
ShowUserButton {
|
if (account.isHidden(baseUser)) {
|
||||||
account.showUser(baseUser.pubkeyHex)
|
ShowUserButton {
|
||||||
}
|
account.showUser(baseUser.pubkeyHex)
|
||||||
} else if (accountUser.isFollowing(baseUser)) {
|
|
||||||
UnfollowButton { coroutineScope.launch(Dispatchers.IO) { account.unfollow(baseUser) } }
|
|
||||||
} else {
|
|
||||||
FollowButton { coroutineScope.launch(Dispatchers.IO) { account.follow(baseUser) } }
|
|
||||||
}
|
}
|
||||||
|
} else if (accountUser.isFollowing(baseUser)) {
|
||||||
|
UnfollowButton { coroutineScope.launch(Dispatchers.IO) { account.unfollow(baseUser) } }
|
||||||
|
} else {
|
||||||
|
FollowButton { coroutineScope.launch(Dispatchers.IO) { account.follow(baseUser) } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -388,6 +390,7 @@ private fun DrawAdditionalInfo(baseUser: User, account: Account, navController:
|
|||||||
val userBadge = userBadgeState?.user ?: return
|
val userBadge = userBadgeState?.user ?: return
|
||||||
|
|
||||||
val uri = LocalUriHandler.current
|
val uri = LocalUriHandler.current
|
||||||
|
val clipboardManager = LocalClipboardManager.current
|
||||||
|
|
||||||
Row(verticalAlignment = Alignment.Bottom) {
|
Row(verticalAlignment = Alignment.Bottom) {
|
||||||
user.bestDisplayName()?.let {
|
user.bestDisplayName()?.let {
|
||||||
@@ -408,6 +411,26 @@ private fun DrawAdditionalInfo(baseUser: User, account: Account, navController:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
|
Text(
|
||||||
|
text = user.pubkeyDisplayHex(),
|
||||||
|
modifier = Modifier.padding(top = 1.dp, bottom = 1.dp),
|
||||||
|
color = MaterialTheme.colors.onSurface.copy(alpha = 0.32f)
|
||||||
|
)
|
||||||
|
|
||||||
|
IconButton(
|
||||||
|
modifier = Modifier.size(30.dp).padding(start = 5.dp),
|
||||||
|
onClick = { clipboardManager.setText(AnnotatedString(user.pubkeyNpub())); }
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.ContentCopy,
|
||||||
|
null,
|
||||||
|
modifier = Modifier.padding(end = 5.dp).size(15.dp),
|
||||||
|
tint = MaterialTheme.colors.onSurface.copy(alpha = 0.32f)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DisplayNip05ProfileStatus(user)
|
DisplayNip05ProfileStatus(user)
|
||||||
|
|
||||||
val website = user.info?.website
|
val website = user.info?.website
|
||||||
|
Reference in New Issue
Block a user