aboutsummaryrefslogtreecommitdiff
path: root/Hotline/Views/MessageBoardView.swift
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2023-12-19 20:38:13 -0800
committerDustin Mierau <dustin@mierau.me>2023-12-19 20:38:13 -0800
commit4fd69c02a3e7b581bb9229865336c315153f3b18 (patch)
treee6e11d872424196f2b4033077902126ad5556e40 /Hotline/Views/MessageBoardView.swift
parent5e87b5927cd931d46fb5f72fb035480a95969a9f (diff)
Beginnings of a UI for macOS as well as some visual changes to iOS client. :)
Diffstat (limited to 'Hotline/Views/MessageBoardView.swift')
-rw-r--r--Hotline/Views/MessageBoardView.swift74
1 files changed, 0 insertions, 74 deletions
diff --git a/Hotline/Views/MessageBoardView.swift b/Hotline/Views/MessageBoardView.swift
deleted file mode 100644
index 0d3968f..0000000
--- a/Hotline/Views/MessageBoardView.swift
+++ /dev/null
@@ -1,74 +0,0 @@
-import SwiftUI
-
-struct MessageBoardView: View {
- @Environment(Hotline.self) private var model: Hotline
-
- @State private var initialLoadComplete = false
- @State private var fetched = false
-
- var body: some View {
- NavigationStack {
- ScrollView {
- LazyVStack(alignment: .leading) {
- ForEach(model.messageBoard, id: \.self) {
- Text($0)
- .lineLimit(100)
- .padding()
- .textSelection(.enabled)
- Divider()
- }
- }
- Spacer()
- }
- .task {
- if !initialLoadComplete {
- let _ = await model.getMessageBoard()
- initialLoadComplete = true
- }
- }
- .overlay {
- if !initialLoadComplete {
- VStack {
- ProgressView()
- .controlSize(.large)
- }
- .frame(maxWidth: .infinity)
- }
- }
- .refreshable {
- let _ = await model.getMessageBoard()
- initialLoadComplete = true
- }
- .navigationBarTitleDisplayMode(.inline)
- .toolbar {
- ToolbarItem(placement: .principal) {
- Text(model.serverTitle)
- .font(.headline)
- }
- ToolbarItem(placement: .navigationBarLeading) {
- Button {
- model.disconnect()
- } label: {
- Text(Image(systemName: "xmark.circle.fill"))
- .symbolRenderingMode(.hierarchical)
- .font(.title2)
- .foregroundColor(.secondary)
- }
- }
- ToolbarItem(placement: .navigationBarTrailing) {
- Button {
-
- } label: {
- Image(systemName: "square.and.pencil")
- }
- }
- }
- }
-
- }
-}
-
-#Preview {
- MessageBoardView()
- .environment(Hotline(trackerClient: HotlineTrackerClient(), client: HotlineClient()))
-}