From 104e1040bfd9a339687643e36174416b2b63c7e9 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Tue, 18 Oct 2022 10:07:45 +0100 Subject: [PATCH] ios: use transparent background for images without text and quote (#1224) --- .../Shared/Views/Chat/ChatItem/FramedItemView.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/ios/Shared/Views/Chat/ChatItem/FramedItemView.swift b/apps/ios/Shared/Views/Chat/ChatItem/FramedItemView.swift index 9bc0af66df..c1c4d43897 100644 --- a/apps/ios/Shared/Views/Chat/ChatItem/FramedItemView.swift +++ b/apps/ios/Shared/Views/Chat/ChatItem/FramedItemView.swift @@ -207,8 +207,17 @@ private struct MetaColorPreferenceKey: PreferenceKey { } } +func onlyImage(_ ci: ChatItem) -> Bool { + if case let .image(text, _) = ci.content.msgContent { + return ci.quotedItem == nil && text == "" + } + return false +} + func chatItemFrameColor(_ ci: ChatItem, _ colorScheme: ColorScheme) -> Color { - ci.chatDir.sent + onlyImage(ci) + ? Color.clear + : ci.chatDir.sent ? (colorScheme == .light ? sentColorLight : sentColorDark) : Color(uiColor: .tertiarySystemGroupedBackground) }