From 4fd69c02a3e7b581bb9229865336c315153f3b18 Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Tue, 19 Dec 2023 20:38:13 -0800 Subject: Beginnings of a UI for macOS as well as some visual changes to iOS client. :) --- Hotline/Views/MessageBoardView.swift | 74 ------------------------------------ 1 file changed, 74 deletions(-) delete mode 100644 Hotline/Views/MessageBoardView.swift (limited to 'Hotline/Views/MessageBoardView.swift') 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())) -} -- cgit