Skip to content

Commit

Permalink
refactor: Remove useless code SheetView
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeWeidmann committed Apr 20, 2023
1 parent 5fe7553 commit f8ca2f4
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions Mail/Views/SheetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,9 @@ import MailResources
import SwiftUI

struct SheetView<Content>: View where Content: View {
@StateObject private var alert = GlobalAlert()

@Environment(\.dismiss) private var dismiss

let content: Content

init(@ViewBuilder _ content: () -> Content) {
self.content = content()
}
@ViewBuilder let content: Content

var body: some View {
NavigationView {
Expand All @@ -40,21 +34,9 @@ struct SheetView<Content>: View where Content: View {
Label(MailResourcesStrings.Localizable.buttonClose, systemImage: "xmark")
})
}
.customAlert(isPresented: $alert.isShowing) {
switch alert.state {
case let .reportPhishing(message):
ReportPhishingView(message: message)
case let .reportDisplayProblem(message):
ReportDisplayProblemView(message: message)
case .none:
EmptyView()
}
}
.defaultAppStorage(.shared)
.onReceive(NotificationCenter.default.publisher(for: Constants.dismissMoveSheetNotificationName)) { _ in
dismiss()
}
.environmentObject(alert)
}
}

Expand Down

0 comments on commit f8ca2f4

Please sign in to comment.