1
Fork 0

Add working previews for each view

This commit is contained in:
redstrate 2020-06-03 22:42:37 -04:00
parent 61f4731807
commit 2cb480a84b
3 changed files with 23 additions and 4 deletions

View file

@ -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)

View file

@ -38,7 +38,6 @@ struct PostView: View {
struct PostView_Previews: PreviewProvider {
static var previews: some View {
//PostView()
Text("Hello, world!")
return PostView(post: fooPost)
}
}

View file

@ -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])
}
}