Don't require confirmation dialog actions (#85)

We already have this default for `AlertState`, so let's do the same for
`ConfirmationDialogState`.
This commit is contained in:
Stephen Celis 2023-03-05 16:34:15 -08:00 committed by GitHub
parent ff448510c5
commit 92c82d73a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -150,7 +150,7 @@ public struct ConfirmationDialogState<Action>: Identifiable {
public init( public init(
titleVisibility: ConfirmationDialogStateTitleVisibility, titleVisibility: ConfirmationDialogStateTitleVisibility,
title: () -> TextState, title: () -> TextState,
@ButtonStateBuilder<Action> actions: () -> [ButtonState<Action>], @ButtonStateBuilder<Action> actions: () -> [ButtonState<Action>] = { [] },
message: (() -> TextState)? = nil message: (() -> TextState)? = nil
) { ) {
self.init( self.init(
@ -170,7 +170,7 @@ public struct ConfirmationDialogState<Action>: Identifiable {
/// - message: The message for the dialog. /// - message: The message for the dialog.
public init( public init(
title: () -> TextState, title: () -> TextState,
@ButtonStateBuilder<Action> actions: () -> [ButtonState<Action>], @ButtonStateBuilder<Action> actions: () -> [ButtonState<Action>] = { [] },
message: (() -> TextState)? = nil message: (() -> TextState)? = nil
) { ) {
self.init( self.init(
@ -200,8 +200,8 @@ public struct ConfirmationDialogState<Action>: Identifiable {
/// ///
/// See `SwiftUI.Visibility` for more information. /// See `SwiftUI.Visibility` for more information.
public enum ConfirmationDialogStateTitleVisibility { public enum ConfirmationDialogStateTitleVisibility {
/// The element may be visible or hidden depending on the policies of the /// The element may be visible or hidden depending on the policies of the component accepting the
/// component accepting the visibility configuration. /// visibility configuration.
/// ///
/// See `SwiftUI.Visibility.automatic` for more information. /// See `SwiftUI.Visibility.automatic` for more information.
case automatic case automatic