//
//  ModalBackgroundView.swift
//  CustomActionSheet
//
//  Created by Garett Breen on 12/17/19.
//  Copyright © 2019 CUWCD. All rights reserved.
//

import SwiftUI

public struct ModalBackgroundView: View {
    let action: () -> Void
    
    public init(action: @escaping () -> Void = {}) {
        self.action = action
    }
    
    public var body: some View {
        Button(action: action) {
            BlurView(style: .dark).frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .center).edgesIgnoringSafeArea(.all)
        }.buttonStyle(PlainButtonStyle())
    }
}

struct ModalBackgroundView_Previews: PreviewProvider {
    static var previews: some View {
        ModalBackgroundView()
    }
}
