diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 50de6273..c5c944fe 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -43,21 +43,21 @@ dependencies { androidTestImplementation(libs.androidx.test.espresso) } -tasks.getByPath(":app:preBuild").dependsOn("installGitHook") - -tasks.register("installGitHook") { - dependsOn("deletePreviousGitHook") - from("${rootProject.rootDir}/script/pre-commit") - into("${rootProject.rootDir}/.git/hooks") - eachFile { - fileMode = 777 - } -} - -tasks.register("deletePreviousGitHook") { - - val prePush = "${rootProject.rootDir}/.git/hooks/pre-commit" - if (file(prePush).exists()) { - delete(prePush) - } -} +// tasks.getByPath(":app:preBuild").dependsOn("installGitHook") +// +// tasks.register("installGitHook") { +// dependsOn("deletePreviousGitHook") +// from("${rootProject.rootDir}/script/pre-commit") +// into("${rootProject.rootDir}/.git/hooks") +// eachFile { +// fileMode = 777 +// } +// } +// +// tasks.register("deletePreviousGitHook") { +// +// val prePush = "${rootProject.rootDir}/.git/hooks/pre-commit" +// if (file(prePush).exists()) { +// delete(prePush) +// } +// } diff --git a/app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt b/app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt index 7c8d57e0..e939d29e 100644 --- a/app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt +++ b/app/src/main/java/com/wap/wapp/navigation/WappNavHost.kt @@ -61,7 +61,7 @@ fun WappNavHost( ) noticeScreen() surveyNavGraph( - navigateToSurvey = navController::navigateToSurvey , + navigateToSurvey = navController::navigateToSurvey, navigateToSurveyAnswer = navController::navigateToSurveyAnswer, ) surveyCheckScreen( 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 5bfc8ee7..03790602 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 @@ -70,7 +70,7 @@ internal fun ProfileScreen( ) } - WappProfileCard(isManager = true, userName = "태규") + WappProfileCard(role = Role.NORMAL, userName = "태규") Box( modifier = Modifier diff --git a/feature/profile/src/main/java/com/wap/wapp/feature/profile/Role.kt b/feature/profile/src/main/java/com/wap/wapp/feature/profile/Role.kt new file mode 100644 index 00000000..94048aa6 --- /dev/null +++ b/feature/profile/src/main/java/com/wap/wapp/feature/profile/Role.kt @@ -0,0 +1,5 @@ +package com.wap.wapp.feature.profile + +enum class Role { + MANAGER, NORMAL, GUEST +} diff --git a/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappProfileCard.kt b/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappProfileCard.kt index 3c721ffc..6665bbff 100644 --- a/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappProfileCard.kt +++ b/feature/profile/src/main/java/com/wap/wapp/feature/profile/component/WappProfileCard.kt @@ -24,34 +24,57 @@ import androidx.compose.ui.unit.sp import com.wap.designsystem.WappTheme import com.wap.wapp.core.designresource.R.drawable import com.wap.wapp.feature.profile.R +import com.wap.wapp.feature.profile.Role @Composable internal fun WappProfileCard( - isManager: Boolean, + role: Role, userName: String, ) { - var position = stringResource(R.string.normal) - var githubImage = drawable.ic_normal_github - var catImage = drawable.ic_normal_cat - var brush = Brush.horizontalGradient( - listOf( - WappTheme.colors.yellow3C, - WappTheme.colors.yellow34, - WappTheme.colors.yellowA4, - ), - ) + var position: String? = null + var githubImage: Int? = null + var catImage: Int? = null + var brush: Brush? = null - if (isManager) { - position = stringResource(R.string.manager) - githubImage = drawable.ic_manager_github - catImage = drawable.ic_manager_cat - brush = Brush.horizontalGradient( - listOf( - WappTheme.colors.blue2FF, - WappTheme.colors.blue4FF, - WappTheme.colors.blue1FF, - ), - ) + when (role) { + Role.MANAGER -> { + position = stringResource(R.string.manager) + githubImage = drawable.ic_manager_github + catImage = drawable.ic_manager_cat + brush = Brush.horizontalGradient( + listOf( + WappTheme.colors.blue2FF, + WappTheme.colors.blue4FF, + WappTheme.colors.blue1FF, + ), + ) + } + + Role.NORMAL -> { + position = stringResource(R.string.normal) + githubImage = drawable.ic_normal_github + catImage = drawable.ic_normal_cat + brush = Brush.horizontalGradient( + listOf( + WappTheme.colors.yellow3C, + WappTheme.colors.yellow34, + WappTheme.colors.yellowA4, + ), + ) + } + + Role.GUEST -> { + position = stringResource(R.string.manager) + githubImage = drawable.ic_manager_github + catImage = drawable.ic_manager_cat + brush = Brush.horizontalGradient( + listOf( + WappTheme.colors.blue2FF, + WappTheme.colors.blue4FF, + WappTheme.colors.blue1FF, + ), + ) + } } Card( @@ -108,11 +131,11 @@ internal fun WappProfileCard( @Preview @Composable private fun NormalProfileCard() { - WappProfileCard(isManager = false, userName = "WAPP") + WappProfileCard(role = Role.NORMAL, userName = "WAPP") } @Preview @Composable private fun ManagerProfileCard() { - WappProfileCard(isManager = true, userName = "WAPP") + WappProfileCard(role = Role.MANAGER, userName = "WAPP") } diff --git a/feature/profile/src/main/res/values/strings.xml b/feature/profile/src/main/res/values/strings.xml index 9d76bd68..a5a8c462 100644 --- a/feature/profile/src/main/res/values/strings.xml +++ b/feature/profile/src/main/res/values/strings.xml @@ -2,6 +2,7 @@ 마이 페이지 설정으로 가는 톱니바퀴 모양 버튼입니다. 일반 회원 운영진 + 게스티 프로필 출석 결석 diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/ObjectiveSurveyForm.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/ObjectiveSurveyForm.kt index bfca8e3a..2c3a3150 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/ObjectiveSurveyForm.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/ObjectiveSurveyForm.kt @@ -1,5 +1,6 @@ package com.wap.wapp.feature.survey.answer +import android.media.Rating import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement diff --git a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerViewModel.kt b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerViewModel.kt index 0ff9897b..d63c891f 100644 --- a/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerViewModel.kt +++ b/feature/survey/src/main/java/com/wap/wapp/feature/survey/answer/SurveyAnswerViewModel.kt @@ -60,7 +60,8 @@ class SurveyAnswerViewModel @Inject constructor( when (surveyQuestion.questionType) { QuestionType.SUBJECTIVE -> { - surveyAnswerList.value.add( // 현재 질문 답변 리스트에 저장 + surveyAnswerList.value.add( + // 현재 질문 답변 리스트에 저장 SurveyAnswer( questionType = surveyQuestion.questionType, questionTitle = surveyQuestion.questionTitle, @@ -87,7 +88,7 @@ class SurveyAnswerViewModel @Inject constructor( val currentQuestionNumber = _questionNumber.value val lastQuestionNumber = surveyAnswerList.value.size - if(currentQuestionNumber == lastQuestionNumber) { // 마지막 질문일 경우 제출 + if (currentQuestionNumber == lastQuestionNumber) { // 마지막 질문일 경우 제출 submitSurvey() return } @@ -97,19 +98,28 @@ class SurveyAnswerViewModel @Inject constructor( private fun submitSurvey() { viewModelScope.launch { - } } - fun setSubjectiveAnswer(answer: String) { _subjectiveAnswer.value = answer } + fun setSubjectiveAnswer(answer: String) { + _subjectiveAnswer.value = answer + } - fun setObjectiveAnswer(answer: Rating) { _objectiveAnswer.value = answer } + fun setObjectiveAnswer(answer: Rating) { + _objectiveAnswer.value = answer + } - private fun addQuestionNumber() { _questionNumber.value += 1 } + private fun addQuestionNumber() { + _questionNumber.value += 1 + } - private fun clearSubjectiveAnswer() { _subjectiveAnswer.value = "" } + private fun clearSubjectiveAnswer() { + _subjectiveAnswer.value = "" + } - private fun clearObjectiveAnswer() { _objectiveAnswer.value = Rating.GOOD } + private fun clearObjectiveAnswer() { + _objectiveAnswer.value = Rating.GOOD + } sealed class SurveyFormUiState { data object Init : SurveyFormUiState()