Further tweak the layout

This commit is contained in:
Thomas Ricouard 2023-12-27 18:16:59 +01:00
parent bfa717bfa2
commit 21ac4cfa21
1 changed files with 10 additions and 34 deletions

View File

@ -22,9 +22,7 @@ struct StatusRowHeaderView: View {
} }
.buttonStyle(.plain) .buttonStyle(.plain)
Spacer() Spacer()
if !isInCaptureMode { dateView
threadIcon
}
} }
.accessibilityElement(children: .combine) .accessibilityElement(children: .combine)
.accessibilityLabel(Text("\(viewModel.finalStatus.account.safeDisplayName)") + Text(", ") + Text(viewModel.finalStatus.createdAt.relativeFormatted)) .accessibilityLabel(Text("\(viewModel.finalStatus.account.safeDisplayName)") + Text(", ") + Text(viewModel.finalStatus.createdAt.relativeFormatted))
@ -59,27 +57,16 @@ struct StatusRowHeaderView: View {
} }
} }
.layoutPriority(1) .layoutPriority(1)
if !redactionReasons.contains(.placeholder) {
if theme.avatarPosition == .leading {
dateView
} else {
Text("@\(theme.displayFullUsername ? viewModel.finalStatus.account.acct : viewModel.finalStatus.account.username)")
.font(.scaledFootnote)
.foregroundStyle(.secondary)
.lineLimit(1)
.accountPopover(viewModel.finalStatus.account)
}
}
} }
if theme.avatarPosition == .top { if !redactionReasons.contains(.placeholder) {
dateView if (theme.displayFullUsername && theme.avatarPosition == .leading) ||
} else if theme.displayFullUsername, theme.avatarPosition == .leading { theme.avatarPosition == .top {
Text("@\(viewModel.finalStatus.account.acct)") Text("@\(theme.displayFullUsername ? viewModel.finalStatus.account.acct : viewModel.finalStatus.account.username)")
.font(.scaledFootnote) .font(.scaledFootnote)
.foregroundStyle(.secondary) .foregroundStyle(.secondary)
.lineLimit(1) .lineLimit(1)
.offset(y: 1) .accountPopover(viewModel.finalStatus.account)
.accountPopover(viewModel.finalStatus.account) }
} }
} }
} }
@ -104,15 +91,4 @@ struct StatusRowHeaderView: View {
.foregroundStyle(.secondary) .foregroundStyle(.secondary)
.lineLimit(1) .lineLimit(1)
} }
@ViewBuilder
private var threadIcon: some View {
if viewModel.isThread {
Image(systemName: "bubble.left.and.bubble.right")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 15)
.foregroundStyle(.secondary)
}
}
} }