Skip to content

Commit 2a21a0e

Browse files
committed
Refact: 공통 PostItem 컴포넌트에 컬러시스템 적용
1 parent 5a9b6f0 commit 2a21a0e

2 files changed

Lines changed: 11 additions & 17 deletions

File tree

src/components/PostItem/index.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import theme from '@styles/theme';
55
import PinIcon from '@assets/default/pin.svg';
66
import Like from '@components/Icons/Like';
77
import Message from '@components/Icons/Message';
8+
import { StyledText } from '@components/Text/StyledText';
89

910
import type { PostItemProps } from './dto';
10-
import { PostItemLayout, PostImageContainer, PostImage, LikesCountStyledText, LikesOverlay, Pin } from './style';
11+
import { PostItemLayout, PostImageContainer, PostImage, LikesOverlay, Pin } from './style';
1112

1213
const PostItem: React.FC<PostItemProps> = ({ post, isMyPost = true }) => {
1314
const navigate = useNavigate();
@@ -25,13 +26,13 @@ const PostItem: React.FC<PostItemProps> = ({ post, isMyPost = true }) => {
2526
{post.isRepresentative && <Pin src={PinIcon} />}
2627
<LikesOverlay>
2728
<Like />
28-
<LikesCountStyledText $textTheme={{ style: 'caption1-regular' }} color={theme.colors.gray3}>
29+
<StyledText $textTheme={{ style: 'caption1-regular' }} color={theme.colors.text.tertiary}>
2930
{post.postLikesCount}
30-
</LikesCountStyledText>
31-
<Message />
32-
<LikesCountStyledText $textTheme={{ style: 'caption1-regular' }} color={theme.colors.gray3}>
31+
</StyledText>
32+
<Message color="#8E8E8E" />
33+
<StyledText $textTheme={{ style: 'caption1-regular' }} color={theme.colors.text.tertiary}>
3334
{post.postCommentsCount}
34-
</LikesCountStyledText>
35+
</StyledText>
3536
</LikesOverlay>
3637
</PostImageContainer>
3738
</PostItemLayout>

src/components/PostItem/style.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import styled from 'styled-components';
2-
import { StyledText } from '@components/Text/StyledText';
32

43
export const PostItemLayout = styled.article`
54
flex: 1 1 calc(50% - 0.5rem); /* 기본적으로 두 개씩 배치되도록 설정 */
@@ -43,20 +42,14 @@ export const PostImage = styled.img`
4342

4443
export const LikesOverlay = styled.div`
4544
position: absolute;
46-
bottom: 0; /* 하단에 배치 */
45+
bottom: 0.625rem; /* 하단에 배치 */
46+
right: 0.625rem;
4747
width: 100%;
4848
display: flex;
49-
align-items: center;
5049
justify-content: flex-end;
50+
align-items: center;
5151
box-sizing: border-box;
52-
`;
53-
54-
export const Icon = styled.img`
55-
margin-bottom: 0.5rem;
56-
`;
57-
58-
export const LikesCountStyledText = styled(StyledText)`
59-
margin: 0 8px 0.5rem 4px;
52+
gap: 5px;
6053
`;
6154

6255
export const Pin = styled.img`

0 commit comments

Comments
 (0)