diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift index 3d36593d3..05d6a47a2 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift @@ -58,9 +58,9 @@ struct HomeScreenInviteCell: View { } // MARK: - Private - + private var mainContent: some View { - VStack(alignment: .leading, spacing: 0) { + VStack(alignment: .leading, spacing: 14) { VStack(alignment: .leading, spacing: 0) { HStack(alignment: .firstTextBaseline, spacing: 16) { textualContent @@ -74,12 +74,14 @@ struct HomeScreenInviteCell: View { .fixedSize(horizontal: false, vertical: true) .accessibilityElement(children: .combine) - buttons - .padding(.top, 14) - .padding(.trailing, 22) + ViewThatFits { + HStack(spacing: 12) { buttons } + VStack(spacing: 16) { Group(subviews: buttons) { ForEach($0.reversed()) { $0 } } } + } + .padding(.trailing, 22) } } - + @ViewBuilder private var inviterView: some View { if let inviter = room.inviter, @@ -108,24 +110,23 @@ struct HomeScreenInviteCell: View { .frame(maxWidth: .infinity, alignment: .leading) } + @ViewBuilder private var buttons: some View { - HStack(spacing: 12) { - Button { - context.send(viewAction: .declineInvite(roomIdentifier: room.id)) - } label: { - Text(L10n.actionDecline) - .frame(maxWidth: .infinity) - } - .buttonStyle(.compound(.secondary, size: .medium)) - - Button { - context.send(viewAction: .acceptInvite(roomIdentifier: room.id)) - } label: { - Text(L10n.actionAccept) - .frame(maxWidth: .infinity) - } - .buttonStyle(.compound(.primary, size: .medium)) + Button { + context.send(viewAction: .declineInvite(roomIdentifier: room.id)) + } label: { + Text(L10n.actionDecline) + .frame(maxWidth: .infinity) } + .buttonStyle(.compound(.secondary, size: .medium)) + + Button { + context.send(viewAction: .acceptInvite(roomIdentifier: room.id)) + } label: { + Text(L10n.actionAccept) + .frame(maxWidth: .infinity) + } + .buttonStyle(.compound(.primary, size: .medium)) } private var separator: some View { diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenInviteCell.iPhone-en-GB-0.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenInviteCell.iPhone-en-GB-0.png index a659d00cd..e41e2de76 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenInviteCell.iPhone-en-GB-0.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenInviteCell.iPhone-en-GB-0.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2a3c835d1978ef3109e2d2a84f03687e4b0de9cff6d28330f52607512f8e7da8 -size 233796 +oid sha256:0ca6acfb4136a4147cde767cabae8d53183378d7f79e8b2938205f01c4b48438 +size 230341 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenInviteCell.iPhone-pseudo-0.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenInviteCell.iPhone-pseudo-0.png index 1d588f71a..af67b55b0 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenInviteCell.iPhone-pseudo-0.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/homeScreenInviteCell.iPhone-pseudo-0.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:97615becde0347396e893d0719246775397943f6e906084a2709f190125c1302 -size 311075 +oid sha256:89fe399971214c785ceca3b0208591ad52f14dd50b580797b8751963671cae73 +size 289018