mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-06-10 01:09:29 +00:00
Fixes on detail view
This commit is contained in:
parent
194b36590f
commit
4e0be3bd75
|
@ -13,11 +13,12 @@ public struct StatusRowView: View {
|
|||
@Environment(\.isCompact) private var isCompact: Bool
|
||||
@Environment(\.accessibilityVoiceOverEnabled) private var accessibilityVoiceOverEnabled
|
||||
@Environment(\.isStatusFocused) private var isFocused
|
||||
@Environment(\.isStatusDetailLoaded) private var isStatusDetailLoaded
|
||||
|
||||
@Environment(QuickLook.self) private var quickLook
|
||||
@EnvironmentObject private var theme: Theme
|
||||
|
||||
@State var viewModel: StatusRowViewModel
|
||||
@State private var viewModel: StatusRowViewModel
|
||||
|
||||
public init(viewModel: StatusRowViewModel) {
|
||||
_viewModel = .init(initialValue: viewModel)
|
||||
|
@ -28,6 +29,7 @@ public struct StatusRowView: View {
|
|||
}
|
||||
|
||||
public var body: some View {
|
||||
let _ = Self._printChanges()
|
||||
VStack(alignment: .leading) {
|
||||
if viewModel.isFiltered, let filter = viewModel.filter {
|
||||
switch filter.filter.filterAction {
|
||||
|
@ -75,15 +77,21 @@ public struct StatusRowView: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
if viewModel.showActions, isFocused || theme.statusActionsDisplay != .none, !isInCaptureMode {
|
||||
StatusRowActionsView(viewModel: viewModel)
|
||||
.padding(.top, 8)
|
||||
.tint(isFocused ? theme.tintColor : .gray)
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
guard !isFocused else { return }
|
||||
viewModel.navigateToDetail()
|
||||
}
|
||||
VStack(alignment: .leading, spacing: 12) {
|
||||
if viewModel.showActions, isFocused || theme.statusActionsDisplay != .none, !isInCaptureMode {
|
||||
StatusRowActionsView(viewModel: viewModel)
|
||||
.padding(.top, 8)
|
||||
.tint(isFocused ? theme.tintColor : .gray)
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
guard !isFocused else { return }
|
||||
viewModel.navigateToDetail()
|
||||
}
|
||||
}
|
||||
|
||||
if isFocused, isStatusDetailLoaded {
|
||||
StatusRowDetailView(viewModel: viewModel)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,10 +11,9 @@ struct StatusRowActionsView: View {
|
|||
@EnvironmentObject private var userPreferences: UserPreferences
|
||||
|
||||
@Environment(\.isStatusFocused) private var isFocused
|
||||
@Environment(\.isStatusDetailLoaded) private var isStatusDetailLoaded
|
||||
|
||||
var viewModel: StatusRowViewModel
|
||||
|
||||
|
||||
func privateBoost() -> Bool {
|
||||
viewModel.status.visibility == .priv && viewModel.status.account.id == currentAccount.account?.id
|
||||
}
|
||||
|
@ -152,12 +151,6 @@ struct StatusRowActionsView: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if isStatusDetailLoaded {
|
||||
StatusRowDetailView(viewModel: viewModel)
|
||||
.transition(.move(edge: .bottom))
|
||||
.animation(.snappy)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue