Skip to content

Commit

Permalink
[FEATURE] #130 : 프로필 화면에서 설문 클릭 시 내가 작성한 설문을 볼 수 있도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
tgyuuAn committed Feb 18, 2024
1 parent a1bf5fe commit beff37b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -67,6 +68,7 @@ internal fun ProfileRoute(
navigateToProfileSetting = navigateToProfileSetting,
navigateToAttendance = navigateToAttendance,
navigateToSignIn = navigateToSignIn,
navigateToSurveyDetail = navigateToSurveyDetail,
)
}

Expand All @@ -81,6 +83,7 @@ internal fun ProfileScreen(
navigateToProfileSetting: (String) -> Unit,
navigateToAttendance: () -> Unit,
navigateToSignIn: () -> Unit,
navigateToSurveyDetail: (String) -> Unit,
) {
val scrollState = rememberScrollState()

Expand Down Expand Up @@ -137,6 +140,7 @@ internal fun ProfileScreen(
userRespondedSurveysState = userRespondedSurveysState,
attendanceCardBoardColor = WappTheme.colors.blue4FF,
navigateToAttendance = navigateToAttendance,
navigateToSurveyDetail = navigateToSurveyDetail,
)
}

Expand All @@ -161,6 +165,7 @@ internal fun ProfileScreen(
userRespondedSurveysState = userRespondedSurveysState,
attendanceCardBoardColor = WappTheme.colors.yellow34,
navigateToAttendance = navigateToAttendance,
navigateToSurveyDetail = navigateToSurveyDetail,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -63,6 +64,7 @@ internal fun UserProfile(

MySurveyHistory(
userRespondedSurveysState = userRespondedSurveysState,
navigateToSurveyDetail = navigateToSurveyDetail,
modifier = Modifier.padding(vertical = 20.dp),
)
}
Expand Down Expand Up @@ -204,6 +206,7 @@ private fun MyAttendanceStatus(
@Composable
private fun MySurveyHistory(
userRespondedSurveysState: ProfileViewModel.SurveysState,
navigateToSurveyDetail: (String) -> Unit,
modifier: Modifier = Modifier,
) {
Column(modifier = modifier) {
Expand Down Expand Up @@ -243,7 +246,10 @@ private fun MySurveyHistory(
items = userRespondedSurveysState.surveys,
key = { survey -> survey.surveyId },
) { survey ->
WappSurveyHistoryRow(survey)
WappSurveyHistoryRow(
survey,
onClick = navigateToSurveyDetail,
)
}
}
}
Expand Down

0 comments on commit beff37b

Please sign in to comment.