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

Refactor: 온라인, 오프라인 모집 카드만 평점을 보여주도록 수정 #349

Merged
merged 1 commit into from
Apr 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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