-
Notifications
You must be signed in to change notification settings - Fork 1
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
[UI/#14] 회원가입 뷰 / UI 구현 #46
Conversation
into ui/#14-on-boarding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
힐트 잘 적용한거 멋있다... Regex 잘쓴거 멋있다... 최고에요!!
const val NAME_ERROR = "[!@#\$%^&*(),.?\":{}|<>\\[\\]\\\\/]" | ||
const val HELPER = "12자리 이내, 문자/숫자 가능, 특수문자/기호 입력불가" | ||
private const val MAX_LENGTH = 12 | ||
private const val HELPER_ERROR = "이름에 특수문자는 입력할 수 없어요" | ||
private const val HELPER_AVAILABLE = "이용 가능한 이름이에요" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 string으로 빼는게 가능할까요?? 가능하다면 string 분리하는게 더 좋을 것 같아서요...!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 그렇게 생각하는데 뷰모델에서 제대로 추출이 안 돼서,, 추후에 더 해보겠습니당
|
||
fun isInputValid(name: String) { | ||
val nameErrorRegex = Regex(NAME_ERROR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regex!! 새롭게 알아갑니다ㅎㅎㅎㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
텍스트필드 적용 완벽하네요 뷰모델써서,,,, 개큰skrr
signUpViewModel: SignUpViewModel = hiltViewModel(), | ||
navController: NavController | ||
) { | ||
val signUpState by signUpViewModel.state.collectAsStateWithLifecycle() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SignUpScreen이 아니라 SignUpRoute에서 뷰모델을 생성해서 넘기는 이유가 있나용!?? .....진짜모름
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는 화면을 그리는 UI하고 다른 로직을 적는 걸 분리하고 싶어서 SignUpRoute에서 생성했었습니다!
나중에 성공했을 때의 로직만 screen으로 넘기도록 리팩해볼게요!
onValueChange = { name -> | ||
signUpViewModel.isInputValid(name) | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
뷰모델 네이밍 방식 통일해야 할 것 같은데 얘기해보면 좋을 것 같습니당!~!~~! ~~~!
name = trimmedName, | ||
drawLineColor = WarningRed, | ||
helper = HELPER_ERROR, | ||
helperIcon = R.drawable.ic_sign_up_error, | ||
helperColor = WarningRed, | ||
isButtonValid = false | ||
) | ||
|
||
trimmedName.isEmpty() -> _state.value = _state.value.copy( | ||
name = trimmedName, | ||
drawLineColor = Grey500, | ||
helper = HELPER, | ||
helperIcon = null, | ||
helperColor = Grey400, | ||
isButtonValid = false | ||
) | ||
|
||
else -> _state.value = _state.value.copy( | ||
name = trimmedName, | ||
drawLineColor = TerningMain, | ||
helper = HELPER_AVAILABLE, | ||
helperIcon = R.drawable.ic_sign_up_available, | ||
helperColor = TerningMain, | ||
isButtonValid = true | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이렇게 한번에 관리하니까 직관적이네요 ㅜ ㅜ 🥹
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
역시 리드의 코드는 굉장하네요~
이정도의 코드를 보여준다면 달산가도 됩니다!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
나중에 리컴포지션에 대한 리팩토링을 하게 된다면, 뷰모델에서 텍스트를 관리하는 것보단 스크린 자체에서 관리를 하는 방향의 수정을 시도해봐도 좋을 것 같아요!!
⛳️ Work Description
📸 Screenshot
Screen_Recording_20240711_071321_Terning-Android.mp4
📢 To Reviewers