Introduce initial UI for connecting to networks

This commit is contained in:
Conrad Kramer 2024-02-24 09:49:07 -08:00
parent 51fd638b72
commit 0fe630878d
33 changed files with 1458 additions and 321 deletions

View file

@ -0,0 +1,23 @@
import SwiftUI
struct HackClub: Network {
var id: String
var backgroundColor: Color { .init("HackClub") }
var label: some View {
GeometryReader { reader in
VStack(alignment: .leading) {
Image("HackClub")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: reader.size.height / 4)
Spacer()
Text("@conradev")
.foregroundStyle(.white)
.font(.body.monospaced())
}
.padding()
.frame(maxWidth: .infinity)
}
}
}

View file

@ -0,0 +1,10 @@
import SwiftUI
protocol Network {
associatedtype Label: View
var id: String { get }
var backgroundColor: Color { get }
var label: Label { get }
}

View file

@ -0,0 +1,30 @@
import SwiftUI
struct WireGuard: Network {
var id: String
var backgroundColor: Color { .init("WireGuard") }
var label: some View {
GeometryReader { reader in
VStack(alignment: .leading) {
HStack {
Image("WireGuard")
.resizable()
.aspectRatio(contentMode: .fit)
Image("WireGuardTitle")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: reader.size.width / 2)
Spacer()
}
.frame(maxWidth: .infinity, maxHeight: reader.size.height / 4)
Spacer()
Text("@conradev")
.foregroundStyle(.white)
.font(.body.monospaced())
}
.padding()
.frame(maxWidth: .infinity)
}
}
}