Skip to content

Commit

Permalink
refactor: count 있을 때만 margin 부여되도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hae-on committed Jul 24, 2024
1 parent 8335a66 commit c182623
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { container } from './recipeFavoriteButton.css';
import { container, countWrapper } from './recipeFavoriteButton.css';

import HeartEmpty from '@/assets/heart-empty.png';
import { SvgIcon, Text } from '@/components/Common';
Expand Down Expand Up @@ -39,9 +39,14 @@ const RecipeFavoriteButton = ({ recipeId, favorite, favoriteCount }: RecipeFavor
<img src={HeartEmpty} alt="좋아요" width={24} height={24} />
</div>
)}
<Text as="span" size="caption1" weight="medium" color="sub">
{favoriteCount}
</Text>

{favoriteCount && (
<div className={countWrapper}>
<Text as="span" size="caption1" weight="medium" color="sub">
{favoriteCount}
</Text>
</div>
)}
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ import { style } from '@vanilla-extract/css';
export const container = style({
display: 'flex',
alignItems: 'center',
gap: 6,
});

export const countWrapper = style({
marginLeft: 6,
});

0 comments on commit c182623

Please sign in to comment.