Skip to content

Commit

Permalink
fix(android): disable editing team members
Browse files Browse the repository at this point in the history
  • Loading branch information
autoreleasefool committed Sep 16, 2024
1 parent 414872b commit 8fcf03f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class TeamFormViewModel @Inject constructor(
form = TeamFormUiState(
name = team.name,
members = team.members,
isEditingMembersEnabled = false,
),
topBar = TeamFormTopBarUiState(
existingName = team.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,14 @@ fun TeamForm(

FormSectionHeader(
titleResourceId = R.string.team_form_team_members,
headerAction = HeaderAction(
actionResourceId = R.string.team_form_manage_team_members,
onClick = { onAction(TeamFormUiAction.ManageTeamMembersClicked) },
),
headerAction = if (state.isEditingMembersEnabled) {
HeaderAction(
actionResourceId = R.string.team_form_manage_team_members,
onClick = { onAction(TeamFormUiAction.ManageTeamMembersClicked) },
)
} else {
null
},
modifier = Modifier.padding(top = 16.dp),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ data class TeamFormUiState(
val isShowingDeleteDialog: Boolean = false,
val isDeleteButtonEnabled: Boolean = false,
val isShowingDiscardChangesDialog: Boolean = false,
val isEditingMembersEnabled: Boolean = true,
)

sealed interface TeamFormUiAction {
Expand Down

0 comments on commit 8fcf03f

Please sign in to comment.