Add working previews for each view
This commit is contained in:
parent
61f4731807
commit
2cb480a84b
3 changed files with 23 additions and 4 deletions
|
@ -43,3 +43,24 @@ struct Post: Decodable, Identifiable {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
let testMedia = Media(id: 0,
|
||||
url: "https://homepages.cae.wisc.edu/~ece533/images/airplane.png")
|
||||
|
||||
let fooPost = Post(id: 0,
|
||||
title: "Foo",
|
||||
content: "",
|
||||
postType: .picture,
|
||||
media: [testMedia],
|
||||
username: "foobar",
|
||||
originalUsername: nil,
|
||||
originalPost: nil)
|
||||
|
||||
let fooPostReblog = Post(id: 1,
|
||||
title: nil,
|
||||
content: "",
|
||||
postType: .picture,
|
||||
media: [testMedia],
|
||||
username: "foobar",
|
||||
originalUsername: "foobar2",
|
||||
originalPost: nil)
|
||||
|
|
|
@ -38,7 +38,6 @@ struct PostView: View {
|
|||
|
||||
struct PostView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
//PostView()
|
||||
Text("Hello, world!")
|
||||
return PostView(post: fooPost)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,6 @@ struct ProfileView: View {
|
|||
|
||||
struct ProfileView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
//ProfileView()
|
||||
Text("Hello, world!")
|
||||
return ProfileView(username: "foobar", posts: [fooPost, fooPostReblog])
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue