Fix issue with various editor sheets

This commit is contained in:
Thomas Ricouard 2024-09-18 15:38:42 +02:00
parent 7cef1c5786
commit b0846c9a3d
4 changed files with 15 additions and 13 deletions

View file

@ -177,13 +177,8 @@ extension StatusEditor {
Image(systemName: customEmojiSheetIconName)
}
.accessibilityLabel("accessibility.editor.button.custom-emojis")
.popover(isPresented: $isCustomEmojisSheetDisplay) {
if UIDevice.current.userInterfaceIdiom == .phone {
.sheet(isPresented: $isCustomEmojisSheetDisplay) {
CustomEmojisView(viewModel: focusedSEVM)
} else {
CustomEmojisView(viewModel: focusedSEVM)
.frame(width: 400, height: 500)
}
}
}

View file

@ -60,7 +60,7 @@ extension StatusEditor {
}
.presentationBackground(.thinMaterial)
.presentationCornerRadius(16)
.presentationDetents([.medium])
.presentationDetents([.medium, .large])
}
}
}

View file

@ -31,7 +31,12 @@ extension StatusEditor {
.font(.footnote)
.foregroundStyle(.gray)
}
}.listRowBackground(theme.primaryBackgroundColor)
}
#if os(visionOS)
.foregroundStyle(theme.labelColor)
#else
.listRowBackground(theme.primaryBackgroundColor.opacity(0.4))
#endif
}
.onDelete { indexes in
if let index = indexes.first {
@ -42,10 +47,14 @@ extension StatusEditor {
.toolbar {
CancelToolbarItem()
}
.listStyle(.insetGrouped)
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.background(.clear)
.navigationTitle("status.editor.drafts.navigation-title")
.navigationBarTitleDisplayMode(.inline)
.presentationBackground(.thinMaterial)
.presentationCornerRadius(16)
.presentationDetents([.medium, .large])
}
}
}

View file

@ -34,13 +34,11 @@ extension StatusEditor {
Image(systemName: "pencil.and.list.clipboard")
}
.accessibilityLabel("accessibility.editor.button.drafts")
.popover(isPresented: $isDraftsSheetDisplayed) {
.sheet(isPresented: $isDraftsSheetDisplayed) {
if UIDevice.current.userInterfaceIdiom == .phone {
draftsListView
.presentationDetents([.medium])
} else {
draftsListView
.frame(width: 400, height: 500)
}
}
}