Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public struct CustomChannelHeader: ToolbarContent {
Image(uiImage: images.messageActionEdit)
.resizable()
.scaledToFit()
.frame(width: 24, height: 24)
.foregroundColor(Color.white)
.padding(.all, 8)
.background(colors.tintColor)
Expand All @@ -41,9 +42,12 @@ public struct CustomChannelHeader: ToolbarContent {
Button {
actionsPopupShown = true
} label: {
StreamLazyImage(url: currentUserController.currentUser?.imageURL)
.accessibilityLabel("Account Actions")
.accessibilityAddTraits(.isButton)
StreamLazyImage(
url: currentUserController.currentUser?.imageURL,
size: CGSize(width: 36, height: 36)
)
.accessibilityLabel("Account Actions")
.accessibilityAddTraits(.isButton)
}
}
}
Expand All @@ -62,13 +66,27 @@ struct CustomChannelModifier: ChannelListHeaderViewModifier {

func body(content: Content) -> some View {
ZStack {
content.toolbar {
CustomChannelHeader(
title: title,
currentUserController: chatClient.currentUserController(),
isNewChatShown: $isNewChatShown,
actionsPopupShown: $actionsPopupShown
)
if #available(iOS 26, *) {
content.toolbar {
CustomChannelHeader(
title: title,
currentUserController: chatClient.currentUserController(),
isNewChatShown: $isNewChatShown,
actionsPopupShown: $actionsPopupShown
)
#if compiler(>=6.2)
.sharedBackgroundVisibility(.hidden)
#endif
}
} else {
content.toolbar {
CustomChannelHeader(
title: title,
currentUserController: chatClient.currentUserController(),
isNewChatShown: $isNewChatShown,
actionsPopupShown: $actionsPopupShown
)
}
}

NavigationLink(isActive: $blockedUsersShown) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,27 @@ public struct DefaultChannelHeaderModifier<Factory: ViewFactory>: ChatChannelHea
}

public func body(content: Content) -> some View {
content.toolbar {
DefaultChatChannelHeader(
factory: factory,
channel: channel,
headerImage: channelHeaderLoader.image(for: channel),
isActive: $isActive
)
if #available(iOS 26, *) {
content.toolbar {
DefaultChatChannelHeader(
factory: factory,
channel: channel,
headerImage: channelHeaderLoader.image(for: channel),
isActive: $isActive
)
#if compiler(>=6.2)
.sharedBackgroundVisibility(.hidden)
#endif
}
} else {
content.toolbar {
DefaultChatChannelHeader(
factory: factory,
channel: channel,
headerImage: channelHeaderLoader.image(for: channel),
isActive: $isActive
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,11 @@ public struct ChatChannelView<Factory: ViewFactory>: View, KeyboardReadable {
}

private var generatingSnapshot: Bool {
tabBarAvailable && messageDisplayInfo != nil && !viewModel.reactionsShown
if #available(iOS 26, *) {
return false
} else {
return tabBarAvailable && messageDisplayInfo != nil && !viewModel.reactionsShown
}
}

private var bottomPadding: CGFloat {
Expand Down
Loading