Bring the SwiftUI app in line with the Apple-native mock and keep pending approvals actionable from Live Activities and watch complications.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import SwiftUI
|
||||
|
||||
public extension View {
|
||||
@ViewBuilder
|
||||
func idpGlassChrome() -> some View {
|
||||
if #available(iOS 26, macOS 26, *) {
|
||||
self.glassEffect(.regular)
|
||||
} else {
|
||||
self.background(.regularMaterial)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct IdPGlassCapsule<Content: View>: View {
|
||||
let padding: EdgeInsets
|
||||
let content: Content
|
||||
|
||||
init(
|
||||
padding: EdgeInsets = EdgeInsets(top: 12, leading: 16, bottom: 12, trailing: 16),
|
||||
@ViewBuilder content: () -> Content
|
||||
) {
|
||||
self.padding = padding
|
||||
self.content = content()
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
content
|
||||
.padding(padding)
|
||||
.background(
|
||||
Capsule(style: .continuous)
|
||||
.fill(.clear)
|
||||
.idpGlassChrome()
|
||||
)
|
||||
.overlay(
|
||||
Capsule(style: .continuous)
|
||||
.stroke(Color.white.opacity(0.16), lineWidth: 1)
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user