Show post's content in post view
This commit is contained in:
parent
9e25686cd6
commit
2bf082f2f9
2 changed files with 11 additions and 0 deletions
|
@ -14,6 +14,7 @@ struct OriginalPost: Decodable, Identifiable {
|
||||||
let id: Int
|
let id: Int
|
||||||
|
|
||||||
let title: String?
|
let title: String?
|
||||||
|
let content: String
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Post: Decodable, Identifiable {
|
struct Post: Decodable, Identifiable {
|
||||||
|
@ -43,6 +44,14 @@ struct Post: Decodable, Identifiable {
|
||||||
return title
|
return title
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getContent() -> String {
|
||||||
|
if isReblogged() {
|
||||||
|
return originalPost!.content
|
||||||
|
} else {
|
||||||
|
return content
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mediaURL = "https://homepages.cae.wisc.edu/~ece533/images/airplane.png"
|
let mediaURL = "https://homepages.cae.wisc.edu/~ece533/images/airplane.png"
|
||||||
|
|
|
@ -52,6 +52,8 @@ struct PostView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Text(post.getContent())
|
||||||
}
|
}
|
||||||
}.frame(maxWidth: .infinity)
|
}.frame(maxWidth: .infinity)
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue