Added Alert.Button.ok()
This commit is contained in:
parent
89d6ea1002
commit
6100810c16
|
@ -9,4 +9,13 @@ extension View {
|
||||||
.navigationBarTitle("Title")
|
.navigationBarTitle("Title")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extension Alert.Button {
|
||||||
|
|
||||||
|
public static func ok(_ action: (() -> Void)? = {}) -> Alert.Button {
|
||||||
|
return .default(Text("OK"), action: action)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ struct AddAccountDialog: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.alert(item: $errorMessage) { message in
|
.alert(item: $errorMessage) { message in
|
||||||
Alert(title: message.title, message: message.message, dismissButton: Alert.Button.cancel()))
|
Alert(title: message.title, message: message.message, dismissButton: .ok())
|
||||||
}
|
}
|
||||||
.navigationBarTitle(Text("Add account"), displayMode: NavigationBarItem.TitleDisplayMode.inline)
|
.navigationBarTitle(Text("Add account"), displayMode: NavigationBarItem.TitleDisplayMode.inline)
|
||||||
}
|
}
|
||||||
|
@ -84,4 +84,4 @@ struct AddAccountDialog_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
AddAccountDialog()
|
AddAccountDialog()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue