verified marker

This commit is contained in:
spaced4ndy
2024-05-07 14:44:59 +04:00
parent 7896be3b03
commit 36bcc9ac59
2 changed files with 19 additions and 3 deletions
@@ -25,8 +25,7 @@ struct ContactListNavLink: View {
HStack{
ProfileImage(imageStr: contact.image, size: 38)
.padding(.trailing, 2)
Text(contact.chatViewName)
.lineLimit(1)
previewTitle()
if contact.contactConnIncognito {
Spacer()
Image(systemName: "theatermasks")
@@ -38,6 +37,23 @@ struct ContactListNavLink: View {
}
}
}
@ViewBuilder private func previewTitle() -> some View {
let t = Text(chat.chatInfo.chatViewName)
(
contact.verified == true
? verifiedIcon + t
: t
)
.lineLimit(1)
}
private var verifiedIcon: Text {
(Text(Image(systemName: "checkmark.shield")) + Text(" "))
.foregroundColor(.secondary)
.baselineOffset(1)
.kerning(-2)
}
}
#Preview {
+1 -1
View File
@@ -269,7 +269,7 @@ struct HomeView: View {
}
@ViewBuilder private func chatView() -> some View {
// TODO changing alias doesn't update list
// TODO changing alias / verification doesn't update list
if let chatId = chatModel.chatId, let chat = chatModel.getChat(chatId) {
ChatView(chat: chat).onAppear {
loadChat(chat: chat)