mirror of
https://github.com/dscyrescotti/Memola.git
synced 2026-05-10 09:50:04 +02:00
feat: adjust cell size
This commit is contained in:
@@ -8,13 +8,18 @@
|
||||
import SwiftUI
|
||||
|
||||
struct MemoGrid<Card: View>: View {
|
||||
let cellWidth: CGFloat = 250
|
||||
let cellHeight: CGFloat = 150
|
||||
|
||||
@Environment(\.horizontalSizeClass) var horizontalSizeClass
|
||||
let memoObjects: FetchedResults<MemoObject>
|
||||
let placeholder: Placeholder.Info
|
||||
@ViewBuilder let card: (MemoObject) -> Card
|
||||
|
||||
var cellWidth: CGFloat {
|
||||
if horizontalSizeClass == .compact {
|
||||
return 180
|
||||
}
|
||||
return 250
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
if memoObjects.isEmpty {
|
||||
Placeholder(info: placeholder)
|
||||
|
||||
@@ -8,7 +8,14 @@
|
||||
import SwiftUI
|
||||
|
||||
struct MemoPreview: View {
|
||||
let cellHeight: CGFloat = 150
|
||||
@Environment(\.horizontalSizeClass) var horizontalSizeClass
|
||||
|
||||
var cellHeight: CGFloat {
|
||||
if horizontalSizeClass == .compact {
|
||||
return 120
|
||||
}
|
||||
return 150
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
Rectangle()
|
||||
|
||||
Reference in New Issue
Block a user