From 21f7b799747b8364f49600a88a5392d2dc5baf86 Mon Sep 17 00:00:00 2001 From: Francesco <100066266+cranci1@users.noreply.github.com> Date: Sat, 31 May 2025 18:04:10 +0200 Subject: [PATCH] nvm no scrollview sorry --- Sora/Views/SearchView/SearchResultsGrid.swift | 72 +++++++++---------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/Sora/Views/SearchView/SearchResultsGrid.swift b/Sora/Views/SearchView/SearchResultsGrid.swift index e45cd4f..d5e0758 100644 --- a/Sora/Views/SearchView/SearchResultsGrid.swift +++ b/Sora/Views/SearchView/SearchResultsGrid.swift @@ -28,49 +28,47 @@ struct SearchResultsGrid: View { } var body: some View { - ScrollView { - LazyVGrid(columns: Array(repeating: GridItem(.flexible(), spacing: 12), count: columnsCount), spacing: 12) { - ForEach(items) { item in - NavigationLink(destination: MediaInfoView(title: item.title, imageUrl: item.imageUrl, href: item.href, module: selectedModule)) { - ZStack { - KFImage(URL(string: item.imageUrl)) - .resizable() - .aspectRatio(0.72, contentMode: .fill) - .frame(width: cellWidth, height: cellWidth * 1.5) - .cornerRadius(12) - .clipped() - - VStack { + LazyVGrid(columns: Array(repeating: GridItem(.flexible(), spacing: 12), count: columnsCount), spacing: 12) { + ForEach(items) { item in + NavigationLink(destination: MediaInfoView(title: item.title, imageUrl: item.imageUrl, href: item.href, module: selectedModule)) { + ZStack { + KFImage(URL(string: item.imageUrl)) + .resizable() + .aspectRatio(0.72, contentMode: .fill) + .frame(width: cellWidth, height: cellWidth * 1.5) + .cornerRadius(12) + .clipped() + + VStack { + Spacer() + HStack { + Text(item.title) + .lineLimit(2) + .foregroundColor(.white) + .multilineTextAlignment(.leading) Spacer() - HStack { - Text(item.title) - .lineLimit(2) - .foregroundColor(.white) - .multilineTextAlignment(.leading) - Spacer() - } - .padding(12) - .background( - LinearGradient( - colors: [ - .black.opacity(0.7), - .black.opacity(0.0) - ], - startPoint: .bottom, - endPoint: .top - ) - .shadow(color: .black, radius: 4, x: 0, y: 2) - ) } - .frame(width: cellWidth) + .padding(12) + .background( + LinearGradient( + colors: [ + .black.opacity(0.7), + .black.opacity(0.0) + ], + startPoint: .bottom, + endPoint: .top + ) + .shadow(color: .black, radius: 4, x: 0, y: 2) + ) } - .clipShape(RoundedRectangle(cornerRadius: 12)) - .padding(4) + .frame(width: cellWidth) } + .clipShape(RoundedRectangle(cornerRadius: 12)) + .padding(4) } } - .padding(.top) - .padding() } + .padding(.top) + .padding() } }