Adding verification tag in the thread view and like/boost notification cards

This commit is contained in:
Vitor Pamplona 2023-01-27 12:35:41 -03:00
parent 88a82b3fbc
commit b4fb623a01
3 changed files with 13 additions and 37 deletions

View File

@ -36,6 +36,9 @@ fun BoostSetCompose(likeSetCard: BoostSetCard, isInnerNote: Boolean = false, rou
val noteState by likeSetCard.note.live.observeAsState()
val note = noteState?.note
val accountState by accountViewModel.accountLiveData.observeAsState()
val account = accountState?.account ?: return
val context = LocalContext.current.applicationContext
if (note?.event == null) {
@ -79,20 +82,7 @@ fun BoostSetCompose(likeSetCard: BoostSetCard, isInnerNote: Boolean = false, rou
if (cardNote?.author != null) {
val userState by cardNote.author!!.live.observeAsState()
AsyncImage(
model = userState?.user?.profilePicture(),
placeholder = rememberAsyncImagePainter("https://robohash.org/${userState?.user?.pubkeyHex}.png"),
contentDescription = "Profile Image",
modifier = Modifier
.width(35.dp)
.height(35.dp)
.clip(shape = CircleShape)
.clickable(onClick = {
userState?.let {
navController.navigate("User/${it.user.pubkeyHex}")
}
})
)
UserPicture(user = userState?.user, userAccount = account.userProfile(), size = 35.dp)
}
}
}

View File

@ -36,6 +36,9 @@ fun LikeSetCompose(likeSetCard: LikeSetCard, modifier: Modifier = Modifier, isIn
val noteState by likeSetCard.note.live.observeAsState()
val note = noteState?.note
val accountState by accountViewModel.accountLiveData.observeAsState()
val account = accountState?.account ?: return
val context = LocalContext.current.applicationContext
if (note == null) {
@ -79,20 +82,7 @@ fun LikeSetCompose(likeSetCard: LikeSetCard, modifier: Modifier = Modifier, isIn
if (cardNote?.author != null) {
val userState by cardNote.author!!.live.observeAsState()
AsyncImage(
model = userState?.user?.profilePicture(),
placeholder = rememberAsyncImagePainter("https://robohash.org/${userState?.user?.pubkeyHex}.png"),
contentDescription = "Profile Image",
modifier = Modifier
.width(35.dp).height(35.dp)
.height(35.dp)
.clip(shape = CircleShape)
.clickable(onClick = {
userState?.let {
navController.navigate("User/${it.user.pubkeyHex}")
}
})
)
UserPicture(user = userState?.user, userAccount = account.userProfile(), size = 35.dp)
}
}
}

View File

@ -41,6 +41,7 @@ import com.vitorpamplona.amethyst.ui.components.RichTextViewer
import com.vitorpamplona.amethyst.ui.note.BlankNote
import com.vitorpamplona.amethyst.ui.note.NoteCompose
import com.vitorpamplona.amethyst.ui.note.ReactionsRow
import com.vitorpamplona.amethyst.ui.note.UserPicture
import com.vitorpamplona.amethyst.ui.note.UsernameDisplay
import com.vitorpamplona.amethyst.ui.note.timeAgoLong
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
@ -156,6 +157,9 @@ fun NoteMaster(baseNote: Note, accountViewModel: AccountViewModel, navController
val noteState by baseNote.live.observeAsState()
val note = noteState?.note
val accountState by accountViewModel.accountLiveData.observeAsState()
val account = accountState?.account ?: return
if (note?.event == null) {
BlankNote()
} else {
@ -174,15 +178,7 @@ fun NoteMaster(baseNote: Note, accountViewModel: AccountViewModel, navController
}
})
) {
// Draws the boosted picture outside the boosted card.
AsyncImage(
model = author?.profilePicture(),
placeholder = rememberAsyncImagePainter("https://robohash.org/${author?.pubkeyHex}.png"),
contentDescription = "Profile Image",
modifier = Modifier
.width(55.dp).height(55.dp)
.clip(shape = CircleShape)
)
UserPicture(user = author, userAccount = account.userProfile(), size = 55.dp)
Column(modifier = Modifier.padding(start = 10.dp)) {
Row(verticalAlignment = Alignment.CenterVertically) {