Skip to content

Commit

Permalink
refactor: 온라인, 오프라인 모집 카드만 평점을 보여주도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
designsoo committed Apr 12, 2024
1 parent 2fd7561 commit 93350da
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/components/commons/cards/CommonCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export type CommonCardProps = {

export const CommonCard = ({ path, postType, title, address, rating, reviewCount, createdAt }: CommonCardProps) => {
const isOffline = postType === 'offline';
const isShowStarRating = postType === 'offline' || postType === 'online';

return (
<article className={cx('card')}>
Expand All @@ -47,12 +48,14 @@ export const CommonCard = ({ path, postType, title, address, rating, reviewCount
)}
</div>
<footer className={cx('card-footer')}>
<div className={cx('card-footer-review')}>
<StarRating size='small' rating={rating} readonly />
<span className={cx('card-footer-review-rating')}>
{toFixedOneDecimal(rating)} ({reviewCount})
</span>
</div>
{isShowStarRating && (
<div className={cx('card-footer-review')}>
<StarRating size='small' rating={rating} readonly />
<span className={cx('card-footer-review-rating')}>
{toFixedOneDecimal(rating)} ({reviewCount})
</span>
</div>
)}
<div className={cx('card-footer-calendar')}>
<Image src={calendar.default.url} alt={calendar.default.alt} width={20} height={20} />
<span className={cx('card-footer-calendar-date')}>{getFormatDate(createdAt)}</span>
Expand Down

0 comments on commit 93350da

Please sign in to comment.