mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 17:12:45 +02:00
MESSENGER-4484 poi participants in history
This commit is contained in:
+3
-1
@@ -19,10 +19,12 @@ import CommonKit
|
||||
import MatrixSDK
|
||||
import SwiftUI
|
||||
|
||||
// bwi #4484: Poi history needs to pass a navigation router to show participants
|
||||
struct PollHistoryDetailCoordinatorParameters {
|
||||
let event: MXEvent
|
||||
let poll: TimelinePollDetails
|
||||
let room: MXRoom
|
||||
let navigationRouter: NavigationRouterType
|
||||
}
|
||||
|
||||
final class PollHistoryDetailCoordinator: Coordinator, Presentable {
|
||||
@@ -36,7 +38,7 @@ final class PollHistoryDetailCoordinator: Coordinator, Presentable {
|
||||
|
||||
init(parameters: PollHistoryDetailCoordinatorParameters) throws {
|
||||
self.parameters = parameters
|
||||
let timelinePollCoordinator = try TimelinePollCoordinator(parameters: .init(session: parameters.room.mxSession, room: parameters.room, pollEvent: parameters.event))
|
||||
let timelinePollCoordinator = try TimelinePollCoordinator(parameters: .init(session: parameters.room.mxSession, room: parameters.room, pollEvent: parameters.event, showParticipantButton: BWIBuildSettings.shared.bwiPollParticipantsInHistory), navigationRouter: parameters.navigationRouter)
|
||||
|
||||
let viewModel = PollHistoryDetailViewModel(poll: parameters.poll)
|
||||
let view = PollHistoryDetail(viewModel: viewModel.context, contentPoll: timelinePollCoordinator.toView())
|
||||
|
||||
+23
-6
@@ -26,8 +26,19 @@ struct PollHistoryDetail: View {
|
||||
@ObservedObject var viewModel: PollHistoryDetailViewModel.Context
|
||||
var contentPoll: any View
|
||||
|
||||
// bwi #4484: poi participants in history needs a pushed not presented view: Navigation title looks better this way in that case
|
||||
var body: some View {
|
||||
navigation
|
||||
if BWIBuildSettings.shared.bwiPollParticipantsInHistory {
|
||||
navigation
|
||||
.accentColor(theme.colors.accent)
|
||||
.navigationViewStyle(StackNavigationViewStyle())
|
||||
.navigationTitle(navigationTitle)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
} else {
|
||||
navigation
|
||||
.accentColor(theme.colors.accent)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private var navigation: some View {
|
||||
@@ -50,11 +61,17 @@ struct PollHistoryDetail: View {
|
||||
.font(theme.fonts.caption1)
|
||||
.padding([.top])
|
||||
.accessibilityIdentifier("PollHistoryDetail.date")
|
||||
AnyView(contentPoll)
|
||||
.navigationTitle(navigationTitle)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.navigationBarBackButtonHidden(true)
|
||||
.navigationBarItems(leading: backButton, trailing: doneButton)
|
||||
if BWIBuildSettings.shared.bwiPollParticipantsInHistory {
|
||||
AnyView(contentPoll)
|
||||
} else {
|
||||
AnyView(contentPoll)
|
||||
.navigationTitle(navigationTitle)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.navigationBarBackButtonHidden(true)
|
||||
.navigationBarItems(leading: backButton, trailing: doneButton)
|
||||
|
||||
}
|
||||
|
||||
viewInTimeline
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user