Move Drafts button to nav bar when current composed post doesn't have any content

This commit is contained in:
Shadowfacts 2023-01-26 22:17:49 -05:00
parent 6a3dcca9ee
commit b506704716
2 changed files with 16 additions and 17 deletions

View File

@ -78,12 +78,6 @@ struct ComposeToolbar: View {
}
Spacer()
Button(action: self.draftsButtonPressed) {
Text("Drafts")
}
.padding(5)
.hoverEffect()
}
.padding(.horizontal, 16)
.frame(minWidth: minWidth)
@ -119,10 +113,6 @@ struct ComposeToolbar: View {
uiState.currentInput?.beginAutocompletingEmoji()
}
private func draftsButtonPressed() {
uiState.isShowingDraftsList = true
}
private func formatAction(_ format: StatusFormat) -> () -> Void {
{
uiState.currentInput?.applyFormat(format)

View File

@ -239,7 +239,9 @@ struct ComposeView: View {
}
}
@ViewBuilder
private var postButton: some View {
if draft.hasContent {
Button {
Task {
await self.postStatus()
@ -249,6 +251,13 @@ struct ComposeView: View {
}
.keyboardShortcut(.return, modifiers: .command)
.disabled(!postButtonEnabled)
} else {
Button {
uiState.isShowingDraftsList = true
} label: {
Text("Drafts")
}
}
}
private func cancel() {