This commit is contained in:
Thomas Ricouard 2023-09-18 19:04:54 +02:00
parent bc554da678
commit 1b0ddf4fd9

View file

@ -108,6 +108,14 @@ struct StatusEditorAccessoryView: View {
Image(systemName: "archivebox")
}
.accessibilityLabel("accessibility.editor.button.drafts")
.popover(isPresented: $isDraftsSheetDisplayed) {
if UIDevice.current.userInterfaceIdiom == .phone {
draftsSheetView
} else {
draftsSheetView
.frame(width: 400, height: 500)
}
}
}
if !viewModel.customEmojis.isEmpty {
@ -120,6 +128,14 @@ struct StatusEditorAccessoryView: View {
Image(systemName: customEmojiSheetIconName)
}
.accessibilityLabel("accessibility.editor.button.custom-emojis")
.popover(isPresented: $isCustomEmojisSheetDisplay) {
if UIDevice.current.userInterfaceIdiom == .phone {
customEmojisSheet
} else {
customEmojisSheet
.frame(width: 400, height: 500)
}
}
}
Button {
@ -132,6 +148,14 @@ struct StatusEditorAccessoryView: View {
}
}
.accessibilityLabel("accessibility.editor.button.language")
.popover(isPresented: $isLanguageSheetDisplayed) {
if UIDevice.current.userInterfaceIdiom == .phone {
languageSheetView
} else {
languageSheetView
.frame(width: 400, height: 500)
}
}
if preferences.isOpenAIEnabled {
AIMenu.disabled(!viewModel.canPost)
@ -147,15 +171,6 @@ struct StatusEditorAccessoryView: View {
.padding(.vertical, 12)
.background(.ultraThinMaterial)
}
.sheet(isPresented: $isDraftsSheetDisplayed) {
draftsSheetView
}
.sheet(isPresented: $isLanguageSheetDisplayed) {
languageSheetView
}
.sheet(isPresented: $isCustomEmojisSheetDisplay) {
customEmojisSheet
}
.onAppear {
viewModel.setInitialLanguageSelection(preference: preferences.recentlyUsedLanguages.first ?? preferences.serverPreferences?.postLanguage)
}