diff --git a/Passepartout/Library/Sources/AppUI/Views/Theme/Theme.swift b/Passepartout/Library/Sources/AppUI/Views/Theme/Theme.swift index f0959e78..9277c429 100644 --- a/Passepartout/Library/Sources/AppUI/Views/Theme/Theme.swift +++ b/Passepartout/Library/Sources/AppUI/Views/Theme/Theme.swift @@ -80,7 +80,7 @@ public final class Theme: ObservableObject { switch $0 { case .add: return "plus" case .close: return "xmark" - case .cloud: return "cloud" + case .cloud: return "icloud" case .contextDuplicate: return "plus.square.on.square" case .contextRemove: return "trash" case .copy: return "doc.on.doc" diff --git a/Passepartout/Library/Sources/AppUI/Views/UI/ProfileCardView.swift b/Passepartout/Library/Sources/AppUI/Views/UI/ProfileCardView.swift index c2ad081b..2af0d212 100644 --- a/Passepartout/Library/Sources/AppUI/Views/UI/ProfileCardView.swift +++ b/Passepartout/Library/Sources/AppUI/Views/UI/ProfileCardView.swift @@ -38,31 +38,18 @@ struct ProfileCardView: View { let header: ProfileHeader - @ObservedObject - var profileManager: ProfileManager - var body: some View { switch style { case .compact: - HStack { - Text(header.name) - .themeTruncating() - if isShared { - ThemeImage(.cloud) - } - } - .frame(maxWidth: .infinity, alignment: .leading) + Text(header.name) + .themeTruncating() + .frame(maxWidth: .infinity, alignment: .leading) case .full: VStack(alignment: .leading) { - HStack { - Text(header.name) - .font(.headline) - .themeTruncating() - if isShared { - ThemeImage(.cloud) - } - } + Text(header.name) + .font(.headline) + .themeTruncating() Text(Strings.Views.Profiles.Rows.modules(header.modules.count)) .font(.subheadline) .foregroundStyle(.secondary) @@ -72,12 +59,6 @@ struct ProfileCardView: View { } } -private extension ProfileCardView { - var isShared: Bool { - profileManager.isRemotelyShared(profileWithId: header.id) - } -} - // MARK: - Previews #Preview { @@ -85,15 +66,13 @@ private extension ProfileCardView { Section { ProfileCardView( style: .compact, - header: Profile.mock.header(), - profileManager: .mock + header: Profile.mock.header() ) } Section { ProfileCardView( style: .full, - header: Profile.mock.header(), - profileManager: .mock + header: Profile.mock.header() ) } } diff --git a/Passepartout/Library/Sources/AppUI/Views/UI/ProfileRowView.swift b/Passepartout/Library/Sources/AppUI/Views/UI/ProfileRowView.swift index 2ddefda8..c21760a1 100644 --- a/Passepartout/Library/Sources/AppUI/Views/UI/ProfileRowView.swift +++ b/Passepartout/Library/Sources/AppUI/Views/UI/ProfileRowView.swift @@ -38,7 +38,8 @@ struct ProfileRowView: View, TunnelContextProviding { let style: ProfileCardView.Style - let profileManager: ProfileManager + @ObservedObject + var profileManager: ProfileManager @ObservedObject var tunnel: Tunnel @@ -63,12 +64,19 @@ struct ProfileRowView: View, TunnelContextProviding { } cardView Spacer() + if isShared { + sharingView + } ProfileInfoButton(header: header, onEdit: onEdit) } } } private extension ProfileRowView { + var isShared: Bool { + profileManager.isRemotelyShared(profileWithId: header.id) + } + var markerView: some View { ThemeImage(header.id == nextProfileId ? .pending : statusImage) .opacity(header.id == nextProfileId || header.id == tunnel.currentProfile?.id ? 1.0 : 0.0) @@ -85,14 +93,18 @@ private extension ProfileRowView { ) { _ in ProfileCardView( style: style, - header: header, - profileManager: profileManager + header: header ) .frame(maxWidth: .infinity) .contentShape(.rect) } } + var sharingView: some View { + ThemeImage(.cloud) + .foregroundStyle(.secondary) + } + var statusImage: Theme.ImageName { switch tunnelConnectionStatus { case .active: