mirror of
https://github.com/otaviocc/Triton.git
synced 2026-01-30 04:04:27 +00:00
Add “Live with Tags” Preview
This commit is contained in:
parent
22956e834c
commit
ef2ab718d7
2 changed files with 16 additions and 5 deletions
|
|
@ -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()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue