Skip to content

Commit

Permalink
fix: removed the duplicated code
Browse files Browse the repository at this point in the history
  • Loading branch information
ortolino committed Jun 1, 2024
1 parent 85aa100 commit b7dda59
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,27 +112,21 @@ fun NamePopUp(treasuryTagsViewModel: ProfileTreasuryTagsViewModel) {
var nameString by remember { mutableStateOf(tag.name) }
Dialog(onDismissRequest = { treasuryTagsViewModel.cancelPopUp() }) {
Card(
modifier = Modifier.padding(vertical = 16.dp, horizontal = 8.dp).testTag("editDialogBox"),
modifier = Modifier.padding(vertical = 16.dp, horizontal = 8.dp),
shape = RoundedCornerShape(16.dp),
) {
LazyColumn(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.padding(8.dp).testTag("editDialogColumn")) {
horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier.padding(8.dp)) {
item {
Row(
modifier = Modifier.fillMaxWidth().padding(8.dp),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically) {
Text(
state.displayedName,
style = MaterialTheme.typography.titleLarge,
modifier = Modifier.testTag("editDialogTitle"))
Text(state.displayedName, style = MaterialTheme.typography.titleLarge)
Icon(
Icons.Default.Close,
contentDescription = "Close dialog",
modifier =
Modifier.clickable { treasuryTagsViewModel.cancelPopUp() }
.testTag("editSubCategoryCancelButton"))
modifier = Modifier.clickable { treasuryTagsViewModel.cancelPopUp() })
}
}
item {
Expand Down Expand Up @@ -160,7 +154,7 @@ fun NamePopUp(treasuryTagsViewModel: ProfileTreasuryTagsViewModel) {
else treasuryTagsViewModel.addTag(newTag)
treasuryTagsViewModel.cancelPopUp()
},
modifier = Modifier.testTag("editDeleteButton"),
modifier = Modifier,
)
}
}
Expand Down

0 comments on commit b7dda59

Please sign in to comment.