Skip to content

Commit

Permalink
PM-17409: Allow nullable labels text fields (#4617)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-livefront authored Jan 23, 2025
1 parent 50ae090 commit 31ccf49
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private fun MasterPasswordGeneratorContent(
) {
Spacer(modifier = Modifier.height(height = 12.dp))
BitwardenTextField(
label = "",
label = null,
value = generatedPassword,
onValueChange = {},
readOnly = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme
*/
@Composable
fun BitwardenHiddenPasswordField(
label: String,
label: String?,
value: String,
modifier: Modifier = Modifier,
cardStyle: CardStyle? = null,
Expand All @@ -39,7 +39,7 @@ fun BitwardenHiddenPasswordField(
.cardBackground(cardStyle = cardStyle)
.cardPadding(cardStyle = cardStyle, vertical = 6.dp),
textStyle = BitwardenTheme.typography.sensitiveInfoSmall,
label = { Text(text = label) },
label = label?.let { { Text(text = it) } },
value = value,
onValueChange = { },
visualTransformation = PasswordVisualTransformation(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme
* @param textToolbarType The type of [TextToolbar] to use on the text field.
* @param cardStyle Indicates the type of card style to be applied.
*/
@Suppress("LongMethod")
@Suppress("LongMethod", "CyclomaticComplexMethod")
@Composable
fun BitwardenPasswordField(
label: String,
label: String?,
value: String,
showPassword: Boolean,
showPasswordChange: (Boolean) -> Unit,
Expand Down Expand Up @@ -129,7 +129,7 @@ fun BitwardenPasswordField(
TextField(
colors = bitwardenTextFieldColors(),
textStyle = BitwardenTheme.typography.sensitiveInfoSmall,
label = { Text(text = label) },
label = label?.let { { Text(text = it) } },
value = textFieldValue,
onValueChange = {
textFieldValueState = it
Expand Down Expand Up @@ -215,7 +215,7 @@ fun BitwardenPasswordField(
*/
@Composable
fun BitwardenPasswordField(
label: String,
label: String?,
value: String,
showPassword: Boolean,
showPasswordChange: (Boolean) -> Unit,
Expand Down Expand Up @@ -289,7 +289,7 @@ fun BitwardenPasswordField(
*/
@Composable
fun BitwardenPasswordField(
label: String,
label: String?,
value: String,
onValueChange: (String) -> Unit,
modifier: Modifier = Modifier,
Expand Down Expand Up @@ -351,7 +351,7 @@ fun BitwardenPasswordField(
*/
@Composable
fun BitwardenPasswordField(
label: String,
label: String?,
value: String,
onValueChange: (String) -> Unit,
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme
*/
@Composable
fun BitwardenPasswordFieldWithActions(
label: String,
label: String?,
value: String,
showPassword: Boolean,
showPasswordChange: (Boolean) -> Unit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import com.x8bit.bitwarden.ui.platform.theme.BitwardenTheme
*/
@Composable
fun BitwardenStepper(
label: String,
label: String?,
value: Int?,
onValueChange: (Int) -> Unit,
modifier: Modifier = Modifier,
Expand Down Expand Up @@ -101,7 +101,7 @@ fun BitwardenStepper(
@Suppress("LongMethod", "CyclomaticComplexMethod")
@Composable
fun BitwardenStepper(
label: String,
label: String?,
value: Int?,
onValueChange: (Int) -> Unit,
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ private fun ColumnScope.ForwardedEmailAliasTypeContent(
null -> {
var obfuscatedTextField by remember { mutableStateOf("") }
BitwardenPasswordField(
label = "",
label = null,
value = obfuscatedTextField,
onValueChange = { obfuscatedTextField = it },
showPasswordTestTag = "ShowForwardedEmailApiSecretButton",
Expand Down

0 comments on commit 31ccf49

Please sign in to comment.