Action history is logged and displayed to the user's library. These are triggered whenever the magnet choice sheet is displayed. Also redo alerts and action sheets to avoid deprecation notices for >iOS 14. These will be removed when iOS 14 support is dropped. There was also a problem with sheet presentation not working after a sheet was dismissed. Disable the appropriate view when a sheet is being presented. Signed-off-by: kingbri <bdashore3@proton.me>
21 lines
478 B
Swift
21 lines
478 B
Swift
//
|
|
// DisabledAppearance.swift
|
|
// Ferrite
|
|
//
|
|
// Created by Brian Dashore on 9/10/22.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct DisabledAppearance: ViewModifier {
|
|
let disabled: Bool
|
|
let dimmedOpacity: Double?
|
|
let animation: Animation?
|
|
|
|
func body(content: Content) -> some View {
|
|
content
|
|
.disabled(disabled)
|
|
.opacity(disabled ? dimmedOpacity.map { $0 } ?? 0.5 : 1)
|
|
.animation(animation.map { $0 } ?? .none, value: disabled)
|
|
}
|
|
}
|