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

공통 button 컴포넌트 추가한다 #33

Merged
merged 11 commits into from
May 21, 2023
Merged

공통 button 컴포넌트 추가한다 #33

merged 11 commits into from
May 21, 2023

Conversation

yunjin-kim
Copy link
Contributor

작업내용

IconButton, TextButton 구현했습니다.
IconButton에서 disabled 처리가 필요한가? 필요하다면 opacity 조절을 통해 해도 괜찮은가? 이 두 의문이 들긴합니다..!

close #4

@yunjin-kim yunjin-kim added the payments💳 페이먼츠 팀 이슈입니다 label May 7, 2023
@yunjin-kim yunjin-kim requested review from liswktjs and soyi47 May 7, 2023 07:38
@yunjin-kim yunjin-kim self-assigned this May 7, 2023
@yunjin-kim yunjin-kim linked an issue May 7, 2023 that may be closed by this pull request
@intae92 intae92 changed the base branch from release-w18 to release-w19 May 8, 2023 14:12
Copy link
Contributor

@soyi47 soyi47 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. 지금 Opacity로 disabled 처리 해둔 거 같은데, 이왕 해둔 거 이 방식으로 가도 괜찮을 것 같습니다! 👍

고생하셨습니당! 리뷰 확인해주세요! 👏👏👏

height?: number;
isDisabled?: boolean;
children: string;
onClick?(): void;
Copy link
Contributor

Choose a reason for hiding this comment

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

저는 보통 요런 Prop에 EventHandler 타입을 주는 편입니당!

Copy link
Contributor Author

@yunjin-kim yunjin-kim May 9, 2023

Choose a reason for hiding this comment

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

  onClick?(): React.MouseEvent<HTMLButtonElement>;

이렇게를 의미하는 것이 맞을까요?

Copy link
Contributor

@soyi47 soyi47 May 11, 2023

Choose a reason for hiding this comment

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

onClick?: React.MouseEvent<HTMLButtonElement>;

저는 요런 식으로 줍니다! 취향인 것도 같으니 참고만 하셔요!

Copy link
Contributor Author

@yunjin-kim yunjin-kim May 16, 2023

Choose a reason for hiding this comment

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

onClick?: React.MouseEventHandler<HTMLButtonElement>;

이 타입으로 변경했습니다.
onClick?(): React.MouseEvent<HTMLButtonElement>; <- 이 타입은 반환타입이 React.MouseEvent<HTMLButtonElement>; 이것을 의미해서 올바르지 못한 타입이였네요.

Comment on lines 4 to 12
interface TextButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
variant: 'contained' | 'outlined' | 'text';
fontSize?: number;
padding?: string;
isDisabled?: boolean;
children: string;
onClick?(): void;
onSubmit?(): void;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

variant가 contained | outlined | text니까
컴포넌트 이름을 그냥 Button으로 하고 contained를 default로 주면 어떨까요?

Copy link
Contributor Author

@yunjin-kim yunjin-kim May 9, 2023

Choose a reason for hiding this comment

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

좋습니다~
c9108ec

Comment on lines 21 to 31
${({ padding, buttonStyles, isDisabled, theme }) => `
padding: ${padding};
background: ${theme.colors[buttonStyles.back[isDisabled]]};
border: ${
buttonStyles.line[isDisabled] === 'none'
? 'none'
: `1px solid ${theme.colors[buttonStyles.line[isDisabled]]}`
};
cursor: ${isDisabled === 'disabled' ? ' not-allowed' : 'pointer'};
`}
`;
Copy link
Contributor

Choose a reason for hiding this comment

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

사용자가 주요 컬러를 커스텀할 수 있도록 prop을 제공해야하려나?! 필요 없으려나?! 싶은 생각이 듭니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

그 고민을 안 한건 아닌데...color를 받을지 말지는 payment 컴포넌트 모두 통일하는 것이 좋을 것 같습니다. 그래서 회의 때 결정하시죠!

Copy link
Contributor

@liswktjs liswktjs left a comment

Choose a reason for hiding this comment

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

회의때 color custom 관련 논의가 있었는데 결이 한 코드를 보면 color를 선택 가능하게 하는 것도 힘든 작업이 될 것 같네요...혹시 어떻게 하기로 결정하셨나요? (뭐가 됐든 화이팅!)

Comment on lines 5 to 14
variant: 'contained' | 'outlined' | 'text';
fontSize?: number;
padding?: string;
isDisabled?: boolean;
children: string;
onClick?(): React.MouseEvent<HTMLButtonElement>;
onSubmit?(): React.FormEvent<HTMLButtonElement>;
}

type ButtonVariant = 'contained' | 'outlined' | 'text';
Copy link
Contributor

Choose a reason for hiding this comment

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

variant 타입에 만들어 두신 ButtonVariant 적용하면 좋을 것 같습니다 !

};
};

export const buttonColorSet: ButtonStylesConfig = {
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
Contributor Author

Choose a reason for hiding this comment

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

넵 그렇습니다

Comment on lines 23 to 28
background: ${theme.colors[buttonStyles.back[isDisabled]]};
border: ${
buttonStyles.line[isDisabled] === 'none'
? 'none'
: `1px solid ${theme.colors[buttonStyles.line[isDisabled]]}`
};
Copy link
Contributor

Choose a reason for hiding this comment

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

요기 color custom가능하게 되면 바뀌는 코드이나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

아뇹 아직 color를 사용측에서 받는 코드는 없는 상태라서

Comment on lines 44 to 48
},
outlined: {
text: {
default: 'PRIMARY',
disabled: 'GRAY_200'
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
Contributor Author

Choose a reason for hiding this comment

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

노션에 적혀있는 것을 보면 primary color 정도만 받기로 했습니당

@intae92 intae92 changed the base branch from release-w19 to release-w20 May 14, 2023 18:12
@yunjin-kim yunjin-kim requested review from soyi47 and liswktjs May 16, 2023 00:12
@yunjin-kim yunjin-kim merged commit 779a54c into release-w20 May 21, 2023
@yunjin-kim yunjin-kim deleted the feat/4 branch May 21, 2023 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
payments💳 페이먼츠 팀 이슈입니다 release-w20
Projects
None yet
Development

Successfully merging this pull request may close these issues.

공통 button 컴포넌트 추가한다
4 participants