Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/#11 week7 #12

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open

Feat/#11 week7 #12

wants to merge 9 commits into from

Conversation

hyoeunjoo
Copy link
Collaborator

Related issue ๐Ÿ› 

Work Description โœ๏ธ

  • MVI๊ตฌ์กฐ ์ ์šฉํ•ด๋ดค์Šต๋‹ˆ๋‹ค.

Screenshot ๐Ÿ“ธ

Uncompleted Tasks ๐Ÿ˜…

To Reviewers ๐Ÿ“ข

์•„์ง UI๋‹จ์— ์žˆ์œผ๋ฉด ์•ˆ๋˜๋Š” ์ฝ”๋“œ๋“ค์ด ์—ฌ๋Ÿฟ ๋ณด์ž…๋‹ˆ๋‹ค.. ๋จธ์“ฑ
ํ•ด๋‹น ๋ถ€๋ถ„์€ ์ธ์ง€ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ํ•™๊ต ๊ณผ์ œ๊ฐ€ ๋๋‚˜๋Š”๋Œ€๋กœ ๋‹ค์‹œ ๋ถ„๋ฆฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
MVI๊ฐ€ ์ฒ˜์Œ์ด๋ผ ๋ถ€์กฑํ•œ ๋ถ€๋ถ„์ด ๋งŽ์„ํ…๋ฐ ๋”ฐ๋”ํ•œ ์ง€์  ๋ถ€ํƒ๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค!
ํ•ญ์ƒ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค

Copy link

@imtaejugkim imtaejugkim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7์ฃผ์ฐจ ๊ณผ์ œ ๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค! ์ œ๊ฐ€ MVI ์ฝ”๋“œ๋ฅผ ์ž˜ ์ดํ•ดํ•˜์ง€ ๋ชปํ•ด์„œ, ์ฝ”๋“œ ์ฐธ๊ณ ๋ฅผ ๋งŽ์ด ํ•˜๊ณ  ๋ฐฐ์šธ ์ˆ˜ ์žˆ์—ˆ๋˜ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.. ๊ณ ์ƒํ•˜์…จ์–ด์š”!

Comment on lines +80 to +84
text = when {
uiState.isLoading -> "๋กœ๋”ฉ ์ค‘..."
uiState.hobby.isNotEmpty() -> uiState.hobby
else -> "์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค"
},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋กœ๋”ฉ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ๋„ ํ•˜์…จ๋„ค์š”!

Comment on lines +53 to +60
viewModel.sideEffect.collectLatest { sideEffect ->
when (sideEffect) {
is MyPageContract.MyPageSideEffect.ShowErrorToast -> {
Toast.makeText(context, sideEffect.message, Toast.LENGTH_SHORT).show()
}
}
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collectLatest๋Š” ์–ด๋–ค ๋™์žฅ ๋ฐฉ์‹์˜ ์—ฐ์‚ฐ์ž์ธ๊ฐ€์š”?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ €๋„ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค!!

Copy link

@sayyyho sayyyho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ €๋Š” MVI ๊ตฌํ˜„ํ•  ๋•Œ, ์–ด๋ ค์›€ ๋งŽ์ด ๊ฒช์—ˆ๋Š”๋ฐ ํšจ์€๋‹˜ ์ฝ”๋“œ์—์„œ ์˜๊ฐ์„ ๋งŽ์ด ์–ป์–ด๊ฐ‘๋‹ˆ๋‹ค!! ๋„ˆ๋ฌด ์ž˜ํ•˜์…”์„œ ํƒœ์ •์ดํ˜•์ด๋ž‘ ๊ถ๊ธˆํ•œ ๋‚ด์šฉ ์ผ์น˜ํ•˜๋Š” ๋ถ€๋ถ„๋งŒ ์งˆ๋ฌธ ๋‚จ๊ฒผ์–ด์š”!! ๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค! ์•ฑ์žผํŒŒ์ดํŒ…~

Comment on lines +53 to +60
viewModel.sideEffect.collectLatest { sideEffect ->
when (sideEffect) {
is MyPageContract.MyPageSideEffect.ShowErrorToast -> {
Toast.makeText(context, sideEffect.message, Toast.LENGTH_SHORT).show()
}
}
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ €๋„ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค!!

Comment on lines +7 to +27
class SignUpContract {
data class SignUpState(
val email: String = "",
val password: String = "",
val hobby: String = "",
val isLoading: Boolean = false,
val errorMessage: String? = null
) : UiState

sealed class SignUpEvent : UiEvent {
data class UpdateEmail(val email: String) : SignUpEvent()
data class UpdatePassword(val password: String) : SignUpEvent()
data class UpdateHobby(val hobby: String) : SignUpEvent()
data object SubmitSignUp : SignUpEvent()
}

sealed class SignUpSideEffect:UiSideEffect {
data object NavigateToLogin : SignUpSideEffect()
data class ShowSnackbar(val message: String) : SignUpSideEffect()
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊น”๋”ํ•˜๋„ค์š” ๐Ÿ‘๐Ÿป๐Ÿ‘๐Ÿป

Comment on lines +62 to +78
LaunchedEffect(Unit) {
viewModel.sideEffect.collectLatest { sideEffect ->
when (sideEffect) {
is LoginContract.LoginSideEffect.NavigateToMyPageWithToken -> {
saveAuthToken(context, sideEffect.token)
navController.navigate("mypage") {
popUpTo("login") { inclusive = true }
}
}

is LoginContract.LoginSideEffect.ShowSnackbar -> {
snackbarHostState.showSnackbar(sideEffect.message)
}
}
}
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด๋Ÿฐ์‹์œผ๋กœ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๊ฒ ๋„ค์š”! ๋ฐฐ์›Œ๊ฐ‘๋‹ˆ๋‹ค!!

Copy link
Contributor

@jihyunniiii jihyunniiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ณ ์ƒํ•˜์…จ์Šต๋‹ˆ๋‹ค ~

val loginPassword by viewModel.password.collectAsState()
var passwordVisible by remember { mutableStateOf(false) }
fun LoginScreen(navController: NavController, viewModel: LoginViewModel = hiltViewModel()) {
val uiState by viewModel.uiState.collectAsState()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collectAsStateWithLifecycle์„ ์‚ฌ์šฉํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค ~ (์™œ์ธ์ง€๋Š” ์„ธ๋ฏธ๋‚˜ ์ž๋ฃŒ ์ฐธ๊ณ  !!)

val loginEmail by viewModel.email.collectAsState()
val loginPassword by viewModel.password.collectAsState()
var passwordVisible by remember { mutableStateOf(false) }
fun LoginScreen(navController: NavController, viewModel: LoginViewModel = hiltViewModel()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NavController ๊ฐ์ฒด ์ž์ฒด๋ฅผ ๋„˜๊ธฐ๋Š” ๊ฒƒ๋ณด๋‹ค ์ด๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ํ•จ์ˆ˜๋ฅผ ๋„˜๊ฒจ์ฃผ์‹œ๋Š” ๊ฒŒ ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”!
NavController ๊ฐ์ฒด ์ž์ฒด๋ฅผ ๋„˜๊ธฐ๊ฒŒ ๋˜๋ฉด LoginScreen์ด ๋„ค๋น„๊ฒŒ์ด์…˜๊ณผ ๊ด€๋ จ๋œ ์ฑ…์ž„๋„ ๊ฐ€์ง€๊ฒŒ ๋˜์–ด์„œ ๊ทธ ์—ญํ• ์ด ๋ฌด๊ฑฐ์›Œ ์ง‘๋‹ˆ๋‹ค.
๋˜ํ•œ, ํ…Œ์ŠคํŠธ ๋“ฑ์ด ์–ด๋ ต๊ฒŒ ๋˜์–ด์š”!

Comment on lines +128 to +130
text1 = stringResource(R.string.login_find_id),
text2 = stringResource(R.string.login_setting_password_again),
text3 = stringResource(R.string.sign_up),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์กฐ๊ธˆ ๋” ์ง๊ด€์ ์ธ ๋„ค์ด๋ฐ์„ ์‚ฌ์šฉํ•ด ์ฃผ์…”๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™๋„ค์š” !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] ์ฃผ์ฐจ ๊ณผ์ œ ๊ตฌํ˜„
4 participants