mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:06:00 +00:00
SwiftUI NavigationController and UserNotificationControllers (#309)
* Fixes #286 - Adopted the new SwiftUI NavigationStack based NavigationController throughout the application * Fixes #315 - Implemented new user notification components on top of SwiftUI and the new navigation flows * Add home screen fade animation between skeletons and real rooms * Bump the danger-swift version used on the CI and swiftlint with it * Renamed Splash to Onboarding, Empty to Splash
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
|
||||
public extension Animation {
|
||||
/// Animation to be used to disable animations.
|
||||
static let noAnimation: Animation = .linear(duration: 0)
|
||||
@@ -28,7 +27,6 @@ public extension Animation {
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
|
||||
/// Returns the result of recomputing the view's body with the provided
|
||||
/// animation.
|
||||
/// - Parameters:
|
||||
|
||||
@@ -31,9 +31,14 @@ struct AlertInfo<T: Hashable>: Identifiable {
|
||||
/// The alert's message (optional).
|
||||
var message: String?
|
||||
/// The alert's primary button title and action. Defaults to an Ok button with no action.
|
||||
var primaryButton: (title: String, action: (() -> Void)?) = (ElementL10n.ok, nil)
|
||||
var primaryButton = AlertButton(title: ElementL10n.ok, action: nil)
|
||||
/// The alert's secondary button title and action.
|
||||
var secondaryButton: (title: String, action: (() -> Void)?)?
|
||||
var secondaryButton: AlertButton?
|
||||
}
|
||||
|
||||
struct AlertButton {
|
||||
let title: String
|
||||
let action: (() -> Void)?
|
||||
}
|
||||
|
||||
extension AlertInfo {
|
||||
@@ -79,7 +84,7 @@ extension AlertInfo {
|
||||
}
|
||||
}
|
||||
|
||||
private func alertButton(for buttonParameters: (title: String, action: (() -> Void)?)) -> Alert.Button {
|
||||
private func alertButton(for buttonParameters: AlertButton) -> Alert.Button {
|
||||
guard let action = buttonParameters.action else {
|
||||
return .default(Text(buttonParameters.title))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user