Skip to content

Commit

Permalink
Add canSubmit property to RiderProfileCreationUiState
Browse files Browse the repository at this point in the history
  • Loading branch information
TSampley committed Sep 8, 2024
1 parent 37a8420 commit 9359fe6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ fun RiderProfileCreationView(
onValueChange = onPreferencesChange
)

Button(onClick = onSubmit) {
Button(
onClick = onSubmit,
enabled = state.canSubmit
) {
Text(text = "Submit")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ data class RiderProfileCreationUiState(
val disabilities: List<Disability>,
val preferences: String
) {

val canSubmit: Boolean
get() = profile.canSubmit

companion object {
val empty = RiderProfileCreationUiState(
profile = ProfileCreationUiState.empty,
Expand Down

0 comments on commit 9359fe6

Please sign in to comment.