From 7d670c5b63db44e32d33b7db3495b4d792866f86 Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Tue, 2 Jan 2024 19:14:45 -0800 Subject: Fix banners not loading. First crack at adding a classic icon set with icons painsakenly pulled from the original Hotline client. May try to "remaster" these somehow. --- Hotline/iOS/ChatView.swift | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'Hotline/iOS/ChatView.swift') diff --git a/Hotline/iOS/ChatView.swift b/Hotline/iOS/ChatView.swift index 02fd6dc..dadd5e6 100644 --- a/Hotline/iOS/ChatView.swift +++ b/Hotline/iOS/ChatView.swift @@ -26,25 +26,28 @@ struct ChatView: View { if msg.type == .agreement { VStack(alignment: .center) { - FileImageView() - .environment(self.model) - .frame(maxWidth: 468.0) - .clipShape(RoundedRectangle(cornerRadius: 5)) + if let bannerImage = self.model.bannerImage { + Image(uiImage: bannerImage) + .resizable() + .scaledToFit() + .frame(maxWidth: 468.0) + .clipShape(RoundedRectangle(cornerRadius: 5)) + } - VStack(alignment: .leading) { - HStack { - Text(msg.text) - .textSelection(.enabled) - .font(.system(size: 12)) - .fontDesign(.monospaced) - .lineSpacing(2) - .padding() - Spacer() - } + VStack(alignment: .leading) { + HStack { + Text(msg.text) + .textSelection(.enabled) + .font(.system(size: 12)) + .fontDesign(.monospaced) + .lineSpacing(2) + .padding() + Spacer() } - .background(colorScheme == .dark ? Color(white: 0.1) : Color(white: 0.96)) - .frame(maxWidth: .infinity) - .cornerRadius(5) + } + .background(colorScheme == .dark ? Color(white: 0.1) : Color(white: 0.96)) + .frame(maxWidth: .infinity) + .cornerRadius(5) } .frame(maxWidth: .infinity) .padding() -- cgit