Skip to content

Commit c66791f

Browse files
made injected values private
1 parent b6bd737 commit c66791f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+131
-133
lines changed

Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ public protocol ChatChannelHeaderViewModifier: ViewModifier {
1212

1313
/// The default channel header.
1414
public struct DefaultChatChannelHeader: ToolbarContent {
15-
@Injected(\.fonts) var fonts
16-
@Injected(\.utils) var utils
17-
@Injected(\.colors) var colors
18-
@Injected(\.chatClient) var chatClient
15+
@Injected(\.fonts) private var fonts
16+
@Injected(\.utils) private var utils
17+
@Injected(\.colors) private var colors
18+
@Injected(\.chatClient) private var chatClient
1919

2020
private var channelNamer: ChatChannelNamer {
2121
utils.channelNamer

Sources/StreamChatSwiftUI/ChatChannel/ChatChannelView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import SwiftUI
77

88
/// View for the chat channel.
99
public struct ChatChannelView<Factory: ViewFactory>: View {
10-
@Injected(\.colors) var colors
10+
@Injected(\.colors) private var colors
1111

1212
@StateObject private var viewModel: ChatChannelViewModel
1313

Sources/StreamChatSwiftUI/ChatChannel/ChatChannelViewModel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import StreamChat
88
import SwiftUI
99

1010
public class ChatChannelViewModel: ObservableObject, ChatChannelControllerDelegate {
11-
@Injected(\.chatClient) var chatClient
12-
@Injected(\.utils) var utils
11+
@Injected(\.chatClient) private var chatClient
12+
@Injected(\.utils) private var utils
1313

1414
private var cancellables = Set<AnyCancellable>()
1515
private var lastRefreshThreshold = 200

Sources/StreamChatSwiftUI/ChatChannel/Composer/AddedFileAttachmentsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import SwiftUI
77

88
/// View for an added file displayed in the composer input.
99
public struct AddedFileAttachmentsView: View {
10-
@Injected(\.colors) var colors
10+
@Injected(\.colors) private var colors
1111

1212
var addedFileURLs: [URL]
1313
var onDiscardAttachment: (String) -> Void

Sources/StreamChatSwiftUI/ChatChannel/Composer/AddedImageAttachmentsView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import SwiftUI
66

77
/// View for an added image displayed in the composer input.
88
public struct AddedImageAttachmentsView: View {
9-
@Injected(\.fonts) var fonts
10-
@Injected(\.colors) var colors
9+
@Injected(\.fonts) private var fonts
10+
@Injected(\.colors) private var colors
1111

1212
public var images: [AddedAsset]
1313
public var onDiscardAttachment: (String) -> Void

Sources/StreamChatSwiftUI/ChatChannel/Composer/AttachmentPickerTypeView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public enum AttachmentPickerType {
2626

2727
/// View for picking the attachment type (media or giphy commands).
2828
public struct AttachmentPickerTypeView: View {
29-
@Injected(\.images) var images
30-
@Injected(\.colors) var colors
29+
@Injected(\.images) private var images
30+
@Injected(\.colors) private var colors
3131

3232
@Binding var pickerTypeState: PickerTypeState
3333

@@ -64,8 +64,8 @@ public struct AttachmentPickerTypeView: View {
6464

6565
/// View for the picker type button.
6666
struct PickerTypeButton: View {
67-
@Injected(\.images) var images
68-
@Injected(\.colors) var colors
67+
@Injected(\.images) private var images
68+
@Injected(\.colors) private var colors
6969

7070
@Binding var pickerTypeState: PickerTypeState
7171

Sources/StreamChatSwiftUI/ChatChannel/Composer/AttachmentPickerView.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
//
44

55
import Photos
6-
import SwiftUI
76
import StreamChat
7+
import SwiftUI
88

99
/// View for the attachment picker.
1010
public struct AttachmentPickerView<Factory: ViewFactory>: View {
11-
@Injected(\.colors) var colors
12-
@Injected(\.fonts) var fonts
11+
@Injected(\.colors) private var colors
12+
@Injected(\.fonts) private var fonts
1313

1414
var viewFactory: Factory
1515
@Binding var selectedPickerState: AttachmentPickerState
@@ -77,7 +77,7 @@ public struct AttachmentPickerView<Factory: ViewFactory>: View {
7777

7878
/// View for picking the source of the attachment (photo, files or camera).
7979
struct AttachmentSourcePickerView: View {
80-
@Injected(\.colors) var colors
80+
@Injected(\.colors) private var colors
8181

8282
var selected: AttachmentPickerState
8383
var onTap: (AttachmentPickerState) -> Void
@@ -115,8 +115,7 @@ struct AttachmentSourcePickerView: View {
115115

116116
/// Button used for picking of attachment types.
117117
public struct AttachmentPickerButton: View {
118-
119-
@Injected(\.colors) var colors
118+
@Injected(\.colors) private var colors
120119

121120
var iconName: String
122121
var pickerType: AttachmentPickerState

Sources/StreamChatSwiftUI/ChatChannel/Composer/AttachmentUploadingStateView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import SwiftUI
77

88
/// View used for displaying progress while an asset is being uploaded.
99
struct AttachmentUploadingStateView: View {
10-
@Injected(\.images) var images
11-
@Injected(\.colors) var colors
12-
@Injected(\.fonts) var fonts
10+
@Injected(\.images) private var images
11+
@Injected(\.colors) private var colors
12+
@Injected(\.fonts) private var fonts
1313

1414
var uploadState: AttachmentUploadingState
1515
var url: URL

Sources/StreamChatSwiftUI/ChatChannel/Composer/ComposerHelperViews.swift

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ struct VideoIndicatorView: View {
1818

1919
/// View displaying the duration of the video.
2020
struct VideoDurationIndicatorView: View {
21-
@Injected(\.colors) var colors
22-
@Injected(\.fonts) var fonts
21+
@Injected(\.colors) private var colors
22+
@Injected(\.fonts) private var fonts
2323

2424
var duration: String
2525

@@ -35,8 +35,7 @@ struct VideoDurationIndicatorView: View {
3535

3636
/// Container that displays attachment types.
3737
public struct AttachmentTypeContainer<Content: View>: View {
38-
39-
@Injected(\.colors) var colors
38+
@Injected(\.colors) private var colors
4039

4140
var content: () -> Content
4241

@@ -59,8 +58,8 @@ public struct AttachmentTypeContainer<Content: View>: View {
5958

6059
/// View shown after the native file picker is closed.
6160
struct FilePickerDisplayView: View {
62-
@Injected(\.fonts) var fonts
63-
@Injected(\.colors) var colors
61+
@Injected(\.fonts) private var fonts
62+
@Injected(\.colors) private var colors
6463

6564
@Binding var filePickerShown: Bool
6665
@Binding var addedFileURLs: [URL]
@@ -105,8 +104,8 @@ struct CameraPickerDisplayView: View {
105104

106105
/// View displayed when there's no access permission to the photo library.
107106
struct AssetsAccessPermissionView: View {
108-
@Injected(\.colors) var colors
109-
@Injected(\.fonts) var fonts
107+
@Injected(\.colors) private var colors
108+
@Injected(\.fonts) private var fonts
110109

111110
var body: some View {
112111
VStack(alignment: .center, spacing: 8) {

Sources/StreamChatSwiftUI/ChatChannel/Composer/MessageComposerView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import SwiftUI
77

88
/// Main view for the message composer.
99
public struct MessageComposerView<Factory: ViewFactory>: View, KeyboardReadable {
10-
@Injected(\.colors) var colors
10+
@Injected(\.colors) private var colors
1111

1212
// Initial popup size, before the keyboard is shown.
1313
@State private var popupSize: CGFloat = 350
@@ -91,7 +91,7 @@ public struct MessageComposerView<Factory: ViewFactory>: View, KeyboardReadable
9191

9292
/// View for the composer's input (text and media).
9393
public struct ComposerInputView<Factory: ViewFactory>: View {
94-
@Injected(\.colors) var colors
94+
@Injected(\.colors) private var colors
9595

9696
var factory: Factory
9797
@Binding var text: String

0 commit comments

Comments
 (0)