Add an app setting to disable rendering the chrome around the app logo/brand.

This commit is contained in:
Stefan Ceriu
2025-09-19 14:32:12 +03:00
committed by Stefan Ceriu
parent ab41783c4d
commit 94db3adf3a
10 changed files with 41 additions and 27 deletions
@@ -37,6 +37,8 @@ struct AuthenticationStartScreenViewState: BindableState {
let showCreateAccountButton: Bool
let showQRCodeLoginButton: Bool
let hideBrandChrome: Bool
var bindings = AuthenticationStartScreenViewStateBindings()
var loginButtonTitle: String {
@@ -42,17 +42,20 @@ class AuthenticationStartScreenViewModel: AuthenticationStartScreenViewModelType
// The assumption here being that if you're running a custom app, your users will already be created.
AuthenticationStartScreenViewState(serverName: appSettings.accountProviders.count == 1 ? appSettings.accountProviders[0] : nil,
showCreateAccountButton: false,
showQRCodeLoginButton: isQRCodeScanningSupported)
showQRCodeLoginButton: isQRCodeScanningSupported,
hideBrandChrome: appSettings.hideBrandChrome)
} else if let provisioningParameters {
// We only show the "Sign in to …" button when using a provisioning link.
AuthenticationStartScreenViewState(serverName: provisioningParameters.accountProvider,
showCreateAccountButton: false,
showQRCodeLoginButton: false)
showQRCodeLoginButton: false,
hideBrandChrome: appSettings.hideBrandChrome)
} else {
// The default configuration.
AuthenticationStartScreenViewState(serverName: nil,
showCreateAccountButton: appSettings.showCreateAccountButton,
showQRCodeLoginButton: isQRCodeScanningSupported)
showQRCodeLoginButton: isQRCodeScanningSupported,
hideBrandChrome: appSettings.hideBrandChrome)
}
super.init(initialViewState: initialViewState)
@@ -62,23 +62,25 @@ struct AuthenticationStartScreen: View {
if verticalSizeClass == .regular {
Spacer()
AuthenticationStartLogo(isOnGradient: true)
AuthenticationStartLogo(isOnGradient: !context.viewState.hideBrandChrome)
}
Spacer()
VStack(spacing: 8) {
Text(L10n.screenOnboardingWelcomeTitle)
.font(.compound.headingLGBold)
.foregroundColor(.compound.textPrimary)
.multilineTextAlignment(.center)
Text(L10n.screenOnboardingWelcomeMessage(InfoPlistReader.main.productionAppName))
.font(.compound.bodyLG)
.foregroundColor(.compound.textSecondary)
.multilineTextAlignment(.center)
if !context.viewState.hideBrandChrome {
VStack(spacing: 8) {
Text(L10n.screenOnboardingWelcomeTitle)
.font(.compound.headingLGBold)
.foregroundColor(.compound.textPrimary)
.multilineTextAlignment(.center)
Text(L10n.screenOnboardingWelcomeMessage(InfoPlistReader.main.productionAppName))
.font(.compound.bodyLG)
.foregroundColor(.compound.textSecondary)
.multilineTextAlignment(.center)
}
.padding()
.fixedSize(horizontal: false, vertical: true)
}
.padding()
.fixedSize(horizontal: false, vertical: true)
Spacer()
}