diff options
| author | Fuwn <[email protected]> | 2025-03-01 00:35:26 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-03-01 00:35:32 -0800 |
| commit | 83113da4692cc60e394f9c7af89882e7ec5ca877 (patch) | |
| tree | 8382220281eaedf9f6f2c817ee1f8e77f523f383 /Sora/Views/Post/Details/PostDetailsView.swift | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-83113da4692cc60e394f9c7af89882e7ec5ca877.tar.xz sora-testing-83113da4692cc60e394f9c7af89882e7ec5ca877.zip | |
feat: Development commit
Diffstat (limited to 'Sora/Views/Post/Details/PostDetailsView.swift')
| -rw-r--r-- | Sora/Views/Post/Details/PostDetailsView.swift | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/Sora/Views/Post/Details/PostDetailsView.swift b/Sora/Views/Post/Details/PostDetailsView.swift index 596cbbd..4662f4a 100644 --- a/Sora/Views/Post/Details/PostDetailsView.swift +++ b/Sora/Views/Post/Details/PostDetailsView.swift @@ -19,27 +19,36 @@ struct PostDetailsView: View { } @State private var isTagsSheetPresented = false + var filteredPosts: [BooruPost] { + manager.posts + .filter { settings.displayRatings.contains($0.rating) } + .sorted { $0.id > $1.id } + } + var body: some View { VStack(spacing: 0) { - PostDetailsImageView( - url: imageURL, - loadingStage: $loadingStage, - finalLoadingState: .loaded, - post: post - ) { + #if os(macOS) PostDetailsImageView( - url: post.previewURL, - loadingStage: $loadingStage + url: imageURL, + loadingStage: $loadingStage, + finalLoadingState: .loaded, + post: post + ) { + PostDetailsImageView( + url: post.previewURL, + loadingStage: $loadingStage + ) + .id(post.previewURL) + } + .id(imageURL) + #else + PostDetailsCarouselView( + posts: filteredPosts, + loadingStage: $loadingStage, + focusedPost: post ) .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center) - .id(post.previewURL) - .padding(0) - .zIndex(0) - } - .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center) - .id(imageURL) - .padding(0) - .zIndex(0) + #endif if settings.displayDetailsInformationBar { VStack(spacing: 5) { |