Add SwiftUI Preview for picture drag-and-drop

This commit is contained in:
Otavio Cordeiro 2025-12-22 11:12:09 +01:00 committed by Otávio
parent eedd369c37
commit 07ea603267
2 changed files with 14 additions and 1 deletions

View file

@ -13,7 +13,8 @@
altText: String? = nil,
isHidden: Bool? = nil,
tags: [String]? = nil,
imageData: Data? = nil
imageData: Data? = nil,
isDragging: Bool? = nil
) -> UploadViewModel {
let viewModel = UploadViewModel(
repository: PicsRepositoryMother.makePicsRepository(),
@ -38,6 +39,10 @@
tags.forEach { viewModel.addTag($0) }
}
if let isDragging {
viewModel.isDragging = isDragging
}
return viewModel
}
}

View file

@ -253,4 +253,12 @@ struct UploadView: View {
)
}
#Preview("Drag-And-Drop") {
UploadView(
viewModel: UploadViewModelMother.makeUploadViewModel(
isDragging: true
)
)
}
#endif