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: 리뷰 컴포넌트 UI 작성 #24

Merged
merged 5 commits into from
Sep 9, 2024

Conversation

HMRyu
Copy link
Contributor

@HMRyu HMRyu commented Sep 6, 2024

✏️ 작업 내용

  • review 컴포넌트 ui 작성

📷 스크린샷

  • tablet, desktop
스크린샷 2024-09-06 14 41 39
  • mobile
스크린샷 2024-09-06 14 42 33

✍️ 사용법

<Review
  image_source='/images/mock-image.png'
  rating={3}
  description={DESCRIPTION}
  place='달램핏 오피스 스트레칭'
  location='을지로 3가'
  user_name='럽윈즈올'
  date='2024.01.25'
/>

🎸 기타

  • image, description 등 prop 으로 받을 수 있도록 수정 후 다시 올리겠습니다! => 수정했습니다.
  • 사진이 있는 경우와 없는 경우 둘로 나눴는데, 하나의 컴포넌트에서 핸들링 할 수 있게 수정해보겠습니다! => 수정했습니다!

@HMRyu HMRyu linked an issue Sep 6, 2024 that may be closed by this pull request
2 tasks
@HMRyu HMRyu self-assigned this Sep 6, 2024
@HMRyu HMRyu added the ✨ Feat 기능 추가 label Sep 6, 2024
Comment on lines +8 to +9
rating: number;
description: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

P4) 위에 두 개도 옵셔널 체이닝 하시면 어떠신가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rating, description 은 리뷰 컴포넌트에서 계속 사용되는 것 같아서 이렇게 지정했습니다...!

Comment on lines 28 to 37
<div>
<Image
className='mx-auto w-full rounded-[24px] p-[10px] md:p-0'
src={image_source}
alt='review image'
width={378}
height={200}
quality={85}
/>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

P1) 이미지 크기가 유동적일 경우를 대비해서 fill 속성 사용하시면 어떠실까요?

<div className="relative ...">
  <Image className-"object-fit" fill .../>
</div>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 fill 속성과 object-cover 속성을 사용해서

부모 컨테이너를 꽉 채우면서 더 큰 부분은 이미지가 잘리도록 적용했습니다!

<div className='relative ...'>
  <Image
    object-cover
    fill
    ...
  />
</div>

Comment on lines 41 to 45
<div className='mt-[10px] flex md:mt-0'>
{Array.from({ length: rating }).map((_, index) => (
<IconHeart key={index} className='h-24 w-24 text-var-orange-600' />
))}
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

P3) 하트 로직처럼 보이는데,
만약에 rating이 3이면 오렌지색 하트 3개만 그려지고 빈 하트는 어디에 생기나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

빈 하트도 나오도록 수정했습니다...!


<div className='mt-8 flex items-center space-x-[8px] divide-x divide-var-gray-700 md:mt-10'>
<div>
<div className='flex items-center space-x-[8px]'>
Copy link
Contributor

Choose a reason for hiding this comment

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

space 속성 배워갑니다 👏

Copy link
Contributor

@yunchaeney yunchaeney 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 42 to 44
{Array.from({ length: rating }).map((_, index) => (
<IconHeart key={index} className='h-24 w-24 text-var-orange-600' />
))}
Copy link
Contributor

Choose a reason for hiding this comment

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

점수 3점일 경우 하트 3개만 표현되는 것 같은데 맞나요? 3개 채워진 하트, 2개 빈 하트 되어야 하지 않나요?
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

빈 하트도 나오도록 수정했습니다...!

<div>
<div className='flex items-center space-x-[8px]'>
<Profile className='h-24 w-24' />
<div className='text-[12px] text-var-gray-700'>{user_name}</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

text-[12px] 의 경우 , tailwind config 수정해서 text-12 로 (제 PR 머지 되면) 사용 가능해요!

Copy link
Contributor

Choose a reason for hiding this comment

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

받아오는 Props가 복잡한데 잘 작성해주셨어요!
LGTM!

<div className='mt-[10px] flex md:mt-0'>
{Array.from({ length: rating }).map((_, index) => (
<IconHeart key={index} className='h-24 w-24 text-var-orange-600' />
))}
Copy link
Contributor

Choose a reason for hiding this comment

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

5-rating 을 lengh로 줘서 빈하트 배열만 추가해주시면 좋을 것 같습니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넵 추가했습니다...!

Copy link
Contributor

@BeMatthewsong BeMatthewsong left a comment

Choose a reason for hiding this comment

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

LGTM!! 👍 고생하셨습니다!!

@HMRyu HMRyu merged commit be3eea9 into develop Sep 9, 2024
4 checks passed
@HMRyu HMRyu deleted the feat/homin/KAN-13-review-component branch September 12, 2024 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feat 기능 추가
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: 공통 컴포넌트 - Review, Container Information
4 participants