mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Stop reserving space for the non-existant icon background in ListRowLabel on iOS 26. (#5822)
* Stop reserving space for the non-existant icon background in ListRowLabel on iOS 26. * Use the .avatar label style for NotificationSettingsEditScreenRoomCell.
This commit is contained in:
@@ -146,9 +146,7 @@ enum RoomAvatarSizeOnScreen {
|
||||
|
||||
var value: CGFloat {
|
||||
switch self {
|
||||
case .notificationSettings:
|
||||
30
|
||||
case .timeline, .leaveSpace, .roomDirectorySearch,
|
||||
case .timeline, .leaveSpace, .notificationSettings, .roomDirectorySearch,
|
||||
.completionSuggestions, .authorizedSpaces, .createRoomSelectSpace,
|
||||
.spaceFilters, .globalSearch:
|
||||
32
|
||||
|
||||
+14
-7
@@ -16,7 +16,7 @@ struct NotificationSettingsEditScreenRoomCell: View {
|
||||
let context: NotificationSettingsEditScreenViewModel.Context
|
||||
|
||||
var body: some View {
|
||||
ListRow(label: .action(title: room.name,
|
||||
ListRow(label: .avatar(title: room.name,
|
||||
icon: avatar),
|
||||
details: roomDetailsLabel,
|
||||
kind: .navigationLink {
|
||||
@@ -47,7 +47,18 @@ struct NotificationSettingsEditScreenRoomCell: View {
|
||||
}
|
||||
|
||||
struct NotificationSettingsEditScreenRoomCell_Previews: PreviewProvider, TestablePreview {
|
||||
static let (rooms, viewModel) = makeRooms()
|
||||
|
||||
static var previews: some View {
|
||||
Form {
|
||||
ForEach(rooms) { room in
|
||||
NotificationSettingsEditScreenRoomCell(room: room, context: viewModel.context)
|
||||
}
|
||||
}
|
||||
.compoundList()
|
||||
}
|
||||
|
||||
private static func makeRooms() -> ([NotificationSettingsEditScreenRoom], NotificationSettingsEditScreenViewModel) {
|
||||
let summaryProvider = RoomSummaryProviderMock(.init(state: .loaded(.mockRooms)))
|
||||
|
||||
let notificationSettingsProxy = NotificationSettingsProxyMock(with: .init())
|
||||
@@ -59,17 +70,13 @@ struct NotificationSettingsEditScreenRoomCell_Previews: PreviewProvider, Testabl
|
||||
let viewModel = NotificationSettingsEditScreenViewModel(chatType: .groupChat,
|
||||
userSession: userSession)
|
||||
|
||||
let rooms: [NotificationSettingsEditScreenRoom] = summaryProvider.roomListPublisher.value.compactMap { summary -> NotificationSettingsEditScreenRoom? in
|
||||
let rooms = summaryProvider.roomListPublisher.value.map { summary in
|
||||
NotificationSettingsEditScreenRoom(id: UUID().uuidString,
|
||||
roomId: summary.id,
|
||||
name: summary.name,
|
||||
avatar: summary.avatar)
|
||||
}
|
||||
|
||||
return VStack(spacing: 0) {
|
||||
ForEach(rooms) { room in
|
||||
NotificationSettingsEditScreenRoomCell(room: room, context: viewModel.context)
|
||||
}
|
||||
}
|
||||
return (rooms, viewModel)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user