mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-20 13:26:03 +00:00
Add new sidebar for help
This commit is contained in:
1 parent
4743424ac4
commit
af2dbc8c2d
24 files changed
+583
-375
No files matched your search
@@ -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()
|
||||
}
|
||||
Reference in new issue
Block a user