mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 15:15:34 +03:00
BIT-1606: Add element IDs to DeleteAccountScreen (#1075)
This commit is contained in:
parent
cdda76bdae
commit
77e07f49ee
1 changed files with 9 additions and 3 deletions
|
@ -28,6 +28,8 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll
|
|||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.semantics.testTag
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import com.x8bit.bitwarden.R
|
||||
|
@ -150,6 +152,10 @@ fun DeleteAccountScreen(
|
|||
onConfirmationClick = remember(viewModel) {
|
||||
{ viewModel.trySendAction(DeleteAccountAction.DeleteAccountClick(it)) }
|
||||
},
|
||||
modifier = Modifier
|
||||
.semantics { testTag = "DELETE ACCOUNT" }
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp),
|
||||
)
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
BitwardenOutlinedButton(
|
||||
|
@ -158,6 +164,7 @@ fun DeleteAccountScreen(
|
|||
{ viewModel.trySendAction(DeleteAccountAction.CancelClick) }
|
||||
},
|
||||
modifier = Modifier
|
||||
.semantics { testTag = "CANCEL" }
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp),
|
||||
)
|
||||
|
@ -169,6 +176,7 @@ fun DeleteAccountScreen(
|
|||
@Composable
|
||||
private fun DeleteAccountButton(
|
||||
onConfirmationClick: (masterPassword: String) -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
var showPasswordDialog by remember { mutableStateOf(false) }
|
||||
if (showPasswordDialog) {
|
||||
|
@ -184,8 +192,6 @@ private fun DeleteAccountButton(
|
|||
BitwardenErrorButton(
|
||||
label = stringResource(id = R.string.delete_account),
|
||||
onClick = { showPasswordDialog = true },
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp),
|
||||
modifier = modifier,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue