mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Run SwiftFormat.
This commit is contained in:
@@ -23,7 +23,7 @@ extension View {
|
||||
})
|
||||
return alert(item.wrappedValue?.title ?? "", isPresented: binding, presenting: item.wrappedValue, actions: actions, message: message)
|
||||
}
|
||||
|
||||
|
||||
// periphery: ignore - not used yet but might be useful
|
||||
func alert<Item: AlertProtocol, Actions: View>(item: Binding<Item?>, @ViewBuilder actions: (Item) -> Actions) -> some View {
|
||||
let binding = Binding<Bool>(get: {
|
||||
@@ -51,7 +51,7 @@ struct AlertInfo<T: Hashable>: Identifiable, AlertProtocol {
|
||||
var role: ButtonRole?
|
||||
let action: (() -> Void)?
|
||||
}
|
||||
|
||||
|
||||
struct AlertTextField: Identifiable {
|
||||
let id = UUID()
|
||||
let placeholder: String
|
||||
@@ -59,7 +59,7 @@ struct AlertInfo<T: Hashable>: Identifiable, AlertProtocol {
|
||||
let autoCapitalization: TextInputAutocapitalization
|
||||
let autoCorrectionDisabled: Bool
|
||||
}
|
||||
|
||||
|
||||
/// An identifier that can be used to distinguish one error from another.
|
||||
let id: T
|
||||
/// The alert's title.
|
||||
@@ -86,7 +86,7 @@ extension AlertInfo {
|
||||
title = L10n.commonError
|
||||
message = L10n.errorUnknown
|
||||
}
|
||||
|
||||
|
||||
// periphery: ignore - might be useful in the future
|
||||
/// Initialises the type with the title from an `Error`'s localised description along with the default Ok button.
|
||||
///
|
||||
@@ -109,7 +109,7 @@ extension View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if let textFields = item.textFields {
|
||||
VStack(spacing: 24) {
|
||||
ForEach(textFields) { textField in
|
||||
@@ -119,12 +119,12 @@ extension View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Button(item.primaryButton.title, role: item.primaryButton.role) {
|
||||
item.primaryButton.action?()
|
||||
}
|
||||
.accessibilityIdentifier(A11yIdentifiers.alertInfo.primaryButton)
|
||||
|
||||
|
||||
if let secondaryButton = item.secondaryButton {
|
||||
Button(secondaryButton.title, role: secondaryButton.role) {
|
||||
secondaryButton.action?()
|
||||
|
||||
Reference in New Issue
Block a user