Configure the media preview screen based on the event and presentation. (#3604)

* Configure media previews based on the presenting screen.

* Switch on TimelineKind instead of having an isPinnedEventsTimeline Bool.
This commit is contained in:
Doug
2024-12-11 15:40:31 +00:00
committed by GitHub
parent 9856e3e5b4
commit c827ab9165
35 changed files with 334 additions and 242 deletions
@@ -20,7 +20,7 @@ struct TimelineItemBubbledStylerView<Content: View>: View {
private var isEncryptedOneToOneRoom: Bool { context.viewState.isEncryptedOneToOneRoom }
private var isFocussed: Bool { focussedEventID != nil && timelineItem.id.eventID == focussedEventID }
private var isPinned: Bool {
guard !context.viewState.isPinnedEventsTimeline,
guard context.viewState.timelineKind != .pinned,
let eventID = timelineItem.id.eventID else {
return false
}
@@ -110,7 +110,7 @@ struct TimelineItemBubbledStylerView<Content: View>: View {
}
// Do not display reactions in the pinned events timeline
if !context.viewState.isPinnedEventsTimeline,
if context.viewState.timelineKind != .pinned,
!timelineItem.properties.reactions.isEmpty {
TimelineReactionsView(context: context,
itemID: timelineItem.id,
@@ -150,7 +150,7 @@ struct TimelineItemBubbledStylerView<Content: View>: View {
isDM: context.viewState.isEncryptedOneToOneRoom,
isViewSourceEnabled: context.viewState.isViewSourceEnabled,
isCreateMediaCaptionsEnabled: context.viewState.isCreateMediaCaptionsEnabled,
isPinnedEventsTimeline: context.viewState.isPinnedEventsTimeline,
timelineKind: context.viewState.timelineKind,
emojiProvider: context.viewState.emojiProvider)
TimelineItemMacContextMenu(item: timelineItem, actionProvider: provider) { action in
context.send(viewAction: .handleTimelineItemMenuAction(itemID: timelineItem.id, action: action))