diff --git a/Passepartout/Library/Sources/AppUITV/Views/Profile/ActiveProfileView.swift b/Passepartout/Library/Sources/AppUITV/Views/Profile/ActiveProfileView.swift index 52245c83..de300e0f 100644 --- a/Passepartout/Library/Sources/AppUITV/Views/Profile/ActiveProfileView.swift +++ b/Passepartout/Library/Sources/AppUITV/Views/Profile/ActiveProfileView.swift @@ -55,8 +55,6 @@ struct ActiveProfileView: View { var body: some View { VStack(spacing: .zero) { - Spacer() - VStack { VStack { currentProfileView @@ -76,6 +74,7 @@ struct ActiveProfileView: View { .clipShape(RoundedRectangle(cornerRadius: 50)) } .padding(.horizontal, 100) + .padding(.top, 50) Spacer() } @@ -100,7 +99,7 @@ private extension ActiveProfileView { func detailView(for profile: Profile) -> some View { VStack(spacing: 10) { - if let connectionModule = profile.firstConnectionModule(ifActive: true) { + if let connectionModule { DetailRowView(title: Strings.Global.protocol) { Text(connectionModule.moduleHandler.id.name) } @@ -117,6 +116,11 @@ private extension ActiveProfileView { } } } + if let otherModulesList { + DetailRowView(title: otherModulesList) { + EmptyView() + } + } } .font(.title3) } @@ -163,6 +167,28 @@ private extension ActiveProfileView { } } +private extension ActiveProfileView { + var connectionModule: ConnectionModule? { + profile?.firstConnectionModule(ifActive: true) + } + + var otherModules: [Module]? { + profile? + .activeModules + .filter { + !($0 is ConnectionModule) + } + .nilIfEmpty + } + + var otherModulesList: String? { + otherModules? + .map(\.moduleType.localizedDescription) + .sorted() + .joined(separator: ", ") + } +} + // MARK: - private extension ActiveProfileView {