2024-06-19 15:15:27 +00:00
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct WelcomeScreen: View {
|
2024-08-11 15:04:42 +00:00
|
|
|
@Environment(\.router) var router
|
2024-06-19 15:15:27 +00:00
|
|
|
|
2024-08-11 15:04:42 +00:00
|
|
|
var body: some View {
|
2024-06-19 15:15:27 +00:00
|
|
|
ZStack {
|
|
|
|
// background
|
2024-07-04 08:21:12 +00:00
|
|
|
Color.Material.Background.light
|
2024-06-19 15:15:27 +00:00
|
|
|
.ignoresSafeArea()
|
|
|
|
|
|
|
|
// content
|
|
|
|
VStack(spacing: 32) {
|
|
|
|
// icon
|
|
|
|
Image.logo
|
|
|
|
.resizable()
|
|
|
|
.aspectRatio(contentMode: .fit)
|
|
|
|
.frame(width: 120, height: 120)
|
|
|
|
|
|
|
|
// texts
|
|
|
|
VStack(spacing: 10) {
|
|
|
|
Text(L10n.Global.name)
|
|
|
|
.font(.head1r)
|
2024-07-04 08:21:12 +00:00
|
|
|
.foregroundColor(.Material.Text.main)
|
2024-06-19 15:15:27 +00:00
|
|
|
.fixedSize(horizontal: true, vertical: false)
|
|
|
|
Text(L10n.Start.subtitle)
|
|
|
|
.font(.body2)
|
2024-07-04 08:21:12 +00:00
|
|
|
.foregroundColor(.Material.Text.sub)
|
2024-06-19 15:15:27 +00:00
|
|
|
.fixedSize(horizontal: false, vertical: true)
|
|
|
|
.multilineTextAlignment(.center)
|
|
|
|
}
|
|
|
|
|
|
|
|
// buttons
|
|
|
|
VStack(spacing: 16) {
|
|
|
|
Button {
|
2024-08-11 15:04:42 +00:00
|
|
|
router.showScreen(.push) { _ in
|
|
|
|
LoginScreen()
|
|
|
|
.navigationBarBackButtonHidden(true)
|
2024-08-11 00:28:01 +00:00
|
|
|
}
|
2024-06-19 15:15:27 +00:00
|
|
|
} label: {
|
|
|
|
Text(L10n.Start.Btn.login)
|
|
|
|
}
|
|
|
|
.buttonStyle(SecondaryButtonStyle())
|
|
|
|
Button {
|
2024-08-11 15:04:42 +00:00
|
|
|
router.showScreen(.push) { _ in
|
|
|
|
RegistrationScreen()
|
|
|
|
.navigationBarBackButtonHidden(true)
|
2024-08-11 00:28:01 +00:00
|
|
|
}
|
2024-06-19 15:15:27 +00:00
|
|
|
} label: {
|
|
|
|
Text(L10n.Start.Btn.register)
|
|
|
|
}
|
|
|
|
.buttonStyle(PrimaryButtonStyle())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.padding(.horizontal, 32)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|