krz/hutch

an ios client for sourcehut

clone: git clone https://gitbay.org/krz/hutch.git

v2.4.1: Hutch/Views/More/MoreView.swift · raw

 1import SwiftUI
 2
 3struct MoreView: View {
 4    private let unsupportedLinks: [(title: String, url: URL)] = [
 5        ("chat.sr.ht", URL(string: "https://chat.sr.ht")!),
 6        ("man.sr.ht", URL(string: "https://man.sr.ht")!),
 7        ("srht.site", URL(string: "https://srht.site")!)
 8    ]
 9
10    var body: some View {
11        List {
12            Section {
13                NavigationLink(value: MoreRoute.lists) {
14                    Label("Lists", systemImage: "list.bullet.rectangle")
15                }
16
17                NavigationLink(value: MoreRoute.pastes) {
18                    Label("Pastes", systemImage: "doc.on.clipboard")
19                }
20
21                NavigationLink(value: MoreRoute.settings) {
22                    Label("Settings", systemImage: "gear")
23                }
24            }
25
26            Section {
27                ForEach(unsupportedLinks, id: \.title) { item in
28                    Link(destination: item.url) {
29                        Label(item.title, systemImage: "safari")
30                    }
31                }
32            } header: {
33                Text("External Links")
34            } footer: {
35                Text("These SourceHut services are not supported in-app and open in your browser.")
36            }
37        }
38        .navigationTitle("More")
39    }
40}