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

[호두] 회원가입 미션 1, 2단계 제출합니다. #14

Open
wants to merge 15 commits into
base: junyoung-won
Choose a base branch
from

Conversation

Junyoung-WON
Copy link

@Junyoung-WON Junyoung-WON commented Oct 11, 2024

안녕하세요!! 꼬상~~~ 🐿️ 😆
오랜만이야!!!ㅋㅋㅋㅋㅋ
꼬상은 레벨 3때 선릉에서 한번 봤지만... 그래도 그립네요!!
오랜만에 미션에서 만나게 되었는데, 이번에는 리뷰어&리뷰이로 만났네요! 재밌을 것 같아요!!
열심히 공부해서 서로 많이 배워가고 이야기도 많이 나누면 좋겠습니다! 잘 부탁드려요~ 🙇‍♂️

나름 생각한대로 개선&리팩터링 해보았습니다!
그래도 아직은 이렇게 하는게 맞는지 잘 모르겠네요...

주요 구현 내용추가로 필요한 사항들을 아래에 정리해보았습니다!

주요 구현 내용

1단계

  • 학습 테스트 코드 작성 (d25c92f)

2단계

  • 입력 형식 생성 및 TextField 구성요소 작성 (b5ddd87) : 입력 형식(name, email, password)에 따라 다른 키보드 타입, 출력 형태를 보이도록 모델을 만들어 TextField에 활용하였습니다.
  • 버튼 구성요소 작성 (507c7f3)
  • 구성요소를 조합한 레이아웃 작성 (8b80a62) : 화면 크기가 달라져도 대응할 수 있도록 비율, 최소, 최대 너비 등을 지정했습니다.
  • 구성요소를 조합하여 화면 구성 (d17caa6)
  • 색상 구성 변경 및 MaterialTheme 커스텀 테마 설정(다크모드 대응) (a9801b6) : 다크 모드에 대한 테마도 함께 설정해보았습니다.
  • 타이포그래피 설정 (101980b)
  • 테마 및 타이포그래피 적용 (92b3e2a)

추가로 필요한 사항

  • 직접 만든 Composable 들에 대한 테스트 코드 작성이 필요합니다!
  • 구성요소들을 더욱 재사용하기 좋은 구성요소로 만들 수 있을 것 같습니다...!

@Junyoung-WON Junyoung-WON self-assigned this Oct 11, 2024
@kkosang
Copy link

kkosang commented Oct 11, 2024

작은 화면에서는 레이아웃이 겹쳐서 보이고 있습니다...!! 😱
스크린샷 2024-10-11 오후 10 52 54

Copy link

@kkosang kkosang left a comment

Choose a reason for hiding this comment

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

안녕하세요 호두~~ 😼
리뷰어&리뷰이로 만나게 되었는데 느낌이 새롭네요 !!
회원가입 미션동안 잘 부탁드립니다 ㅎㅎ

1,2단계 미션 요구사항 잘 구현해주신 것 같네요 !
특히 요구사항에 해당하는 부분을 커밋단위로 구분해주셔서 리뷰하기 편했습니다.
코멘트 몇개 남겨두었으니 확인 부탁드려요~

// 2. 힌트를 참고하여 Preview를 노출시킨다.
// 3. Preview의 interactive 모드를 활용하여 버튼을 클릭해본다.

class LayoutBasicsTest {
Copy link

Choose a reason for hiding this comment

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

오홍 README에 성공해야 하는 테스트를 추가했군요~~ 👍

)

@Composable
fun SignupTheme(
fun SignUpTheme(
Copy link

Choose a reason for hiding this comment

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

역시 호두.. 꼼꼼하게 다크모드까지 구현하셨네요 💯

text: String,
onClick: () -> Unit,
) {
SignUpTheme {
Copy link

Choose a reason for hiding this comment

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

(궁금🤔) 컴포넌트에 따로 테마를 지정해준 이유가 있나요 ?

현재 앱의 루트에서 SignUpTheme을 적용시켜주고 있는데 컴포넌트마다 따로 테마를 지정할 필요가 없을 것 같아요 !

import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.input.VisualTransformation

enum class InputType(
Copy link

Choose a reason for hiding this comment

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

헐 대박~ InputType에 대해 enum 클래스로 정의해두셨네요 !

저는 password에 대해서만 처리해줬어서 분리하지 않았는데, Email과 같은 다른 textfield가 추가되면 enum클래스로 관리할 수도 있겠네요 ! 👍

Copy link

Choose a reason for hiding this comment

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

전체적으로 Composable한 함수의 선언 위치가 큰 단위부터 작은 단위로 가는게 조금 더 가독성 있는 것 같아요 !
Layout부터 나오고 그 아래로 호출되는 Component 함수가 나오는게 자연스러운 것 같습니다 !
아마 그래서 호두가 @Preview 를 제일 위에 선언 한 것 같은데 Preview함수를 제일 밑에 선언하는게 관습? 컨벤션 이라고 하더라구요.

컴포즈 코드랩에서도 preview가 맨 밑에 있습니다 !

Composable
fun Greeting(name: String, modifier: Modifier = Modifier) {
    Surface(color = MaterialTheme.colorScheme.primary) {
        Text(
            text = "Hello $name!",
            modifier = modifier.padding(24.dp)
        )
    }
}

@Preview(showBackground = true)
@Composable
fun GreetingPreview() {
    BasicsCodelabTheme {
        MyApp()
    }
} 

}

@Composable
fun SignUpInteractionLayer(
Copy link

Choose a reason for hiding this comment

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

InteractionLayerSignUpLayout로 나누게 된 이유가 궁금합니다 !

) {
var value by rememberSaveable { mutableStateOf("") }
TextField(
modifier = Modifier
Copy link

Choose a reason for hiding this comment

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

지금처럼 OneLineTextInput 내부에서 modifier를 만들어서 관리한다면 해당 TextInput 컴포넌트는 동일한 modifier가 강제될 것 같은데 호두는 어떻게 생각하시나요??

Copy link

Choose a reason for hiding this comment

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

현재 Ktlint가 통과하지 않고 있어유 🥲

[*.{kt,kts}]
ktlint_function_naming_ignore_when_annotated_with=Composable

오둥이가 올려준 방법을 참고하여 Ktlint를 설정할 수 있을 것 같아요 !

val Typography = Typography(
bodyLarge = TextStyle(
titleLarge = TextStyle(
Copy link

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.

2 participants