Add “Live with Tags” Preview

This commit is contained in:
Otavio Cordeiro 2025-12-22 06:33:08 +01:00 committed by Otávio
parent 22956e834c
commit ef2ab718d7
2 changed files with 16 additions and 5 deletions

View file

@ -7,14 +7,17 @@
// MARK: - Public // MARK: - Public
@MainActor @MainActor
static func makeEditorViewModel() -> EditorViewModel { static func makeEditorViewModel(
status: WeblogEntryStatus = .draft,
tags: [String] = []
) -> EditorViewModel {
.init( .init(
address: "alice", address: "alice",
body: "# This is the title\n\nThis is the body...", body: "# This is the title\n\nThis is the body...",
date: .init(), date: .init(),
entryID: nil, entryID: nil,
status: .draft, status: status,
tags: .init(), tags: tags,
repository: WeblogRepositoryMother.makeWeblogRepository() repository: WeblogRepositoryMother.makeWeblogRepository()
) )
} }

View file

@ -28,7 +28,6 @@ struct EditorView: View {
makeComposeView() makeComposeView()
makeSidebarView() makeSidebarView()
} }
makeSelectedTagsView() makeSelectedTagsView()
} }
.toolbar { .toolbar {
@ -191,10 +190,19 @@ struct EditorView: View {
#if DEBUG #if DEBUG
#Preview(traits: .sizeThatFitsLayout) { #Preview("Draft", traits: .sizeThatFitsLayout) {
EditorView( EditorView(
viewModel: EditorViewModelMother.makeEditorViewModel() viewModel: EditorViewModelMother.makeEditorViewModel()
) )
} }
#Preview("Live with Tags", traits: .sizeThatFitsLayout) {
EditorView(
viewModel: EditorViewModelMother.makeEditorViewModel(
status: .live,
tags: ["Foo", "Bar"]
)
)
}
#endif #endif