implemented the UI to render the formatted floating date

This commit is contained in:
Mauro Romito
2026-03-27 17:19:33 +01:00
committed by Mauro
parent e3a8c7f423
commit 96a13f718e
13 changed files with 148 additions and 12 deletions
@@ -33,9 +33,11 @@ struct RoomScreen: View {
.accessibilityIdentifier(A11yIdentifiers.roomScreen.scrollToBottom)
}
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
.topBanner(pinnedItemsBanner, isVisible: context.viewState.shouldShowPinnedEventsBanner && !isVoiceOverEnabled)
// This can overlay on top of the pinnedItemsBanner
.topBanner(knockRequestsBanner, isVisible: context.viewState.shouldSeeKnockRequests)
.topBanners([
TopBannerItem(pinnedItemsBanner, isVisible: context.viewState.shouldShowPinnedEventsBanner && !isVoiceOverEnabled),
// This can overlay on top of the pinnedItemsBanner
TopBannerItem(knockRequestsBanner, isVisible: context.viewState.shouldSeeKnockRequests)
], footer: dateBadge)
.safeAreaInset(edge: .top) {
// When VoiceOver is enabled, the table view isn't reversed and the scroll gestures
// don't trigger meaning the banner never hides itself and so the .overlay layout
@@ -88,6 +90,13 @@ struct RoomScreen: View {
.padding(.top, 16)
}
@ViewBuilder
private var dateBadge: some View {
if timelineContext.viewState.floatingTimelineDateEnabled, !isVoiceOverEnabled {
FloatingDateBadge(dateText: timelineContext.floatingDateText)
}
}
private func dismissKnockRequestsBanner() {
context.send(viewAction: .dismissKnockRequests)
}