Safari sheet

This commit is contained in:
Lumaa 2024-01-21 13:08:06 +01:00
parent d2bb747bf9
commit 14f08c6c46

View File

@ -39,6 +39,7 @@ public enum SheetDestination: Identifiable {
case welcome case welcome
case mastodonLogin(logged: Binding<Bool>) case mastodonLogin(logged: Binding<Bool>)
case post(content: String = "", replyId: String? = nil) case post(content: String = "", replyId: String? = nil)
case safari(url: URL)
public var id: String { public var id: String {
switch self { switch self {
@ -48,6 +49,8 @@ public enum SheetDestination: Identifiable {
return "login" return "login"
case .post: case .post:
return "post" return "post"
case .safari:
return "safari"
} }
} }
@ -61,6 +64,9 @@ public enum SheetDestination: Identifiable {
case .post: case .post:
return false return false
case .safari:
return false
} }
} }
} }
@ -85,7 +91,7 @@ extension View {
case .appearence: case .appearence:
AppearenceView() AppearenceView()
case .account(let acc): case .account(let acc):
AccountView(account: acc, navigator: navigator) AccountView(account: acc)
case .post(let status): case .post(let status):
PostDetailsView(status: status) PostDetailsView(status: status)
case .about: case .about:
@ -125,6 +131,8 @@ extension View {
case let .mastodonLogin(logged): case let .mastodonLogin(logged):
AddInstanceView(logged: logged) AddInstanceView(logged: logged)
.tint(Color.accentColor) .tint(Color.accentColor)
case let .safari(url):
SfSafariView(url: url)
default: default:
EmptyView() EmptyView()
} }