mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-03-22 01:19:29 +01:00
28 lines
600 B
Swift
Executable File
28 lines
600 B
Swift
Executable File
import SwiftUI
|
|
|
|
struct ModalDimmingView : View {
|
|
|
|
@EnvironmentObject var store: Store<TodoState>
|
|
|
|
var body: some View {
|
|
Color
|
|
.black
|
|
.relativeWidth(1.0)
|
|
.relativeHeight(1.0)
|
|
.opacity(0.3)
|
|
.edgesIgnoringSafeArea([.bottom, .top])
|
|
.transition(.opacity)
|
|
.tapAction {
|
|
self.store.dispatch(event: .cancelCreatingItem)
|
|
}
|
|
}
|
|
}
|
|
|
|
#if DEBUG
|
|
struct ModalDimmingView_Previews : PreviewProvider {
|
|
static var previews: some View {
|
|
ModalDimmingView()
|
|
}
|
|
}
|
|
#endif
|