From e59aa2cbc6c86a5e8cf9e17d5f5d376cda61a0ce Mon Sep 17 00:00:00 2001 From: Kaede Akino Date: Mon, 21 Sep 2026 13:19:11 +0800 Subject: [PATCH] Storage chip for identity card --- .../Keychain/MobileCredentialsView.swift | 19 +++++++++++++++++++ TFM/Features/Keychain/KeychainPageView.swift | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/TFI/Features/Keychain/MobileCredentialsView.swift b/TFI/Features/Keychain/MobileCredentialsView.swift index 5feef1f7..3e92ea6e 100644 --- a/TFI/Features/Keychain/MobileCredentialsView.swift +++ b/TFI/Features/Keychain/MobileCredentialsView.swift @@ -238,6 +238,9 @@ private struct MobileIdentityCredentialCard: View { case .notConfigured: EmptyView() } + MobileCardChip( + text: identity.passwordStorage.mobileDisplayName, + symbol: identity.passwordStorage.mobileSymbol) } if identity.usesKey { if let key { @@ -264,6 +267,22 @@ private struct MobileIdentityCredentialCard: View { } } +extension PasswordStorage { + fileprivate var mobileDisplayName: String { + switch self { + case .thisDevice: String(localized: "This Device") + case .iCloud: String(localized: "iCloud") + } + } + + fileprivate var mobileSymbol: String { + switch self { + case .thisDevice: "lock.fill" + case .iCloud: "icloud.fill" + } + } +} + extension KeyStorage { fileprivate var mobileDisplayName: String { switch self { diff --git a/TFM/Features/Keychain/KeychainPageView.swift b/TFM/Features/Keychain/KeychainPageView.swift index d749bccf..00bbad3f 100644 --- a/TFM/Features/Keychain/KeychainPageView.swift +++ b/TFM/Features/Keychain/KeychainPageView.swift @@ -1737,6 +1737,10 @@ private struct IdentityCard: View { case .notConfigured: EmptyView() } + CardChip( + text: identity.passwordStorage.displayName, + symbol: identity.passwordStorage.symbol + ) } if identity.usesKey {