Remove EMS banner from Server Selection screen.

This commit is contained in:
Doug
2022-05-12 15:27:57 +01:00
committed by Doug
parent 963fba6673
commit bec012fbbb
9 changed files with 0 additions and 100 deletions
@@ -68,8 +68,6 @@ enum AuthenticationServerSelectionViewAction {
case confirm
/// Dismiss the view without using the entered address.
case dismiss
/// Open the EMS link.
case getInTouch
/// Clear any errors shown in the text field footer.
case clearFooterError
}
@@ -46,8 +46,6 @@ class AuthenticationServerSelectionViewModel: AuthenticationServerSelectionViewM
Task { await callback?(.confirm(homeserverAddress: state.bindings.homeserverAddress)) }
case .dismiss:
Task { await callback?(.dismiss) }
case .getInTouch:
Task { await getInTouch() }
case .clearFooterError:
Task { await clearFooterError() }
}
@@ -71,14 +69,4 @@ class AuthenticationServerSelectionViewModel: AuthenticationServerSelectionViewM
guard state.footerErrorMessage != nil else { return }
withAnimation { state.footerErrorMessage = nil }
}
/// Opens the EMS link in the user's browser.
@MainActor private func getInTouch() {
let url = BuildSettings.onboardingHostYourOwnServerLink
UIApplication.shared.open(url) { [weak self] success in
guard !success, let self = self else { return }
self.displayError(.openURLAlert)
}
}
}
@@ -47,14 +47,8 @@ struct AuthenticationServerSelectionScreen: View {
.padding(.bottom, 36)
serverForm
Spacer()
emsBanner
.padding(.vertical, 16)
}
.readableFrame()
.frame(minHeight: geometry.size.height)
.padding(.horizontal, 16)
.onAppear { scrollView = reader }
}
@@ -113,41 +107,6 @@ struct AuthenticationServerSelectionScreen: View {
}
}
/// A banner shown beneath the server form with information about hosting your own server.
var emsBanner: some View {
VStack(spacing: 12) {
Image(Asset.Images.authenticationServerSelectionEmsLogo.name)
.padding(.top, 8)
.accessibilityHidden(true)
Text(VectorL10n.authenticationServerSelectionEmsTitle)
.font(theme.fonts.title3SB)
.multilineTextAlignment(.center)
.foregroundColor(theme.colors.primaryContent)
VStack(spacing: 2) {
Text(VectorL10n.authenticationServerSelectionEmsMessage)
.font(theme.fonts.callout)
.multilineTextAlignment(.center)
.foregroundColor(theme.colors.secondaryContent)
Text(VectorL10n.authenticationServerSelectionEmsLink)
.font(theme.fonts.callout)
.multilineTextAlignment(.center)
.foregroundColor(theme.colors.primaryContent)
}
.padding(.bottom, 4)
.accessibilityElement(children: .combine)
Button { viewModel.send(viewAction: .getInTouch) } label: {
Text(VectorL10n.authenticationServerSelectionEmsButton)
.font(theme.fonts.body)
}
.buttonStyle(PrimaryActionButtonStyle(customColor: theme.colors.ems))
}
.padding(16)
.background(RoundedRectangle(cornerRadius: 9).foregroundColor(theme.colors.system))
}
@ToolbarContentBuilder
var toolbar: some ToolbarContent {
ToolbarItem(placement: .cancellationAction) {