diff options
| author | Fuwn <[email protected]> | 2025-06-16 02:36:33 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-06-16 02:36:33 -0700 |
| commit | db1a2c0f0993aa8fba2f1210c608da1bf4330fef (patch) | |
| tree | 17d61c7df234deaf7bf62aab83c14f7649360aa7 | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-db1a2c0f0993aa8fba2f1210c608da1bf4330fef.tar.xz sora-testing-db1a2c0f0993aa8fba2f1210c608da1bf4330fef.zip | |
feat: Development commit
| -rw-r--r-- | Sora/Views/Post/Grid/PostGridView.swift | 23 | ||||
| -rw-r--r-- | project.yml | 4 |
2 files changed, 17 insertions, 10 deletions
diff --git a/Sora/Views/Post/Grid/PostGridView.swift b/Sora/Views/Post/Grid/PostGridView.swift index 117da87..2b4b8c5 100644 --- a/Sora/Views/Post/Grid/PostGridView.swift +++ b/Sora/Views/Post/Grid/PostGridView.swift @@ -1,5 +1,4 @@ import SwiftUI -import WaterfallGrid struct PostGridView: View { @EnvironmentObject var settings: SettingsManager @@ -34,12 +33,24 @@ struct PostGridView: View { .padding() } - WaterfallGrid(filteredPosts, id: \.id) { post in - waterfallGridContent(post: post) - .id(post.id) + let columnCount = settings.thumbnailGridColumns + let columnsData = (0..<columnCount).map { columnIndex in + filteredPosts.enumerated().compactMap { index, post in + index % columnCount == columnIndex ? post : nil + } + } + + HStack(alignment: .top) { + ForEach(0..<columnCount, id: \.self) { columnIndex in + LazyVStack { + ForEach(columnsData[columnIndex], id: \.id) { post in + waterfallGridContent(post: post) + .id(post.id) + } + } + } } - .gridStyle(columns: settings.thumbnailGridColumns) - .padding(8) + .padding(.horizontal) } .opacity(isActive ? 1 : 0) .frame(height: isActive ? nil : 0) diff --git a/project.yml b/project.yml index c7ab66d..d52e6fa 100644 --- a/project.yml +++ b/project.yml @@ -24,9 +24,6 @@ packages: NetworkImage: url: https://github.com/gonzalezreal/NetworkImage majorVersion: 6.0.1 - WaterfallGrid: - url: https://github.com/paololeonardi/WaterfallGrid - majorVersion: 1.1.0 targets: Sora: type: application @@ -74,7 +71,6 @@ targets: dependencies: - package: Alamofire - package: NetworkImage - - package: WaterfallGrid info: path: Sora/Resources/Info.generated.plist properties: |