diff --git a/apps/ios/Shared/Model/ChatModel.swift b/apps/ios/Shared/Model/ChatModel.swift index 766ac78cc2..0d50bdb867 100644 --- a/apps/ios/Shared/Model/ChatModel.swift +++ b/apps/ios/Shared/Model/ChatModel.swift @@ -45,13 +45,13 @@ struct ChatPreview: Identifiable, Codable { enum ChatInfo: Identifiable, Codable { case direct(contact: Contact) -// case group() + case group(groupInfo: GroupInfo) var displayName: String { get { switch self { case let .direct(contact): return "@\(contact.localDisplayName)" -// case let .group(groupInfo, _): return "#\(groupInfo.localDisplayName)" + case let .group(groupInfo): return "#\(groupInfo.localDisplayName)" } } } @@ -60,7 +60,7 @@ enum ChatInfo: Identifiable, Codable { get { switch self { case let .direct(contact): return "@\(contact.contactId)" -// case let .group(contact): return group.id + case let .group(groupInfo): return "#\(groupInfo.groupId)" } } } @@ -69,7 +69,7 @@ enum ChatInfo: Identifiable, Codable { get { switch self { case .direct(_): return "direct" -// case let .group(_): return "group" + case .group(_): return "group" } } } @@ -78,7 +78,7 @@ enum ChatInfo: Identifiable, Codable { get { switch self { case let .direct(contact): return contact.contactId -// case let .group(contact): return group.id + case let .group(groupInfo): return groupInfo.groupId } } } diff --git a/apps/ios/Shared/Views/ChatPreviewView.swift b/apps/ios/Shared/Views/ChatPreviewView.swift index 4b05988ab2..0b49f45cb4 100644 --- a/apps/ios/Shared/Views/ChatPreviewView.swift +++ b/apps/ios/Shared/Views/ChatPreviewView.swift @@ -18,16 +18,30 @@ struct ChatPreviewView: View { struct ChatPreviewView_Previews: PreviewProvider { static var previews: some View { - ChatPreviewView(chatPreview: ChatPreview( - chatInfo: .direct(contact: Contact( - contactId: 123, - localDisplayName: "ep", - profile: Profile( - displayName: "ep", - fullName: "Ep" - ), - viaGroup: nil + Group{ + ChatPreviewView(chatPreview: ChatPreview( + chatInfo: .direct(contact: Contact( + contactId: 123, + localDisplayName: "ep", + profile: Profile( + displayName: "ep", + fullName: "Ep" + ), + viaGroup: nil + )) )) - )) + + ChatPreviewView(chatPreview: ChatPreview( + chatInfo: .group(groupInfo: GroupInfo( + groupId: 123, + localDisplayName: "team", + groupProfile: GroupProfile( + displayName: "team", + fullName: "My Team" + ) + )) + )) + } + .previewLayout(.fixed(width: 300, height: 70)) } }