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

Chip 구현 #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Chip 구현 #25

wants to merge 1 commit into from

Conversation

hoyaboi
Copy link

@hoyaboi hoyaboi commented Dec 30, 2024

Summary

Chip을 구현하였습니다.

  • 선택 여부에 따른 칩 상태 변경 구현
  • 비활성화 여부 설정
  • 텍스트 좌, 우측 아이콘 이미지 삽입

Describe your changes

Chip

@cometj03 cometj03 requested a review from a team December 31, 2024 02:48
@cometj03
Copy link
Member

@yourssu/android-maintainer 이걸로 리뷰어 요청하시면 됩니다!

Copy link
Member

@cometj03 cometj03 left a comment

Choose a reason for hiding this comment

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

깔끔하네요! 첫 PR 수고하셨습니다 👍

Comment on lines +37 to +40
fun Chip(
onCheckedChange: (Boolean) -> Unit,
modifier: Modifier = Modifier,
text: String,
Copy link
Member

Choose a reason for hiding this comment

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

onCheckedChange에도 기본 값을 두는 게 어떨까요?

Copy link
Member

@HI-JIN2 HI-JIN2 left a comment

Choose a reason for hiding this comment

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

호야님 수고많으셨습니다~!! 새해에도 같이 화이팅 해봐요🔥

Comment on lines +17 to +19
val iconSize: IconSize = IconSize.XS,
val horizontalPadding: Dp = 12.dp,
val round: Dp = 40.dp
Copy link
Member

Choose a reason for hiding this comment

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

이 부분이 chip의 사이즈에 영향을 받지 않는 부분이라면 파일 맨 끝에 아래와 같이 명시 하는게 어떠할까요? 상수 값을 따로 뺀다면 sealed class여야 할 이유도 없어 보입니다..! 지금도 너무 좋은 코드지만, 다른 핸디 컴포넌트 구현들과 구조를 맞추는게 좋지 아니할까 싶습니닷..!!

object DialogDefaults {
    val dialogWidth = 296.dp
    val dialogPadding = 20.dp
    val dialogInsidePadding = 16.dp
    val dialogButtonSpacing = 8.dp
}

Copy link
Member

Choose a reason for hiding this comment

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

기존에 구현된 컴포넌트 코드를 보니, 사이즈에 따라 타이포나 아이콘 사이즈 등이 달라지는 경우에는 sealed class, 단순 size 구분에는 enum class를 사용한 걸로 파악이 됩니다!

Copy link
Member

@kangyuri1114 kangyuri1114 left a comment

Choose a reason for hiding this comment

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

첫 PR 수고하셨습니다!!

Comment on lines +38 to +40
onCheckedChange: (Boolean) -> Unit,
modifier: Modifier = Modifier,
text: String,
Copy link
Member

Choose a reason for hiding this comment

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

기본값이 없는 파라미터(필수 파라미터)의 경우 modifier보다 위에 두는 것을 권장합니다! 기본값이 있는 optional 파라미터는 modifier 밑으로 두면됩니다

Suggested change
onCheckedChange: (Boolean) -> Unit,
modifier: Modifier = Modifier,
text: String,
onCheckedChange: (Boolean) -> Unit,
text: String,
modifier: Modifier = Modifier,

참고

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.

4 participants