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] 마감기한 공통컴포넌트 퍼블리싱 #39

Merged
merged 7 commits into from
Jul 7, 2024

Conversation

Kjiw0n
Copy link
Contributor

@Kjiw0n Kjiw0n commented Jul 7, 2024

작업 내용 🧑‍💻

  • 마감기한 관련 공통 컴포넌트 2개를 생성하였습니다!
    • BtnDate.tsx
    • BtnStagingDate.tsx

알게된 점 🚀

기록하며 개발하기!

  • hover 시 다른 요소의 속성을 설정할 때 에러가 나는 경우, target 설정을 통해 해결 가능하다.

     const CalanderIcon = styled(Icons.Icn_calander, { target: 'CalanderIcon' })``;
  • svg를 커스텀 할 때(색상 변경 등), 적용이 안된다면 각 속성이 포함된 태그를 잘 확인하는 것이 필요하다.
    예를 들어, stroke 속성이 <path> 태그 내에 있다면
    stroke: black; 이 아닌 다음과 같이 적용할 수 있다.

     path {
       stroke: black;
     }
  • pressed 일 때의 스타일을 active를 통해 적용하고자 하였는데, pressedclicked의 구분이 안된다는 문제가 있었습니다.
    하여 isPressed와 같은 상태를 추가하여 구분하였다.

리뷰 요구사항 💬

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

  • default / hover / pressed / clicked 와 같은 4가지 상태에 따라 스타일이 변경되는 부분이 효율적으로 작성되었는 지 확인 부탁드립니다 !

관련 이슈

close #29

스크린샷 (선택)

2024-07-07.16.27.18.mov

@Kjiw0n Kjiw0n self-assigned this Jul 7, 2024
@Kjiw0n Kjiw0n changed the title Feat/#29 deadline component [FEAT] 마감기한 공통컴포넌트 퍼블리싱 Jul 7, 2024
@Kjiw0n Kjiw0n force-pushed the feat/#29-deadline-component branch 2 times, most recently from eff2ad8 to 491ec35 Compare July 7, 2024 10:22
display: flex;
width: 1.4rem;
height: 1.4rem;
justify-content: center;s
Copy link
Member

Choose a reason for hiding this comment

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

여기 s 오타낫어요

Copy link
Contributor Author

Choose a reason for hiding this comment

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

눈썰미미쳣다

display: flex;
width: fit-content;
min-width: 18rem;
padding: ${({ size }) => (size === 'big' ? '0.5rem 1rem' : '0.5rem 1rem')};
Copy link
Member

Choose a reason for hiding this comment

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

여기 big 일 경우 아닌 경우 패딩값 동일한 것 같습니다!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

헉 근데 이 내용 디자인측에서 size에 대한 패딩값 고정해주셔서 삭제했습니다!!!

@Kjiw0n Kjiw0n force-pushed the feat/#29-deadline-component branch from 491ec35 to 196612e Compare July 7, 2024 12:33
align-items: center;
`;

const LineIcon = styled(Icons.Icn_line, { target: 'LineIcon' })<{ size: string }>`
Copy link
Member

Choose a reason for hiding this comment

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

오홍 tartget을 사용하는 방법이 있군요!!


const XIcon = styled((props: React.SVGProps<SVGSVGElement> & { isClicked: boolean }) => {
const { isClicked, ...rest } = props;
return <Icons.Icn_xCricle {...rest} />;
Copy link
Member

Choose a reason for hiding this comment

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

해당 부분에 Imported JSX component Icn_xCricle must be in PascalCase or SCREAMING_SNAKE_CASE라는 lint에러가 나서 해당 부분 네이밍 변경해주시면 좋을 것 같습니당!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

수정했습니다!!

@Kjiw0n Kjiw0n force-pushed the feat/#29-deadline-component branch 2 times, most recently from e5d9b15 to 5d1ede0 Compare July 7, 2024 12:54
@Kjiw0n Kjiw0n force-pushed the feat/#29-deadline-component branch from 5d1ede0 to 5e60c84 Compare July 7, 2024 13:08
Comment on lines 39 to 51
<BtnDateContainer>
<CalanderIcon />
<TextWrapper isDefault={isDefaultDate} size={size}>
{date}
</TextWrapper>
</BtnDateContainer>
<LineIcon size={size} />
<BtnDateContainer>
<ClockIcon />
<TextWrapper isDefault={isDefaultTime} size={size}>
{time}
</TextWrapper>
</BtnDateContainer>
Copy link
Member

Choose a reason for hiding this comment

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

여기 BtnDateContainer 로 감싼 아이콘, date, time 정도만 달라지는 부분이 있는데 컴포넌트로 따로 빼면 코드 중복 줄일 수 있을 것 같습니다! 코드 길이도 짧아져서 가독성에도 더 좋을 것 같아요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 적용했어요!!

@@ -5,9 +5,18 @@ import Icn_nav_dashboard from '@/assets/svg/icn_nav_dashboard.svg?react';
import Icn_nav_setting from '@/assets/svg/icn_nav_setting.svg?react';
import Icn_nav_today from '@/assets/svg/icn_nav_today.svg?react';

import Icn_calander from '../../assets/svg/calendar-minus-01.svg?react';
Copy link
Member

Choose a reason for hiding this comment

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

여기 절대 경로로 바꾸면 더 좋을 것 같아요!

Copy link
Member

@wrryu09 wrryu09 left a comment

Choose a reason for hiding this comment

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

css 호버 상태 진짜 복잡하네요 ㅠ 너무너무 고생하셨습니다 린트에러 없는 거 확인했어요!!!

Copy link
Member

Choose a reason for hiding this comment

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

오 common 폴더로 옮겨주셧네요 감사합니당!!!

Copy link
Member

@seong-hui seong-hui left a comment

Choose a reason for hiding this comment

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

디자인에서 중간에 바뀐 부분도 있어서 세세하고 고칠 부분이 많았을텐데 정말 수고 많으셨습니당 짱짱

@Kjiw0n Kjiw0n merged commit f0dac6f into develop Jul 7, 2024
2 checks passed
@Kjiw0n Kjiw0n deleted the feat/#29-deadline-component branch July 7, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[FEAT] 마감기한 공통 컴포넌트 퍼블리싱
3 participants