mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-23 13:28:50 +01:00
Add detent support for composer
This commit is contained in:
parent
fcf00796b8
commit
d07427b919
@ -16,6 +16,7 @@ public struct StatusEditorView: View {
|
||||
@Environment(CurrentAccount.self) private var currentAccount
|
||||
@Environment(Theme.self) private var theme
|
||||
|
||||
@State private var presentationDetent: PresentationDetent = .large
|
||||
@State private var mainSEVM: StatusEditorViewModel
|
||||
@State private var followUpSEVMs: [StatusEditorViewModel] = []
|
||||
@FocusState private var isSpoilerTextFocused: UUID? // connect CoreEditor and StatusEditorAccessoryView
|
||||
@ -85,8 +86,10 @@ public struct StatusEditorView: View {
|
||||
}
|
||||
#else
|
||||
.safeAreaInset(edge: .bottom) {
|
||||
if presentationDetent == .large || presentationDetent == .medium {
|
||||
StatusEditorAccessoryView(isSpoilerTextFocused: $isSpoilerTextFocused, focusedSEVM: focusedSEVM, followUpSEVMs: $followUpSEVMs)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
.accessibilitySortPriority(1) // Ensure that all elements inside the `ScrollView` occur earlier than the accessory views
|
||||
.navigationTitle(focusedSEVM.mode.title)
|
||||
@ -138,5 +141,7 @@ public struct StatusEditorView: View {
|
||||
.sheet(item: $editingMediaContainer) { container in
|
||||
StatusEditorMediaEditView(viewModel: focusedSEVM, container: container)
|
||||
}
|
||||
.presentationDetents([.large, .medium, .height(50)], selection: $presentationDetent)
|
||||
.presentationBackgroundInteraction(.enabled(upThrough: .medium))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user