From a537e3af7cc5e0754056d0b58f73dc59dba73694 Mon Sep 17 00:00:00 2001 From: Ryan ZHAO <> Date: Mon, 5 Feb 2024 13:32:27 +1100 Subject: [PATCH] add time label on search result cell --- .../GlobalSearch/GlobalSearchScreen.swift | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Session/Home/GlobalSearch/GlobalSearchScreen.swift b/Session/Home/GlobalSearch/GlobalSearchScreen.swift index 4e4382457..d10aa399e 100644 --- a/Session/Home/GlobalSearch/GlobalSearchScreen.swift +++ b/Session/Home/GlobalSearch/GlobalSearchScreen.swift @@ -340,10 +340,21 @@ struct SearchResultCell: View { alignment: .leading, spacing: Values.verySmallSpacing ) { - Text(viewModel.displayName) - .bold() - .font(.system(size: Values.mediumFontSize)) - .foregroundColor(themeColor: .textPrimary) + HStack { + Text(viewModel.displayName) + .bold() + .font(.system(size: Values.mediumFontSize)) + .foregroundColor(themeColor: .textPrimary) + + Spacer() + + if searchSection == .messages { + Text(viewModel.lastInteractionDate.formattedForDisplay) + .font(.system(size: Values.smallFontSize)) + .foregroundColor(themeColor: .textSecondary) + .opacity(Values.lowOpacity) + } + } if let textColor: UIColor = ThemeManager.currentTheme.color(for: .textPrimary) { let maybeSnippet: NSAttributedString? = { @@ -396,7 +407,7 @@ struct SearchResultCell: View { Spacer(minLength: 0) } - .padding(.horizontal, Values.mediumSpacing) + .padding(.leading, Values.mediumSpacing) } }