This commit is contained in:
spaced4ndy
2024-05-07 18:16:05 +04:00
parent f6493d1b90
commit bae67ef1db
2 changed files with 24 additions and 3 deletions
@@ -37,9 +37,15 @@ struct ContactListNavLink: View {
)
} label: {
HStack{
ProfileImage(imageStr: contact.image, size: 38)
.padding(.trailing, 2)
ZStack(alignment: .bottomTrailing) {
ProfileImage(imageStr: contact.image, size: 38)
chatPreviewImageOverlayIcon(contact)
.padding([.bottom, .trailing], 1)
}
.padding(.trailing, 2)
previewTitle(contact)
if contact.contactConnIncognito {
Spacer()
Image(systemName: "theatermasks")
@@ -111,6 +117,21 @@ struct ContactListNavLink: View {
.baselineOffset(1)
.kerning(-2)
}
@ViewBuilder private func chatPreviewImageOverlayIcon(_ contact: Contact) -> some View {
if !contact.active {
inactiveIcon()
} else {
EmptyView()
}
}
// TODO smaller
private func inactiveIcon() -> some View {
Image(systemName: "multiply.circle.fill")
.foregroundColor(.secondary.opacity(0.65))
.background(Circle().foregroundColor(Color(uiColor: .systemBackground)))
}
}
#Preview {
@@ -79,7 +79,7 @@ struct ChatListNavLink: View {
@ViewBuilder private func contactNavLink(_ contact: Contact) -> some View {
Group {
if contact.activeConn == nil && contact.profile.contactLink != nil {
if contact.activeConn == nil && contact.profile.contactLink != nil && contact.active {
ChatPreviewView(chat: chat, progressByTimeout: Binding.constant(false))
.frame(height: rowHeights[dynamicTypeSize])
.swipeActions(edge: .trailing, allowsFullSwipe: true) {