Skip to content

Commit

Permalink
Exposed ChatChannelInfoButton and ChatInfoOptionsView as public
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmitrevski committed Mar 16, 2023
1 parent cbbb394 commit c5a9ab9
Showing 1 changed file with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import StreamChat
import SwiftUI

struct ChatChannelInfoButton: View {
public struct ChatChannelInfoButton: View {

@Injected(\.colors) private var colors
@Injected(\.fonts) private var fonts
Expand All @@ -14,8 +14,15 @@ struct ChatChannelInfoButton: View {
var iconName: String
var foregroundColor: Color
var buttonTapped: () -> Void

var body: some View {

public init(title: String, iconName: String, foregroundColor: Color, buttonTapped: @escaping () -> Void) {
self.title = title
self.iconName = iconName
self.foregroundColor = foregroundColor
self.buttonTapped = buttonTapped
}

public var body: some View {
Button {
buttonTapped()
} label: {
Expand Down Expand Up @@ -43,15 +50,19 @@ struct ChannelInfoDivider: View {
}
}

struct ChatInfoOptionsView: View {

public struct ChatInfoOptionsView: View {
@Injected(\.images) private var images
@Injected(\.colors) private var colors
@Injected(\.fonts) private var fonts

@StateObject var viewModel: ChatChannelInfoViewModel

public init(viewModel: ChatChannelInfoViewModel) {
_viewModel = StateObject(wrappedValue: viewModel)
}

var body: some View {
public var body: some View {
VStack(spacing: 0) {
if !viewModel.channel.isDirectMessageChannel {
ChannelNameUpdateView(viewModel: viewModel)
Expand Down

0 comments on commit c5a9ab9

Please sign in to comment.