47 lines
1.6 KiB
Swift
47 lines
1.6 KiB
Swift
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
@AppStorage("selectedService") private var selectedServiceRaw = StreamingService.deezer.rawValue
|
|
|
|
private var selectedService: Binding<StreamingService> {
|
|
Binding(
|
|
get: { StreamingService(rawValue: selectedServiceRaw) ?? .deezer },
|
|
set: { selectedServiceRaw = $0.rawValue }
|
|
)
|
|
}
|
|
|
|
var body: some View {
|
|
NavigationStack {
|
|
ZStack {
|
|
Color("Background").ignoresSafeArea()
|
|
|
|
VStack(spacing: 40) {
|
|
Image("AppLogo")
|
|
.resizable()
|
|
.scaledToFit()
|
|
.frame(width: 120, height: 120)
|
|
|
|
Picker("Streaming-Dienst", selection: selectedService) {
|
|
ForEach(StreamingService.allCases) { service in
|
|
Text(service.displayName).tag(service)
|
|
}
|
|
}
|
|
.pickerStyle(.menu)
|
|
.tint(Color("Primary"))
|
|
.padding(.horizontal, 32)
|
|
|
|
NavigationLink(destination: GameView(service: selectedService.wrappedValue)) {
|
|
Text("Starten")
|
|
.font(.system(size: 17, weight: .bold))
|
|
.foregroundColor(.white)
|
|
.frame(width: 220, height: 56)
|
|
.background(Color("Primary"))
|
|
.cornerRadius(8)
|
|
}
|
|
}
|
|
}
|
|
.navigationBarHidden(true)
|
|
}
|
|
}
|
|
}
|