Skip to content

Commit

Permalink
Merge pull request #42 from MONEYMONG/feature/moneymong-520-플로우-개선작업
Browse files Browse the repository at this point in the history
moneymong-520 feat: 회원가입 플로우 개선 작업
  • Loading branch information
eunseo0105 authored Dec 30, 2024
2 parents 770036c + aefa3d5 commit fc6d538
Show file tree
Hide file tree
Showing 23 changed files with 825 additions and 250 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ fun MDSButton(
@DrawableRes iconResource: Int? = null,
enabled: Boolean = true,
contentHorizontalPadding: Dp = 0.dp,
cornerShape : Dp = 10.dp,
) {
val backgroundColor = if (enabled) type.backgroundColor else disabledBackgroundColor
val contentColor = if (enabled) type.contentColor else disabledContentColor
Expand All @@ -38,10 +39,10 @@ fun MDSButton(
modifier = modifier
.background(
color = backgroundColor,
shape = RoundedCornerShape(10.dp)
shape = RoundedCornerShape(cornerShape)
)
.clip(
RoundedCornerShape(10.dp)
RoundedCornerShape(cornerShape)
)
.clickable(
onClick = onClick,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.moneymong.moneymong.model.sign

data class UnivResponse(
val universityName: String,
val grade: Int
val universityName: String?,
val grade: Int?
)
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class AgencySearchViewModel @Inject constructor(
isLoading = false,
joinedAgencies = fetchMyAgenciesResult.getOrThrow()
.map { myAgencyResponse -> myAgencyResponse.toAgency() },
isUniversityStudent = fetchMyUniversityResult.getOrThrow().universityName.isNotBlank(),
isUniversityStudent = fetchMyUniversityResult.getOrThrow().universityName?.isNotBlank() ?: false ,
)
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ import com.moneymong.moneymong.feature.sign.navigation.loginScreen
import com.moneymong.moneymong.feature.sign.navigation.navigateLogin
import com.moneymong.moneymong.feature.sign.navigation.navigateSignComplete
import com.moneymong.moneymong.feature.sign.navigation.navigateSignUp
import com.moneymong.moneymong.feature.sign.navigation.navigateSignUpUniversity
import com.moneymong.moneymong.feature.sign.navigation.signCompleteScreen
import com.moneymong.moneymong.feature.sign.navigation.signUpScreen
import com.moneymong.moneymong.feature.sign.navigation.signUpUniversity
import com.moneymong.moneymong.feature.sign.navigation.splashRoute
import com.moneymong.moneymong.feature.sign.navigation.splashScreen
import com.moneymong.moneymong.home.navigation.rememberHomeNavigator
Expand Down Expand Up @@ -99,7 +101,15 @@ fun HomeScreen(
)

signUpScreen(
navigateToSignComplete = homeNavController::navigateSignComplete,
navigateToLedger = homeNavController::navigateLedger,
navigateToSignUniversity = homeNavController::navigateSignUpUniversity,
navigateToAgency = homeNavController::navigateAgency,
navigateUp = homeNavController::navigateUp
)

signUpUniversity(
navigateToLedger = homeNavController::navigateLedger,
navigateToAgency = homeNavController::navigateAgency,
navigateUp = homeNavController::navigateUp
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ fun MyMongScreen(
name = state.name,
email = state.email,
university = state.university,
grade = state.grade,
getInfo = viewModel::getInfo
)
Spacer(modifier = Modifier.height(16.dp))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ data class MyMongState(
val name: String = "",
val email: String = "",
val university: String = "",
val grade: Int = 0,
val infoErrorMessage: String = "",
val logoutErrorMessage: String = "",
val isInfoLoading: Boolean = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class MyMongViewModel @Inject constructor(
name = it.name,
email = it.email,
university = it.university.orEmpty(),
grade = it.grade
)
}
}.onFailure {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ internal fun MyMongInfoView(
name: String,
email: String,
university: String,
grade: Int,
getInfo: () -> Unit
) {
Box(
Expand All @@ -66,10 +65,7 @@ internal fun MyMongInfoView(
email = email
)
Spacer(modifier = Modifier.height(20.dp))
UniversityInfo(
university = university,
grade = grade
)
UniversityInfo(university = university)
}
}
}
Expand Down Expand Up @@ -123,14 +119,10 @@ private fun Profile(

@Composable
fun UniversityInfo(
university: String,
grade: Int
university: String
) {
val universityInfoText = when {
university.isEmpty() -> "정보 없음"
grade == 5 -> "$university ${grade}학년 이상"
else -> "$university ${grade}학년"
}

val universityInfoText = university.ifEmpty { "정보 없음" }

Box(
modifier = Modifier
Expand Down
Loading

0 comments on commit fc6d538

Please sign in to comment.