Add description view
This commit is contained in:
parent
7ad4b26fc6
commit
f90e705dd6
1 changed files with 12 additions and 1 deletions
|
@ -1,5 +1,11 @@
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
|
struct DescriptionView: View {
|
||||||
|
var body: some View {
|
||||||
|
Text("Hello, world!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct ProfileView: View {
|
struct ProfileView: View {
|
||||||
let username: String
|
let username: String
|
||||||
|
|
||||||
|
@ -10,7 +16,12 @@ struct ProfileView: View {
|
||||||
List(posts, id: \.post.id) { post in
|
List(posts, id: \.post.id) { post in
|
||||||
PostView(post: post)
|
PostView(post: post)
|
||||||
}
|
}
|
||||||
}.navigationBarTitle(username + "'s Feed").onAppear {
|
}
|
||||||
|
.navigationBarTitle(username + "'s Feed")
|
||||||
|
.navigationBarItems(trailing: NavigationLink(destination: DescriptionView()) {
|
||||||
|
Text("View Description")
|
||||||
|
})
|
||||||
|
.onAppear {
|
||||||
let url = URL(string: "https://www.pillowfort.social/" + self.username + "/json")!
|
let url = URL(string: "https://www.pillowfort.social/" + self.username + "/json")!
|
||||||
|
|
||||||
URLSession.shared.dataTask(with: url) { (data, response, error) in
|
URLSession.shared.dataTask(with: url) { (data, response, error) in
|
||||||
|
|
Reference in a new issue