PM-17377: Update text, formatting, and style for the environment selector (#4623)

This commit is contained in:
David Perez
2025-01-24 15:34:42 -06:00
committed by GitHub
parent 92b92403c6
commit 09b898d655
4 changed files with 13 additions and 7 deletions

View File

@@ -247,7 +247,8 @@ private fun LandingScreenContent(
cardStyle = CardStyle.Full,
supportingTextContent = {
EnvironmentSelector(
labelText = stringResource(id = R.string.logging_in_on),
labelText = stringResource(id = R.string.logging_in_on_with_colon),
dialogTitle = stringResource(id = R.string.logging_in_on),
selectedOption = state.selectedEnvironmentType,
onOptionSelected = onEnvironmentTypeSelect,
modifier = Modifier

View File

@@ -232,7 +232,8 @@ private fun StartRegistrationContent(
modifier = Modifier.fillMaxWidth(),
) {
EnvironmentSelector(
labelText = stringResource(id = R.string.creating_on),
labelText = stringResource(id = R.string.create_account_on_with_colon),
dialogTitle = stringResource(id = R.string.create_account_on),
selectedOption = selectedEnvironmentType,
onOptionSelected = handler.onEnvironmentTypeSelect,
modifier = Modifier.testTag("RegionSelectorDropdown"),

View File

@@ -35,6 +35,7 @@ import com.x8bit.bitwarden.ui.platform.util.displayLabel
* and displays the currently selected region on the UI.
*
* @param labelText The text displayed near the selector button.
* @param dialogTitle The title displayed in the selection dialog.
* @param selectedOption The currently selected environment option.
* @param onOptionSelected A callback that gets invoked when an environment option is selected
* and passes the selected option as an argument.
@@ -43,6 +44,7 @@ import com.x8bit.bitwarden.ui.platform.util.displayLabel
@Composable
fun EnvironmentSelector(
labelText: String,
dialogTitle: String,
selectedOption: Environment.Type,
onOptionSelected: (Environment.Type) -> Unit,
modifier: Modifier = Modifier,
@@ -64,12 +66,12 @@ fun EnvironmentSelector(
Text(
text = labelText,
style = BitwardenTheme.typography.bodySmall,
color = BitwardenTheme.colorScheme.text.primary,
modifier = Modifier.padding(end = 12.dp),
color = BitwardenTheme.colorScheme.text.secondary,
modifier = Modifier.padding(end = 4.dp),
)
Text(
text = selectedOption.displayLabel(),
style = BitwardenTheme.typography.labelLarge,
style = BitwardenTheme.typography.labelMedium,
color = BitwardenTheme.colorScheme.text.interaction,
modifier = Modifier.padding(end = 8.dp),
)
@@ -82,7 +84,7 @@ fun EnvironmentSelector(
if (shouldShowDialog) {
BitwardenSelectionDialog(
title = stringResource(id = R.string.logging_in_on),
title = dialogTitle,
onDismissRequest = { shouldShowDialog = false },
) {
options.forEach {

View File

@@ -842,6 +842,7 @@ Do you want to switch to this account?</string>
<string name="log_in_with_device_must_be_set_up_in_the_settings_of_the_bitwarden_app_need_another_option">Log in with device must be set up in the settings of the Bitwarden app. Need another option?</string>
<string name="log_in_with_device">Log in with device</string>
<string name="logging_in_on">Logging in on</string>
<string name="logging_in_on_with_colon">Logging in on:</string>
<string name="vault">Vault</string>
<string name="appearance">Appearance</string>
<string name="account_security">Account security</string>
@@ -936,7 +937,8 @@ Do you want to switch to this account?</string>
<string name="self_hosted_server_url">Self-hosted server URL</string>
<string name="passkey_operation_failed_because_user_could_not_be_verified">Passkey operation failed because user could not be verified.</string>
<string name="user_verification_direction">User verification</string>
<string name="creating_on">Creating on:</string>
<string name="create_account_on">Create account on</string>
<string name="create_account_on_with_colon">Create account on:</string>
<string name="follow_the_instructions_in_the_email_sent_to_x_to_continue_creating_your_account">Follow the instructions in the email sent to %1$s to continue creating your account.</string>
<string name="we_sent_an_email_to">We sent an email to <annotation emphasis="bold"><annotation arg="0">%1$s</annotation></annotation>.</string>
<string name="by_continuing_you_agree_to_the_terms_of_service_and_privacy_policy">By continuing, you agree to the <annotation link="termsOfService">Terms of Service</annotation> and <annotation link="privacyPolicy">Privacy Policy</annotation></string>