@@ -33,6 +33,7 @@ struct ChannelInfoSheet: View {
3333 @State private var discoveredNewRegions : [ String ] = [ ]
3434 @State private var showingDiscoveryResults = false
3535 @State private var selectedFloodScope : ChannelFloodScope
36+ @State private var headerHeight : CGFloat = 150
3637
3738 init ( channel: ChannelDTO , onClearMessages: @escaping ( ) -> Void , onDelete: @escaping ( ) -> Void ) {
3839 self . channel = channel
@@ -47,12 +48,12 @@ struct ChannelInfoSheet: View {
4748 NavigationStack {
4849 Form {
4950 // Channel Header Section
50- ChannelInfoHeaderSection ( channel: channel)
51+ ChannelInfoHeaderSection ( channel: channel, measuredHeight : $headerHeight )
5152
5253 // Quick Actions Section
5354 ConversationQuickActionsSection (
54- notificationLevel: $notificationLevel,
5555 isFavorite: $isFavorite,
56+ notificationLevel: $notificationLevel,
5657 availableLevels: NotificationLevel . channelLevels
5758 )
5859 . onChange ( of: notificationLevel) { _, newValue in
@@ -122,10 +123,11 @@ struct ChannelInfoSheet: View {
122123 )
123124 }
124125 . themedCanvas ( theme)
125- . navigationTitle ( L10n . Chats. Chats. ChannelInfo. title)
126126 . navigationBarTitleDisplayMode ( . inline)
127+ . scrollRevealNavigationTitle ( channel. displayName, revealAfter: headerHeight)
128+ . contentMargins ( . top, 0 , for: . scrollContent)
127129 . toolbar {
128- ToolbarItem ( placement: . cancellationAction ) {
130+ ToolbarItem ( placement: . confirmationAction ) {
129131 Button ( L10n . Chats. Chats. Common. done) {
130132 dismiss ( )
131133 }
@@ -353,6 +355,7 @@ struct ChannelInfoSheet: View {
353355
354356private struct ChannelInfoHeaderSection : View {
355357 let channel : ChannelDTO
358+ @Binding var measuredHeight : CGFloat
356359
357360 private var channelTypeLabel : String {
358361 if channel. isPublicChannel {
@@ -366,11 +369,10 @@ private struct ChannelInfoHeaderSection: View {
366369
367370 var body : some View {
368371 Section {
369- HStack {
370- Spacer ( )
371- VStack ( spacing: 12 ) {
372- ChannelAvatar ( channel: channel, size: 80 )
372+ VStack ( spacing: 12 ) {
373+ ChannelAvatar ( channel: channel, size: 150 )
373374
375+ VStack ( spacing: 4 ) {
374376 Text ( channel. displayName)
375377 . font ( . title2)
376378 . bold ( )
@@ -379,8 +381,9 @@ private struct ChannelInfoHeaderSection: View {
379381 . font ( . subheadline)
380382 . foregroundStyle ( . secondary)
381383 }
382- Spacer ( )
383384 }
385+ . frame ( maxWidth: . infinity)
386+ . scrollRevealHeaderHeight ( into: $measuredHeight)
384387 . listRowBackground ( Color . clear)
385388 }
386389 }
@@ -474,33 +477,28 @@ private struct ChannelInfoActionsSection: View {
474477
475478 var body : some View {
476479 Section {
477- Button {
480+ Button ( role : . destructive ) {
478481 showingClearMessagesConfirmation = true
479482 } label: {
480483 HStack {
481- Spacer ( )
484+ Label ( L10n . Chats . Chats . ChannelInfo . clearMessagesButton , systemImage : " xmark.circle " )
482485 if isClearingMessages {
486+ Spacer ( )
483487 ProgressView ( )
484- } else {
485- Label ( L10n . Chats. Chats. ChannelInfo. clearMessagesButton, systemImage: " xmark.circle " )
486488 }
487- Spacer ( )
488489 }
489490 }
490491 . disabled ( isActionInProgress)
491- . alignmentGuide ( . listRowSeparatorLeading) { _ in 0 }
492492
493493 Button ( role: . destructive) {
494494 showingDeleteConfirmation = true
495495 } label: {
496496 HStack {
497- Spacer ( )
497+ Label ( L10n . Chats . Chats . ChannelInfo . deleteButton , systemImage : " trash " )
498498 if isDeleting {
499+ Spacer ( )
499500 ProgressView ( )
500- } else {
501- Label ( L10n . Chats. Chats. ChannelInfo. deleteButton, systemImage: " trash " )
502501 }
503- Spacer ( )
504502 }
505503 }
506504 . disabled ( isActionInProgress)
0 commit comments