summaryrefslogtreecommitdiff
path: root/Hutch/Views/More/MoreView.swift
blob: b7c557612f0831f877d33e76b3be1b27b8e3ba6d (plain) (blame)
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
import SwiftUI

struct MoreView: View {
    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")!)
    ]

    var body: some View {
        List {
            Section {
                NavigationLink(value: MoreRoute.lists) {
                    Label("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 and open in your browser.")
            }
        }
        .navigationTitle("More")
    }
}