Update use case, registration and login screens.

Remove "Custom server" button from use case screen.
Remove matrix.org description.
Add username availability to registration screen.
This commit is contained in:
Doug
2022-07-13 13:39:27 +01:00
committed by Doug
parent f19149dab8
commit 5394ed0f4a
24 changed files with 224 additions and 208 deletions
@@ -29,6 +29,23 @@ struct OnboardingUseCaseSelectionScreen: View {
@ObservedObject var viewModel: OnboardingUseCaseViewModel.Context
var body: some View {
ScrollView {
VStack(spacing: 0) {
titleContent
.padding(.bottom, 36)
useCaseButtons
}
.readableFrame()
.padding(.top, OnboardingMetrics.topPaddingToNavigationBar)
.padding(.bottom, 8)
.padding(.horizontal, 16)
}
.background(theme.colors.background.ignoresSafeArea())
.accentColor(theme.colors.accent)
}
/// The screen's title and instructions.
var titleContent: some View {
VStack(spacing: 8) {
@@ -76,47 +93,6 @@ struct OnboardingUseCaseSelectionScreen: View {
.padding(.top, 8)
}
}
/// A footer showing a button to connect to a server.
var serverFooter: some View {
VStack(spacing: 14) {
Text(VectorL10n.onboardingUseCaseExistingServerMessage)
.font(theme.fonts.subheadline)
.multilineTextAlignment(.center)
.foregroundColor(theme.colors.tertiaryContent)
Button { viewModel.send(viewAction: .answer(.customServer)) } label: {
Text(VectorL10n.onboardingUseCaseExistingServerButton)
.font(theme.fonts.body)
}
}
}
var body: some View {
GeometryReader { geometry in
VStack {
ScrollView {
VStack(spacing: 0) {
titleContent
.padding(.bottom, 36)
useCaseButtons
}
.readableFrame()
.padding(.top, OnboardingMetrics.topPaddingToNavigationBar)
.padding(.bottom, 8)
.padding(.horizontal, 16)
}
serverFooter
.padding(.horizontal, 16)
.padding(.top, 8)
.padding(.bottom, geometry.safeAreaInsets.bottom > 0 ? 20 : 36)
}
}
.background(theme.colors.background.ignoresSafeArea())
.accentColor(theme.colors.accent)
}
}
// MARK: - Previews