mirror of
https://github.com/otaviocc/Triton.git
synced 2026-01-29 19:54: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
|
||||
|
||||
@MainActor
|
||||
static func makeEditorViewModel() -> EditorViewModel {
|
||||
static func makeEditorViewModel(
|
||||
status: WeblogEntryStatus = .draft,
|
||||
tags: [String] = []
|
||||
) -> EditorViewModel {
|
||||
.init(
|
||||
address: "alice",
|
||||
body: "# This is the title\n\nThis is the body...",
|
||||
date: .init(),
|
||||
entryID: nil,
|
||||
status: .draft,
|
||||
tags: .init(),
|
||||
status: status,
|
||||
tags: tags,
|
||||
repository: WeblogRepositoryMother.makeWeblogRepository()
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ struct EditorView: View {
|
|||
makeComposeView()
|
||||
makeSidebarView()
|
||||
}
|
||||
|
||||
makeSelectedTagsView()
|
||||
}
|
||||
.toolbar {
|
||||
|
|
@ -191,10 +190,19 @@ struct EditorView: View {
|
|||
|
||||
#if DEBUG
|
||||
|
||||
#Preview(traits: .sizeThatFitsLayout) {
|
||||
#Preview("Draft", traits: .sizeThatFitsLayout) {
|
||||
EditorView(
|
||||
viewModel: EditorViewModelMother.makeEditorViewModel()
|
||||
)
|
||||
}
|
||||
|
||||
#Preview("Live with Tags", traits: .sizeThatFitsLayout) {
|
||||
EditorView(
|
||||
viewModel: EditorViewModelMother.makeEditorViewModel(
|
||||
status: .live,
|
||||
tags: ["Foo", "Bar"]
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue