Layout fix & tweak

This commit is contained in:
Thomas Ricouard 2023-12-28 07:55:17 +01:00
parent aa41f24de9
commit e0563122a7
2 changed files with 7 additions and 11 deletions

View file

@ -16,7 +16,6 @@ public struct StatusRowView: View {
@Environment(\.accessibilityVoiceOverEnabled) private var accessibilityVoiceOverEnabled @Environment(\.accessibilityVoiceOverEnabled) private var accessibilityVoiceOverEnabled
@Environment(\.isStatusFocused) private var isFocused @Environment(\.isStatusFocused) private var isFocused
@Environment(\.indentationLevel) private var indentationLevel @Environment(\.indentationLevel) private var indentationLevel
@Environment(\.isHomeTimeline) private var isHomeTimeline
@Environment(QuickLook.self) private var quickLook @Environment(QuickLook.self) private var quickLook
@Environment(Theme.self) private var theme @Environment(Theme.self) private var theme
@ -57,12 +56,13 @@ public struct StatusRowView: View {
EmptyView() EmptyView()
} }
} else { } else {
if !isCompact, theme.avatarPosition == .leading { if !isCompact {
Group { Group {
StatusRowTagView(viewModel: viewModel)
StatusRowReblogView(viewModel: viewModel) StatusRowReblogView(viewModel: viewModel)
StatusRowReplyView(viewModel: viewModel) StatusRowReplyView(viewModel: viewModel)
} }
.padding(.leading, AvatarView.FrameConfig.status.width + .statusColumnsSpacing) .padding(.leading, theme.avatarPosition == .top ? 0 : AvatarView.FrameConfig.status.width + .statusColumnsSpacing)
} }
HStack(alignment: .top, spacing: .statusColumnsSpacing) { HStack(alignment: .top, spacing: .statusColumnsSpacing) {
if !isCompact, if !isCompact,
@ -75,13 +75,6 @@ public struct StatusRowView: View {
} }
} }
VStack(alignment: .leading, spacing: .statusComponentSpacing) { VStack(alignment: .leading, spacing: .statusComponentSpacing) {
if !isCompact, theme.avatarPosition == .top {
StatusRowReblogView(viewModel: viewModel)
StatusRowReplyView(viewModel: viewModel)
if isHomeTimeline {
StatusRowTagView(viewModel: viewModel)
}
}
if !isCompact { if !isCompact {
StatusRowHeaderView(viewModel: viewModel) StatusRowHeaderView(viewModel: viewModel)
} }

View file

@ -4,10 +4,13 @@ import SwiftUI
struct StatusRowTagView: View { struct StatusRowTagView: View {
@Environment(CurrentAccount.self) private var currentAccount @Environment(CurrentAccount.self) private var currentAccount
@Environment(\.isHomeTimeline) private var isHomeTimeline
let viewModel: StatusRowViewModel let viewModel: StatusRowViewModel
var body: some View { var body: some View {
if let tag = viewModel.finalStatus.content.links.first(where: { link in if isHomeTimeline,
let tag = viewModel.finalStatus.content.links.first(where: { link in
link.type == .hashtag && currentAccount.tags.contains(where: { $0.name.lowercased() == link.title.lowercased() }) link.type == .hashtag && currentAccount.tags.contains(where: { $0.name.lowercased() == link.title.lowercased() })
}) { }) {
Text("#\(tag.title)") Text("#\(tag.title)")