mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 00:52:43 +02:00
Add dependency management, AvatarViewModel and placeholder rendering now in AvatarImage.
This commit is contained in:
@@ -64,9 +64,10 @@ final class RoomNotificationSettingsCoordinator: RoomNotificationSettingsCoordin
|
||||
|
||||
let viewController: UIViewController
|
||||
if #available(iOS 14.0.0, *) {
|
||||
let avatarService: AvatarServiceType = AvatarService(mediaManager: room.mxSession.mediaManager)
|
||||
let view = RoomNotificationSettings(viewModel: roomNotificationSettingsViewModel, presentedModally: presentedModally)
|
||||
.addDependency(avatarService)
|
||||
let host = VectorHostingController(rootView: view)
|
||||
host.add(dependency: AvatarService(mediaManager: room.mxSession.mediaManager))
|
||||
viewController = host
|
||||
} else {
|
||||
viewController = RoomNotificationSettingsViewController.instantiate(with: roomNotificationSettingsViewModel)
|
||||
|
||||
@@ -90,8 +90,8 @@ struct RoomNotificationSettings_Previews: PreviewProvider {
|
||||
NavigationView {
|
||||
RoomNotificationSettings(viewModel: mockViewModel, presentedModally: true)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.theme(ThemeIdentifier.dark.theme)
|
||||
.addDependency(MockAvatarService.example)
|
||||
.theme(ThemeIdentifier.dark)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ struct RoomNotificationSettingsHeader: View {
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct RoomNotificationSettingsHeader_Previews: PreviewProvider {
|
||||
static let image = UIImage(imageLiteralResourceName: "app_symbol")
|
||||
static let name = "Element"
|
||||
static var previews: some View {
|
||||
RoomNotificationSettingsHeader(avatarData: MockAvatarInput.example, displayName: name)
|
||||
|
||||
@@ -57,7 +57,8 @@ struct VectorForm_Previews: PreviewProvider {
|
||||
}
|
||||
VectorForm {
|
||||
FormPickerItem(title: "Item 1", selected: true)
|
||||
}.theme(ThemeIdentifier.dark.theme)
|
||||
}
|
||||
.theme(ThemeIdentifier.dark)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user