diff options
Diffstat (limited to 'Hotline/macOS/MessageBoardView.swift')
| -rw-r--r-- | Hotline/macOS/MessageBoardView.swift | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/Hotline/macOS/MessageBoardView.swift b/Hotline/macOS/MessageBoardView.swift index f870b0c..115e4e3 100644 --- a/Hotline/macOS/MessageBoardView.swift +++ b/Hotline/macOS/MessageBoardView.swift @@ -2,10 +2,10 @@ import SwiftUI struct MessageBoardView: View { @Environment(Hotline.self) private var model: Hotline - + @State private var composerDisplayed: Bool = false @State private var composerText: String = "" - + var body: some View { NavigationStack { if model.access?.contains(.canReadMessageBoard) != false { @@ -38,8 +38,7 @@ struct MessageBoardView: View { } } .background(Color(nsColor: .textBackgroundColor)) - } - else { + } else { ZStack(alignment: .center) { Text("No Message Board") .font(.title) @@ -54,36 +53,36 @@ struct MessageBoardView: View { MessageBoardEditorView() .frame(maxWidth: .infinity, maxHeight: .infinity) .frame(idealWidth: 450, idealHeight: 350) -// RichTextEditor(text: $composerText) -// .richEditorFont(NSFont.systemFont(ofSize: 16.0)) -// .richEditorAutomaticDashSubstitution(false) -// .richEditorAutomaticQuoteSubstitution(false) -// .richEditorAutomaticSpellingCorrection(false) -// .background(Color(nsColor: .textBackgroundColor)) -// .frame(maxWidth: .infinity, maxHeight: .infinity) -// .frame(idealWidth: 450, idealHeight: 350) -// .toolbar { -// ToolbarItem(placement: .cancellationAction) { -// Button("Cancel") { -// composerDisplayed.toggle() -// } -// } -// -// ToolbarItem(placement: .primaryAction) { -// Button("Post") { -// composerDisplayed.toggle() -// let text = composerText -// composerText = "" -// model.postToMessageBoard(text: text) -// Task { -// await model.getMessageBoard() -// } -// } -// } -// } + // RichTextEditor(text: $composerText) + // .richEditorFont(NSFont.systemFont(ofSize: 16.0)) + // .richEditorAutomaticDashSubstitution(false) + // .richEditorAutomaticQuoteSubstitution(false) + // .richEditorAutomaticSpellingCorrection(false) + // .background(Color(nsColor: .textBackgroundColor)) + // .frame(maxWidth: .infinity, maxHeight: .infinity) + // .frame(idealWidth: 450, idealHeight: 350) + // .toolbar { + // ToolbarItem(placement: .cancellationAction) { + // Button("Cancel") { + // composerDisplayed.toggle() + // } + // } + // + // ToolbarItem(placement: .primaryAction) { + // Button("Post") { + // composerDisplayed.toggle() + // let text = composerText + // composerText = "" + // model.postToMessageBoard(text: text) + // Task { + // await model.getMessageBoard() + // } + // } + // } + // } } .toolbar { - ToolbarItem(placement:.primaryAction) { + ToolbarItem(placement: .primaryAction) { Button { composerDisplayed.toggle() } label: { |