Skip to content

Commit d399ab9

Browse files
authored
fix: add back standalone post link (#707)
1 parent 9dfcff8 commit d399ab9

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

Splajompy/Posts/PostView.swift

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,23 @@ struct PostView: View {
3535
@State private var isPresentingCommentsSheet: Bool = false
3636

3737
var body: some View {
38+
Group {
39+
if isStandalone {
40+
postContent
41+
} else {
42+
NavigationLink(value: Route.post(id: post.id)) {
43+
postContent
44+
}
45+
.buttonStyle(.plain)
46+
}
47+
}
48+
.sheet(isPresented: $isPresentingCommentsSheet) {
49+
CommentsView(postId: post.post.postId, postManager: postManager)
50+
.postHogScreenView()
51+
}
52+
}
53+
54+
private var postContent: some View {
3855
VStack {
3956
Divider()
4057
.padding(.bottom, 4)
@@ -65,10 +82,6 @@ struct PostView: View {
6582
.contentShape(Rectangle())
6683
.animation(.easeInOut(duration: 0.3), value: post.isPinned)
6784
.safeAreaPadding(.horizontal, 16)
68-
.sheet(isPresented: $isPresentingCommentsSheet) {
69-
CommentsView(postId: post.post.postId, postManager: postManager)
70-
.postHogScreenView()
71-
}
7285
}
7386

7487
private var authorHeader: some View {

0 commit comments

Comments
 (0)