Created
June 2, 2025 12:03
-
-
Save jacobsapps/32648272c1f2d103fffb2a74260e54b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct CardGridView: View { | |
@Query(sort: \CardEntity.title) private var cardEntities: [CardEntity] | |
var body: some View { | |
NavigationStack { | |
ScrollView { | |
LazyVGrid(columns: Array(repeating: GridItem(.flexible()), count: 3), spacing: 12) { | |
ForEach(cardEntities.compactMap { $0.toCard() }) { card in | |
CardView(card: card, size: .small, showEffects: false) | |
.onTapGesture { | |
selectedCard = card | |
} | |
} | |
} | |
.padding() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment