another.im-ios/ConversationsClassic/View/Entering/WelcomeScreen.swift
fmodf b3b3b3aef7 mv-experiment (#1)
Reviewed-on: narayana/conversations-classic-ios#1
Co-authored-by: fmodf <fmodf.ios@gmail.com>
Co-committed-by: fmodf <fmodf.ios@gmail.com>
2024-09-03 15:13:58 +00:00

59 lines
1.9 KiB
Swift

import SwiftUI
struct WelcomeScreen: View {
@Environment(\.router) var router
var body: some View {
ZStack {
// background
Color.Material.Background.light
.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)
.foregroundColor(.Material.Text.main)
.fixedSize(horizontal: true, vertical: false)
Text(L10n.Start.subtitle)
.font(.body2)
.foregroundColor(.Material.Text.sub)
.fixedSize(horizontal: false, vertical: true)
.multilineTextAlignment(.center)
}
// buttons
VStack(spacing: 16) {
Button {
router.showScreen(.push) { _ in
LoginScreen()
.navigationBarBackButtonHidden(true)
}
} label: {
Text(L10n.Start.Btn.login)
}
.buttonStyle(SecondaryButtonStyle())
Button {
router.showScreen(.push) { _ in
RegistrationScreen()
.navigationBarBackButtonHidden(true)
}
} label: {
Text(L10n.Start.Btn.register)
}
.buttonStyle(PrimaryButtonStyle())
}
}
.padding(.horizontal, 32)
}
}
}