mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-26 02:01:02 +00:00
Retire SheetDestinations for now
This commit is contained in:
parent
1a85fa19f8
commit
66e314c2be
4 changed files with 11 additions and 30 deletions
|
@ -24,8 +24,8 @@ extension View {
|
|||
func withSheetDestinations(sheetDestinations: Binding<SheetDestinations?>) -> some View {
|
||||
self.sheet(item: sheetDestinations) { destination in
|
||||
switch destination {
|
||||
case let .imageDetail(url):
|
||||
ImageSheetView(url: url)
|
||||
default:
|
||||
EmptyView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import DesignSystem
|
|||
import Env
|
||||
|
||||
struct AccountDetailHeaderView: View {
|
||||
@EnvironmentObject private var quickLook: QuickLook
|
||||
@EnvironmentObject private var routeurPath: RouterPath
|
||||
@Environment(\.redactionReasons) private var reasons
|
||||
|
||||
|
@ -57,7 +58,9 @@ struct AccountDetailHeaderView: View {
|
|||
.offset(y: scrollOffset > 0 ? -scrollOffset : 0)
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
routeurPath.presentedSheet = .imageDetail(url: account.header)
|
||||
Task {
|
||||
await quickLook.prepareFor(urls: [account.header], selectedURL: account.header)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,7 +85,9 @@ struct AccountDetailHeaderView: View {
|
|||
)
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
routeurPath.presentedSheet = .imageDetail(url: account.avatar)
|
||||
Task {
|
||||
await quickLook.prepareFor(urls: [account.avatar], selectedURL: account.avatar)
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
Group {
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
import SwiftUI
|
||||
|
||||
public struct ImageSheetView: View {
|
||||
let url: URL
|
||||
|
||||
public init(url: URL) {
|
||||
self.url = url
|
||||
}
|
||||
|
||||
public var body: some View {
|
||||
AsyncImage(
|
||||
url: url,
|
||||
content: { image in
|
||||
image.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
},
|
||||
placeholder: {
|
||||
ProgressView()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
|
@ -12,12 +12,10 @@ public enum RouteurDestinations: Hashable {
|
|||
public enum SheetDestinations: Identifiable {
|
||||
public var id: String {
|
||||
switch self {
|
||||
case .imageDetail:
|
||||
return "imageDetail"
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
case imageDetail(url: URL)
|
||||
}
|
||||
|
||||
public class RouterPath: ObservableObject {
|
||||
|
|
Loading…
Reference in a new issue