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

feat: Tab 컴포넌트를 구현합니다. #37

Merged
merged 11 commits into from
Jul 24, 2024
Merged

feat: Tab 컴포넌트를 구현합니다. #37

merged 11 commits into from
Jul 24, 2024

Conversation

summermong
Copy link
Collaborator

@summermong summermong commented Jul 24, 2024

🤔 어떤 문제가 발생했나요?

  • 공통으로 사용하는 Tab 컴포넌트 생성

🎉 어떻게 해결했나요?

  • 큰 틀의 Tab과 클릭할 때마다 바뀌는 TabItem으로 분리

📷 이미지 첨부 (Option)

2024-07-24.5.59.07.mov

⚠️ 유의할 점! (Option)

TabItem에는 type, variant, selected, text, onClick을 주어야 합니다.
Tab에도 type, variant를 주어야 합니다.
주석 참고하시면 됩니다.

image

사용할 페이지에서 이렇게 useState와 onClick 함수를 사용해서 구현해야 할 것 같아요.
(이 부분은 더 좋은 아이디어가 있으시면 말씀 부탁드립니다 🥹)

@summermong summermong added feat # Add feature Review Plz🙏 # Review is not yet complete labels Jul 24, 2024
@summermong summermong changed the title Tab 컴포넌트를 구현합니다. feat: Tab 컴포넌트를 구현합니다. Jul 24, 2024
Copy link
Collaborator

@hjy0951 hjy0951 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~!

@@ -1 +1 @@
export { Button } from './button';
export { Button } from './Button';
Copy link
Collaborator

Choose a reason for hiding this comment

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

다시 되돌아간 대문자..

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

... 수정하겠슴다 🥹

Comment on lines +1 to +16
export type ButtonProps = {
size: 'large' | 'medium' | 'small';
disabled?: boolean;
label: string;
leftIcon?: boolean;
rightIcon?: boolean;
interaction: 'normal' | 'hovered' | 'focused' | 'pressed';
variant?: 'solid' | 'outlined' | 'text';
type?: 'primary' | 'secondary' | 'assistive';
};

export interface ButtonPropsWithIcons extends ButtonProps {
leftIconSrc?: string;
rightIconSrc?: string;
onClick?: () => void;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

여기는 확실히 다시 이야기를 해봐야겠네영~

type vs interface

Comment on lines +12 to +31
const tabStyles = css({
width:
type === 'primary' ? '375px' : type === 'assistive' ? '150px' : '335px',
height:
type === 'primary' ? '56px' : type === 'assistive' ? '34px' : '44px',
display: 'flex',
justifyContent: variant === 'fill' ? 'center' : 'left',
alignItems: 'center',
gap: '8px',
backgroundColor:
type === 'primary'
? 'white'
: type === 'assistive'
? ''
: 'background.gray',
borderBottom: type === 'primary' ? '1px solid' : '',
borderColor: type === 'primary' ? 'line.neutral' : '',
borderRadius: type === 'primary' ? '' : type === 'assistive' ? '' : '12px',
padding: type === 'primary' ? '' : '3px',
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

type을 기준으로 여러 css 스타일을 만들어서 cx로 묶는 방식도 괜찮은 것 같아요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ㅠㅠ 이 부분은 객체로 한 번 묶어서 리팩토링 시도해봤었는데, 어제 말한대로 적용이 안됐어서 고민이었는데 cx 참고해보겠습니닷! 감사합니두 👍🏻👍🏻

@king2dwellsang king2dwellsang added Approved 🆗 # Review is completed and removed Review Plz🙏 # Review is not yet complete labels Jul 24, 2024
@summermong summermong merged commit bd3568c into main Jul 24, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved 🆗 # Review is completed feat # Add feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants