Skip to content

Commit 43156c5

Browse files
committed
updated preview tests
1 parent 7922bf7 commit 43156c5

File tree

45 files changed

+102
-89
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+102
-89
lines changed

ElementX/Sources/Screens/Timeline/View/Style/TimelineItemSendInfoLabel.swift

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ private extension TimelineItemSendInfo {
168168
case is TextBasedRoomTimelineItem:
169169
.overlay(capsuleStyle: false)
170170
case let liveLocationTimelineItem as LiveLocationRoomTimelineItem:
171-
// swiftlint:disable:next void_function_in_ternary
172-
liveLocationTimelineItem.isOutgoing ? .hidden : liveLocationTimelineItem.content.lastLocation?.geoURI != nil ? .overlay(capsuleStyle: true) : .horizontal()
171+
liveLocationTimelineItem.layout
173172
case let message as EventBasedMessageTimelineItemProtocol:
174173
switch message {
175174
case is ImageRoomTimelineItem, is VideoRoomTimelineItem:
@@ -192,6 +191,20 @@ private extension TimelineItemSendInfo {
192191
}
193192
}
194193

194+
private extension LiveLocationRoomTimelineItem {
195+
var layout: TimelineItemSendInfo.LayoutType {
196+
if content.lastLocation != nil {
197+
if content.isLive, isOutgoing {
198+
.hidden
199+
} else {
200+
.overlay(capsuleStyle: true)
201+
}
202+
} else {
203+
.horizontal()
204+
}
205+
}
206+
}
207+
195208
@MainActor
196209
private extension EncryptionAuthenticity {
197210
var foregroundStyle: SwiftUI.Color {

ElementX/Sources/Screens/Timeline/View/TimelineItemViews/LiveLocationRoomTimelineView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ struct LiveLocationRoomTimelineView: View {
128128

129129
Spacer()
130130

131-
if timelineItem.isOutgoing {
131+
if timelineItem.content.isLive, timelineItem.isOutgoing {
132132
Button { } label: {
133133
CompoundIcon(\.stop, size: .small, relativeTo: .compound.bodySMSemibold)
134134
.foregroundStyle(.compound.iconOnSolidPrimary)
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)