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

[UI/#14] 회원가입 뷰 / UI 구현 #46

Merged
merged 24 commits into from
Jul 11, 2024
Merged

Conversation

leeeyubin
Copy link
Member

@leeeyubin leeeyubin commented Jul 10, 2024

⛳️ Work Description

  • 회원가입 뷰 UI 구현
  • 회원 이름 로직 구현
  • NameTextField 속성 수정
  • SignUpBottomSheet 연결
  • 글자 12자로 막기

📸 Screenshot

Screen_Recording_20240711_071321_Terning-Android.mp4

📢 To Reviewers

  • 바텀시트에서 저장버튼 눌렀을 때 다시 스르륵 내려가게 하는 건 효빈언니 머지하고 구현할게요!!

@leeeyubin leeeyubin added UI 💐 UI 작업 유빈💙 유빈 labels Jul 10, 2024
@leeeyubin leeeyubin added this to the 1차 스프린트 UI 작업 milestone Jul 10, 2024
@leeeyubin leeeyubin self-assigned this Jul 10, 2024
@leeeyubin leeeyubin changed the title [UI/#14] on boarding [UI/#14] 회원가입 뷰 / UI 구현 Jul 10, 2024
Copy link
Member

@Hyobeen-Park Hyobeen-Park left a comment

Choose a reason for hiding this comment

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

힐트 잘 적용한거 멋있다... Regex 잘쓴거 멋있다... 최고에요!!

Comment on lines +55 to +62
const val NAME_ERROR = "[!@#\$%^&*(),.?\":{}|<>\\[\\]\\\\/]"
const val HELPER = "12자리 이내, 문자/숫자 가능, 특수문자/기호 입력불가"
private const val MAX_LENGTH = 12
private const val HELPER_ERROR = "이름에 특수문자는 입력할 수 없어요"
private const val HELPER_AVAILABLE = "이용 가능한 이름이에요"
}
}
Copy link
Member

Choose a reason for hiding this comment

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

여기도 string으로 빼는게 가능할까요?? 가능하다면 string 분리하는게 더 좋을 것 같아서요...!

Copy link
Member Author

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)
Copy link
Member

Choose a reason for hiding this comment

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

Regex!! 새롭게 알아갑니다ㅎㅎㅎㅎ

Copy link
Contributor

@arinming arinming left a comment

Choose a reason for hiding this comment

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

텍스트필드 적용 완벽하네요 뷰모델써서,,,, 개큰skrr

Comment on lines +33 to +36
signUpViewModel: SignUpViewModel = hiltViewModel(),
navController: NavController
) {
val signUpState by signUpViewModel.state.collectAsStateWithLifecycle()
Copy link
Contributor

Choose a reason for hiding this comment

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

SignUpScreen이 아니라 SignUpRoute에서 뷰모델을 생성해서 넘기는 이유가 있나용!?? .....진짜모름

Copy link
Member Author

Choose a reason for hiding this comment

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

저는 화면을 그리는 UI하고 다른 로직을 적는 걸 분리하고 싶어서 SignUpRoute에서 생성했었습니다!
나중에 성공했을 때의 로직만 screen으로 넘기도록 리팩해볼게요!

Comment on lines +105 to +108
onValueChange = { name ->
signUpViewModel.isInputValid(name)
},
Copy link
Contributor

Choose a reason for hiding this comment

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

뷰모델 네이밍 방식 통일해야 할 것 같은데 얘기해보면 좋을 것 같습니당!~!~~! ~~~!

Comment on lines 26 to 51
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
)
Copy link
Contributor

Choose a reason for hiding this comment

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

이렇게 한번에 관리하니까 직관적이네요 ㅜ ㅜ 🥹

Copy link
Member

@boiledEgg-s boiledEgg-s left a comment

Choose a reason for hiding this comment

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

역시 리드의 코드는 굉장하네요~
이정도의 코드를 보여준다면 달산가도 됩니다!!

Copy link
Member

Choose a reason for hiding this comment

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

나중에 리컴포지션에 대한 리팩토링을 하게 된다면, 뷰모델에서 텍스트를 관리하는 것보단 스크린 자체에서 관리를 하는 방향의 수정을 시도해봐도 좋을 것 같아요!!

@leeeyubin leeeyubin merged commit 84d7ec3 into develop Jul 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI 💐 UI 작업 유빈💙 유빈
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UI] 회원가입 뷰 / UI 구현
4 participants