mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Add mechanism for opening up a threaded timeline
This commit is contained in:
committed by
Stefan Ceriu
parent
2f938d3cbf
commit
10fb2b5dda
@@ -120,7 +120,7 @@ struct TimelineItemBubbledStylerView<Content: View>: View {
|
||||
.onTapGesture { }
|
||||
}
|
||||
|
||||
if let threadSummary = timelineItem.properties.threadSummary {
|
||||
if context.viewState.timelineKind != .thread, let threadSummary = timelineItem.properties.threadSummary {
|
||||
TimelineThreadSummaryView(threadSummary: threadSummary) {
|
||||
context.send(viewAction: .displayThread(itemID: timelineItem.id))
|
||||
}
|
||||
@@ -177,13 +177,13 @@ struct TimelineItemBubbledStylerView<Content: View>: View {
|
||||
@ViewBuilder
|
||||
var contentWithReply: some View {
|
||||
TimelineBubbleLayout(spacing: 8) {
|
||||
if timelineItem.properties.isThreaded {
|
||||
if context.viewState.timelineKind != .thread, timelineItem.properties.isThreaded {
|
||||
ThreadDecorator()
|
||||
.padding(.leading, 4)
|
||||
.layoutPriority(TimelineBubbleLayout.Priority.regularText)
|
||||
}
|
||||
|
||||
if let replyDetails = timelineItem.properties.replyDetails {
|
||||
if shouldShowReplyDetails, let replyDetails = timelineItem.properties.replyDetails {
|
||||
// The rendered reply bubble with a greedy width. The custom layout prevents
|
||||
// the infinite width from increasing the overall width of the view.
|
||||
|
||||
@@ -212,6 +212,10 @@ struct TimelineItemBubbledStylerView<Content: View>: View {
|
||||
}
|
||||
}
|
||||
|
||||
private var shouldShowReplyDetails: Bool {
|
||||
!timelineItem.properties.isThreaded || (timelineItem.properties.isThreaded && context.viewState.timelineKind != .thread)
|
||||
}
|
||||
|
||||
private var messageBubbleTopPadding: CGFloat {
|
||||
guard timelineItem.isOutgoing || isDirectOneToOneRoom else { return 0 }
|
||||
return timelineGroupStyle == .single || timelineGroupStyle == .first ? 8 : 0
|
||||
|
||||
Reference in New Issue
Block a user