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 {
|
struct PostView_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
//PostView()
|
return PostView(post: fooPost)
|
||||||
Text("Hello, world!")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,6 @@ struct ProfileView: View {
|
||||||
|
|
||||||
struct ProfileView_Previews: PreviewProvider {
|
struct ProfileView_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
//ProfileView()
|
return ProfileView(username: "foobar", posts: [fooPost, fooPostReblog])
|
||||||
Text("Hello, world!")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue