diff --git a/app/src/main/java/com/wap/wapp/MainActivity.kt b/app/src/main/java/com/wap/wapp/MainActivity.kt index 9e3c8755..29a43d65 100644 --- a/app/src/main/java/com/wap/wapp/MainActivity.kt +++ b/app/src/main/java/com/wap/wapp/MainActivity.kt @@ -118,6 +118,7 @@ private fun handleBottomBarState( ManagementSurveyRoute.surveyFormRegistrationRoute -> setBottomBarState(false) eventRegistrationNavigationRoute -> setBottomBarState(false) SurveyRoute.answerRoute("{id}") ->setBottomBarState(false) + ManagementSurveyRoute.surveyFormEditRoute("{id}") -> setBottomBarState(false) else -> setBottomBarState(true) } diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt index 61582b85..db843423 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerForm.kt @@ -66,9 +66,9 @@ internal fun SurveyAnswerForm( modifier = Modifier.weight(1f), ) - SurveyAnswerButton( - isLastQuestion = isLastQuestion, - onButtonClicked = onNextQuestionButtonClicked, + WappButton( + textRes = if (isLastQuestion) R.string.submit else R.string.next, + onClick = { onNextQuestionButtonClicked() }, isEnabled = checkQuestionTypeAndSubjectiveAnswer( questionType = surveyQuestion.questionType, subjectiveAnswer = subjectiveAnswer, @@ -79,30 +79,6 @@ internal fun SurveyAnswerForm( } } -@Composable -private fun SurveyAnswerButton( - isLastQuestion: Boolean, - isEnabled: Boolean, - onButtonClicked: () -> Unit, - modifier: Modifier, -) { - if (isLastQuestion) { - WappButton( - textRes = R.string.submit, - onClick = { onButtonClicked() }, - isEnabled = isEnabled, - modifier = modifier, - ) - } else { - WappButton( - textRes = R.string.next, - onClick = { onButtonClicked() }, - isEnabled = isEnabled, - modifier = modifier, - ) - } -} - private fun checkQuestionTypeAndSubjectiveAnswer( questionType: QuestionType, subjectiveAnswer: String,