mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
Use a plain view for reactions instead of a TabView. (#3328)
We don't use any of the TabView features and it shows a tab bar at the bottom when the list is long.
This commit is contained in:
parent
6faa26eade
commit
864bd23d35
@ -13,6 +13,9 @@ struct ReactionsSummaryView: View {
|
||||
let mediaProvider: MediaProviderProtocol?
|
||||
|
||||
@State var selectedReactionKey: String
|
||||
private var selectedReaction: AggregatedReaction? {
|
||||
reactions.first { $0.key == selectedReactionKey }
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
@ -49,19 +52,17 @@ struct ReactionsSummaryView: View {
|
||||
.padding(.bottom, 12)
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var sendersList: some View {
|
||||
TabView(selection: $selectedReactionKey) {
|
||||
ForEach(reactions) { reaction in
|
||||
ScrollView {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
ForEach(reaction.senders) { sender in
|
||||
ReactionSummarySenderView(sender: sender, member: members[sender.id], mediaProvider: mediaProvider)
|
||||
.padding(.horizontal, 16)
|
||||
}
|
||||
if let selectedReaction {
|
||||
ScrollView {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
ForEach(selectedReaction.senders) { sender in
|
||||
ReactionSummarySenderView(sender: sender, member: members[sender.id], mediaProvider: mediaProvider)
|
||||
.padding(.horizontal, 16)
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
.tag(reaction.key)
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
BIN
PreviewTests/Sources/__Snapshots__/PreviewTests/test_reactionsSummaryView-iPad-en-GB.1.png
(Stored with Git LFS)
BIN
PreviewTests/Sources/__Snapshots__/PreviewTests/test_reactionsSummaryView-iPad-en-GB.1.png
(Stored with Git LFS)
Binary file not shown.
BIN
PreviewTests/Sources/__Snapshots__/PreviewTests/test_reactionsSummaryView-iPad-pseudo.1.png
(Stored with Git LFS)
BIN
PreviewTests/Sources/__Snapshots__/PreviewTests/test_reactionsSummaryView-iPad-pseudo.1.png
(Stored with Git LFS)
Binary file not shown.
BIN
PreviewTests/Sources/__Snapshots__/PreviewTests/test_reactionsSummaryView-iPhone-16-en-GB.1.png
(Stored with Git LFS)
BIN
PreviewTests/Sources/__Snapshots__/PreviewTests/test_reactionsSummaryView-iPhone-16-en-GB.1.png
(Stored with Git LFS)
Binary file not shown.
BIN
PreviewTests/Sources/__Snapshots__/PreviewTests/test_reactionsSummaryView-iPhone-16-pseudo.1.png
(Stored with Git LFS)
BIN
PreviewTests/Sources/__Snapshots__/PreviewTests/test_reactionsSummaryView-iPhone-16-pseudo.1.png
(Stored with Git LFS)
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user