diff --git a/feature/profile/src/main/java/com/wap/wapp/feature/profile/ProfileScreen.kt b/feature/profile/src/main/java/com/wap/wapp/feature/profile/ProfileScreen.kt index 78b7aac0..79e135e6 100644 --- a/feature/profile/src/main/java/com/wap/wapp/feature/profile/ProfileScreen.kt +++ b/feature/profile/src/main/java/com/wap/wapp/feature/profile/ProfileScreen.kt @@ -41,6 +41,7 @@ internal fun ProfileRoute( navigateToProfileSetting: (String) -> Unit, navigateToAttendance: () -> Unit, navigateToSignIn: () -> Unit, + navigateToSurveyDetail: (String) -> Unit, ) { val todayEventsState by viewModel.todayEvents.collectAsStateWithLifecycle() val recentEventsState by viewModel.recentEvents.collectAsStateWithLifecycle() @@ -67,6 +68,7 @@ internal fun ProfileRoute( navigateToProfileSetting = navigateToProfileSetting, navigateToAttendance = navigateToAttendance, navigateToSignIn = navigateToSignIn, + navigateToSurveyDetail = navigateToSurveyDetail, ) } @@ -81,6 +83,7 @@ internal fun ProfileScreen( navigateToProfileSetting: (String) -> Unit, navigateToAttendance: () -> Unit, navigateToSignIn: () -> Unit, + navigateToSurveyDetail: (String) -> Unit, ) { val scrollState = rememberScrollState() @@ -137,6 +140,7 @@ internal fun ProfileScreen( userRespondedSurveysState = userRespondedSurveysState, attendanceCardBoardColor = WappTheme.colors.blue4FF, navigateToAttendance = navigateToAttendance, + navigateToSurveyDetail = navigateToSurveyDetail, ) } @@ -161,6 +165,7 @@ internal fun ProfileScreen( userRespondedSurveysState = userRespondedSurveysState, attendanceCardBoardColor = WappTheme.colors.yellow34, navigateToAttendance = navigateToAttendance, + navigateToSurveyDetail = navigateToSurveyDetail, ) } diff --git a/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappSurveyHistoryRow.kt b/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappSurveyHistoryRow.kt index da585a5f..4acbd438 100644 --- a/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappSurveyHistoryRow.kt +++ b/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappSurveyHistoryRow.kt @@ -19,13 +19,13 @@ import com.wap.wapp.core.model.survey.Survey internal fun WappSurveyHistoryRow( survey: Survey, modifier: Modifier = Modifier, - onClick: () -> Unit = {}, + onClick: (String) -> Unit, ) { Row( verticalAlignment = Alignment.CenterVertically, modifier = modifier .padding(horizontal = 10.dp) - .clickable { onClick() }, + .clickable { onClick(survey.surveyId) }, ) { Row( verticalAlignment = Alignment.CenterVertically, diff --git a/feature/profile/src/main/java/com/wap/wapp/feature/profile/navigation/ProfileNavigation.kt b/feature/profile/src/main/java/com/wap/wapp/feature/profile/navigation/ProfileNavigation.kt index 0f428055..0bfff2eb 100644 --- a/feature/profile/src/main/java/com/wap/wapp/feature/profile/navigation/ProfileNavigation.kt +++ b/feature/profile/src/main/java/com/wap/wapp/feature/profile/navigation/ProfileNavigation.kt @@ -17,12 +17,14 @@ fun NavGraphBuilder.profileScreen( navigateToProfileSetting: (String) -> Unit, navigateToAttendance: () -> Unit, navigateToSignIn: () -> Unit, + navigateToSurveyDetail: (String) -> Unit, ) { composable(route = profileNavigationRoute) { ProfileRoute( navigateToProfileSetting = navigateToProfileSetting, navigateToAttendance = navigateToAttendance, navigateToSignIn = navigateToSignIn, + navigateToSurveyDetail = navigateToSurveyDetail, ) } } diff --git a/feature/profile/src/main/java/com/wap/wapp/feature/profile/profilesetting/component/UserProfile.kt b/feature/profile/src/main/java/com/wap/wapp/feature/profile/profilesetting/component/UserProfile.kt index 69ec1923..d2d0488c 100644 --- a/feature/profile/src/main/java/com/wap/wapp/feature/profile/profilesetting/component/UserProfile.kt +++ b/feature/profile/src/main/java/com/wap/wapp/feature/profile/profilesetting/component/UserProfile.kt @@ -47,6 +47,7 @@ internal fun UserProfile( userRespondedSurveysState: ProfileViewModel.SurveysState, attendanceCardBoardColor: Color, navigateToAttendance: () -> Unit, + navigateToSurveyDetail: (String) -> Unit, ) { Column(modifier = Modifier.padding(horizontal = 10.dp)) { ProfileAttendanceCard( @@ -63,6 +64,7 @@ internal fun UserProfile( MySurveyHistory( userRespondedSurveysState = userRespondedSurveysState, + navigateToSurveyDetail = navigateToSurveyDetail, modifier = Modifier.padding(vertical = 20.dp), ) } @@ -204,6 +206,7 @@ private fun MyAttendanceStatus( @Composable private fun MySurveyHistory( userRespondedSurveysState: ProfileViewModel.SurveysState, + navigateToSurveyDetail: (String) -> Unit, modifier: Modifier = Modifier, ) { Column(modifier = modifier) { @@ -243,7 +246,10 @@ private fun MySurveyHistory( items = userRespondedSurveysState.surveys, key = { survey -> survey.surveyId }, ) { survey -> - WappSurveyHistoryRow(survey) + WappSurveyHistoryRow( + survey, + onClick = navigateToSurveyDetail, + ) } } }