Add new sidebar for help

This commit is contained in:
Leon Böttger committed 2025-03-08 21:12:56 +01:00
1 parent 4743424ac4
commit af2dbc8c2d
24 files changed
+583 -375

No files matched your search

+54
View File
@@ -0,0 +1,54 @@
//
// Sidebar.swift
// QuickDrop
//
// Created by Leon Böttger on 05.03.25.
//
import SwiftUI
struct SidebarView: View {
@State private var selection: String? = "Receive Files"
var body: some View {
HStack {
List(selection: $selection) {
Label("Receive Files", systemImage: "tray.and.arrow.down.fill")
.tag("Receive Files")
Label("Send Files", systemImage: "tray.and.arrow.up.fill")
.tag("Send Files")
Label("Troubleshooting", systemImage: "exclamationmark.triangle.fill")
.tag("Troubleshooting")
}
.frame(minWidth: 200, idealWidth: 250, maxWidth: 300)
.listStyle(SidebarListStyle())
Divider()
if let selection = selection {
DetailView(selection: selection)
} else {
Text("Select an option").frame(maxWidth: .infinity, maxHeight: .infinity)
}
}
}
}
struct DetailView: View {
let selection: String
var body: some View {
VStack {
Text(selection)
.font(.largeTitle)
.bold()
Spacer()
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
}
#Preview {
SidebarView()
}