Skip to content

Commit

Permalink
Fix double back button (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
rlepinski authored Oct 3, 2024
1 parent 1c0655e commit f28cad2
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions ios/AirshipFrameworkProxy/DefaultMessageCenterUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,6 @@ public class DefaultMessageCenterUI {
let theme = theme ?? MessageCenterTheme()
let viewController = HostingViewController(
rootView: StandaloneMessageView(
dismissAction: {
cancellable.cancel()

},
content: {
MessageCenterMessageView(
messageID: messageID,
Expand Down Expand Up @@ -147,30 +143,11 @@ struct StandaloneMessageView<Content: View>: View {
@Environment(\.airshipMessageCenterTheme)
private var theme

let dismissAction: () -> Void

@ViewBuilder
private func makeBackButton() -> some View {
Button(action: {
self.dismissAction()
}) {
Image(systemName: "chevron.backward")
.scaleEffect(0.68)
.font(Font.title.weight(.medium))
.foregroundColor(theme.backButtonColor)
}
}

let content: () -> Content

@ViewBuilder
func makeContent() -> some View {
let content = content()
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
makeBackButton()
}
}
if #available(iOS 16.0, *) {
NavigationStack {
content
Expand Down

0 comments on commit f28cad2

Please sign in to comment.