hide context indicator for statuses inside StatusDetailView (#1899)

This commit is contained in:
Thai D. V 2024-01-18 12:41:40 +07:00 committed by GitHub
parent e03747aa45
commit 76a8f45478
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View file

@ -123,7 +123,7 @@ public struct StatusDetailView: View {
scrollToId: $viewModel.scrollToId)
let isFocused = self.viewModel.statusId == status.id
StatusRowView(viewModel: viewModel)
StatusRowView(viewModel: viewModel, context: .detail)
.id(status.id + (status.editedAt?.asDate.description ?? ""))
.environment(\.extraLeadingInset, !isCompact ? extraInsets : 0)
.environment(\.indentationLevel, !isCompact ? indentationLevel : 0)

View file

@ -23,8 +23,12 @@ public struct StatusRowView: View {
@State private var viewModel: StatusRowViewModel
@State private var showSelectableText: Bool = false
public init(viewModel: StatusRowViewModel) {
_viewModel = .init(initialValue: viewModel)
public enum Context { case timeline, detail }
private let context: Context
public init(viewModel: StatusRowViewModel, context: Context = .timeline) {
self._viewModel = .init(initialValue: viewModel)
self.context = context
}
var contextMenu: some View {
@ -56,7 +60,7 @@ public struct StatusRowView: View {
EmptyView()
}
} else {
if !isCompact {
if !isCompact && context != .detail {
Group {
StatusRowTagView(viewModel: viewModel)
StatusRowReblogView(viewModel: viewModel)