1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
import SwiftUI
struct MoreView: View {
@Environment(AppState.self) private var appState
private let unsupportedLinks: [(title: String, url: URL)] = [
("chat.sr.ht", URL(string: "https://chat.sr.ht")!),
("man.sr.ht", URL(string: "https://man.sr.ht")!),
("srht.site", URL(string: "https://srht.site")!)
]
@State private var showAccountSwitcher = false
var body: some View {
List {
Section {
NavigationLink(value: MoreRoute.lists) {
Label("Mailing Lists", systemImage: "list.bullet.rectangle")
}
NavigationLink(value: MoreRoute.pastes) {
Label("Pastes", systemImage: "doc.on.clipboard")
}
NavigationLink(value: MoreRoute.settings) {
Label("Settings", systemImage: "gear")
}
}
Section {
ForEach(unsupportedLinks, id: \.title) { item in
Link(destination: item.url) {
Label(item.title, systemImage: "safari")
}
}
} header: {
Text("External Links")
} footer: {
Text("These SourceHut services are not supported in-app, as the SourceHut API does not support them, and will open in your browser.")
}
}
.navigationTitle("More")
.toolbar {
ToolbarItem(placement: .topBarTrailing) {
Button {
showAccountSwitcher = true
} label: {
Image(systemName: "person.crop.circle")
}
}
}
.sheet(isPresented: $showAccountSwitcher) {
AccountSwitcherView()
}
}
}
|