Skip to content

Commit

Permalink
refactor: Remove useless code -> DisplayedFloatingPanelState
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeWeidmann committed Apr 27, 2023
1 parent 341dc27 commit 5747102
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
17 changes: 0 additions & 17 deletions Mail/Utils/FloatingPanelHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,6 @@ import MailResources
import SwiftUI
import SwiftUIBackports

class DisplayedFloatingPanelState<State>: ObservableObject {
@Published var isOpen = false
@Published private(set) var state: State?

init() {}

func open(state: State) {
self.state = state
isOpen = true
}

func close() {
state = nil
isOpen = false
}
}

extension View {
func floatingPanel<Content: View>(isPresented: Binding<Bool>,
@ViewBuilder content: @escaping () -> Content) -> some View {
Expand Down
1 change: 1 addition & 0 deletions Mail/Views/Bottom sheets/Actions/ActionsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ enum ActionsTarget: Equatable, Identifiable {
private let messageReply: Binding<MessageReply?>?
private let reportJunkActionsTarget: Binding<ActionsTarget?>?
private let reportedForPhishingMessage: Binding<Message?>?
private let reportedForDisplayProblemMessage: Binding<Message?>?
private let completionHandler: (() -> Void)?

private let matomoCategory: MatomoUtils.EventCategory?
Expand Down
7 changes: 0 additions & 7 deletions Mail/Views/Thread/ThreadView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ private struct ScrollOffsetPreferenceKey: PreferenceKey {
}
}

class MessageBottomSheet: DisplayedFloatingPanelState<MessageBottomSheet.State> {
enum State: Equatable {
case contact(Recipient, isRemote: Bool)
case replyOption(Message, isThread: Bool)
}
}

struct ThreadView: View {
@EnvironmentObject private var splitViewManager: SplitViewManager
@EnvironmentObject private var mailboxManager: MailboxManager
Expand Down

0 comments on commit 5747102

Please sign in to comment.