From a23b156f7ac3bc2ebd0eebe2ac72852f5c961faa Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 13 Oct 2022 08:42:00 -0300 Subject: [PATCH] Fix navbar theme in share extension (#6678) --- .../xcschemes/MattermostShare.xcscheme | 96 +++++++++++++++++++ ios/MattermostShare/Views/InitialView.swift | 13 ++- 2 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 ios/Mattermost.xcodeproj/xcshareddata/xcschemes/MattermostShare.xcscheme diff --git a/ios/Mattermost.xcodeproj/xcshareddata/xcschemes/MattermostShare.xcscheme b/ios/Mattermost.xcodeproj/xcshareddata/xcschemes/MattermostShare.xcscheme new file mode 100644 index 0000000000..e60dbd9828 --- /dev/null +++ b/ios/Mattermost.xcodeproj/xcshareddata/xcschemes/MattermostShare.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/MattermostShare/Views/InitialView.swift b/ios/MattermostShare/Views/InitialView.swift index 4b00d2b0db..7b075d7bc7 100644 --- a/ios/MattermostShare/Views/InitialView.swift +++ b/ios/MattermostShare/Views/InitialView.swift @@ -23,17 +23,24 @@ struct InitialView: View { shareViewModel.allServers.allSatisfy({!$0.hasChannels}) } - var body: some View { + init(attachments: Binding<[AttachmentModel]>, + linkPreviewUrl: Binding, + message: Binding + ) { let appearance = UINavigationBarAppearance() appearance.configureWithTransparentBackground() appearance.titleTextAttributes = [.foregroundColor: UIColor(.white), .font: UIFont(name: "Metropolis-SemiBold", size: 18) as Any] appearance.backgroundColor = UIColor(Color.theme.sidebarBg) UINavigationBar.appearance().standardAppearance = appearance - UINavigationBar.appearance().compactAppearance = appearance UINavigationBar.appearance().scrollEdgeAppearance = appearance UINavigationBar.appearance().tintColor = UIColor(Color.theme.sidebarText) - + self._attachments = attachments + self._linkPreviewUrl = linkPreviewUrl + self._message = message + } + + var body: some View { return VStack { if noServers { NoServersView()