From 7e5c4ed92a78f65b581f713e9040dabd232e8a7a Mon Sep 17 00:00:00 2001 From: Paul Schuetz Date: Sat, 8 Apr 2023 13:31:43 +0200 Subject: [PATCH] Show verified URLs in account lists (#1364) * Show verified URLs in account lists This allows the user to quickly assess which account of multiple is the official one, especially when searching for a person with multiple search results. Fixes #1361 Signed-off-by: Paul Schuetz * Replace the verified urls text with a checkmark This makes it easy for the user to directly see why the urls are listed. Signed-off-by: Paul Schuetz * Swiftformat Signed-off-by: Paul Schuetz --------- Signed-off-by: Paul Schuetz --- .../AccountsList/AccountsListRow.swift | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Packages/Account/Sources/Account/AccountsList/AccountsListRow.swift b/Packages/Account/Sources/Account/AccountsList/AccountsListRow.swift index d1ba6fdc..990123e7 100644 --- a/Packages/Account/Sources/Account/AccountsList/AccountsListRow.swift +++ b/Packages/Account/Sources/Account/AccountsList/AccountsListRow.swift @@ -58,6 +58,32 @@ public struct AccountsListRow: View { .environment(\.openURL, OpenURLAction { url in routerPath.handle(url: url) }) + + let fields = viewModel.account.fields.filter { $0.verifiedAt != nil } + + if !fields.isEmpty { + Capsule() + .frame(height: 1) + .foregroundStyle(.regularMaterial) + .padding(.vertical, 5) + .padding(.horizontal) + + ForEach(fields) { field in + HStack { + Image(systemName: "checkmark.seal") + .foregroundColor(.green) + EmojiTextApp(field.value, emojis: viewModel.account.emojis) + .font(.scaledFootnote) + .emojiSize(Font.scaledFootnoteFont.emojiSize) + .emojiBaselineOffset(Font.scaledFootnoteFont.emojiBaselineOffset) + .environment(\.openURL, OpenURLAction { url in + routerPath.handle(url: url) + }) + } + .padding(.top, 5) + } + } + if isFollowRequest { FollowRequestButtons(account: viewModel.account, requestUpdated: requestUpdated)