Cherry pick some missed Compound/layout changes that ended up in the Xcode 15 PR. (#2120)

Fix broken Settings screen snapshots.
This commit is contained in:
Doug
2023-11-20 11:06:24 +00:00
committed by GitHub
parent fc7b0038bc
commit f2391394a7
15 changed files with 31 additions and 62 deletions
@@ -31,7 +31,7 @@ struct RoomHeaderView: View {
}
// Leading align whilst using the principal toolbar position.
.frame(maxWidth: .infinity, alignment: .leading)
// Using a button stops is from getting truncated in the navigation bar
// Using a button stops it from getting truncated in the navigation bar
.onTapGesture {
context.send(viewAction: .displayRoomDetails)
}
@@ -14,7 +14,7 @@
// limitations under the License.
//
import Foundation
import Compound
import SwiftUI
struct NoticeRoomTimelineView: View, TextBasedRoomTimelineViewProtocol {
@@ -28,16 +28,17 @@ struct NoticeRoomTimelineView: View, TextBasedRoomTimelineViewProtocol {
// Spacing: 6 = label spacing - formatted text padding
HStack(alignment: .firstTextBaseline, spacing: 6.0) {
Image(systemName: "info.bubble").padding(.top, 2.0)
.foregroundColor(.compound.iconSecondary)
Label {
if let attributedString = timelineItem.content.formattedBody {
FormattedBodyText(attributedString: attributedString, additionalWhitespacesCount: timelineItem.additionalWhitespaces(timelineStyle: timelineStyle))
} else {
FormattedBodyText(text: timelineItem.content.body, additionalWhitespacesCount: timelineItem.additionalWhitespaces(timelineStyle: timelineStyle))
}
} icon: {
CompoundIcon(\.info, size: .small, relativeTo: .compound.bodyLG)
.foregroundColor(.compound.iconSecondary)
}
.labelStyle(.custom(spacing: 6.0, alignment: .top))
.padding(.leading, 4) // Trailing padding is provided by FormattedBodyText
}
}
@@ -14,6 +14,7 @@
// limitations under the License.
//
import Compound
import SwiftUI
struct UnsupportedRoomTimelineView: View {
@@ -31,7 +32,7 @@ struct UnsupportedRoomTimelineView: View {
.font(.compound.bodySM)
}
} icon: {
Image(systemName: "exclamationmark.triangle")
CompoundIcon(\.warning, size: .small, relativeTo: .compound.bodyLG)
}
.labelStyle(RoomTimelineViewLabelStyle())
}