This commit is contained in:
Trey t
2022-02-04 17:00:06 -06:00
parent 45fe752366
commit 549bd167b8
2 changed files with 21 additions and 2 deletions

View File

@@ -6,6 +6,7 @@
//
import Foundation
import SwiftUI
struct Constants {
static let groupShareId = "group.com.88oak.ifeel"
@@ -38,3 +39,21 @@ extension Date: RawRepresentable {
self = Date(timeIntervalSinceReferenceDate: Double(rawValue) ?? 0.0)
}
}
struct RoundedCorner: Shape {
var radius: CGFloat = .infinity
var corners: UIRectCorner = .allCorners
func path(in rect: CGRect) -> Path {
let path = UIBezierPath(roundedRect: rect, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius))
return Path(path.cgPath)
}
}
extension View {
func cornerRadius(_ radius: CGFloat, corners: UIRectCorner) -> some View {
clipShape( RoundedCorner(radius: radius, corners: corners) )
}
}

View File

@@ -192,7 +192,7 @@ struct ContentView: View {
yOffset: value)
}
}
.clipShape(RoundedRectangle(cornerRadius: 25, style: .continuous))
.cornerRadius(10, corners: [.topLeft, .topRight])
}
private func SectionHeaderView(month: Int, year: Int) -> some View {
@@ -341,7 +341,7 @@ struct ContentView: View {
}
.frame(height: headerHeight + 20)
listView
.padding([.leading, .trailing, .bottom])
.padding([.leading, .trailing])
}
}.background(
theme.bg