Skip to content

Commit 276da86

Browse files
authored
Merge pull request #104 from DevKor-github/fix/07-28
fix: 25-07-28 (5분 PR 가능)
2 parents 7413274 + 647dfc6 commit 276da86

File tree

6 files changed

+38
-42
lines changed

6 files changed

+38
-42
lines changed

src/common/components/ItemTokenList/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ interface Props {
1919
quality?: Quality;
2020
size: Size;
2121
};
22-
showAll?: boolean;
22+
showCount?: number;
2323
}
24-
const ItemTokenList = ({ itemInfo, showAll = true }: Props) => {
24+
const ItemTokenList = ({ itemInfo, showCount }: Props) => {
2525
const tags: TagType[] = [
2626
...(itemInfo.transactionTypes || []),
2727
...(itemInfo.productTypes || []),
@@ -30,7 +30,8 @@ const ItemTokenList = ({ itemInfo, showAll = true }: Props) => {
3030
...(itemInfo.color ? [itemInfo.color] : []),
3131
...(itemInfo.tradeMethods || []),
3232
];
33-
const showTags = showAll ? tags : tags.slice(0, 4);
33+
const showAll = showCount === undefined;
34+
const showTags = showAll ? tags : tags.slice(0, showCount);
3435
const noneShownCount = tags.length - showTags.length;
3536

3637
return (

src/features/home/components/ItemCard/PriceToken/index.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ interface Props {
77
const PriceToken = ({ price, deposit }: Props) => {
88
const isRental = deposit !== undefined;
99
return (
10-
<div className={s.PriceItem}>
11-
<label>{isRental ? '대여' : '판매'}</label>
12-
<p>{price.toLocaleString()}</p>
10+
<div className={s.Wrapper}>
11+
<div className={s.PriceItem}>
12+
<label>{isRental ? '대여료' : '판매가'}</label>
13+
<p>{price.toLocaleString()}</p>
14+
</div>
1315
{isRental && (
14-
<p>
16+
<div className={s.PriceItem}>
1517
<label>보증금</label>
16-
{deposit.toLocaleString()}
17-
</p>
18+
<p>{deposit.toLocaleString()}</p>
19+
</div>
1820
)}
1921
</div>
2022
);
Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,27 @@
11
import { css } from '@styled-system/css';
22

3-
export const PriceItem = css({
3+
export const Wrapper = css({
44
display: 'flex',
55
alignItems: 'center',
6-
gap: '0.375rem',
6+
gap: '0.875rem',
7+
height: '1.375rem',
8+
});
9+
10+
export const PriceItem = css({
11+
display: 'flex',
12+
alignItems: 'baseline',
13+
gap: '0.25rem',
14+
lineHeight: 1.4,
715
'& > label': {
8-
padding: '0.125rem 0.25rem',
9-
display: 'flex',
10-
alignItems: 'center',
11-
justifyContent: 'center',
12-
rounded: '0.25rem',
13-
bgColor: 'systemGray4',
1416
color: '54',
15-
fontSize: '0.625rem',
17+
fontSize: '0.75rem',
1618
fontWeight: 500,
17-
lineHeight: 1.4,
18-
letterSpacing: '-0.025rem',
19-
flexShrink: 0,
19+
letterSpacing: '-0.03rem',
2020
},
21-
'& p': {
21+
'& > p': {
2222
color: '100',
23-
fontSize: '1rem',
23+
fontSize: '0.875rem',
2424
fontWeight: 600,
25-
lineHeight: 1.4,
26-
letterSpacing: '-0.04rem',
27-
display: 'flex',
28-
gap: '0.375rem',
29-
alignItems: 'baseline',
30-
'& > label': {
31-
color: '54',
32-
fontSize: '0.875rem',
33-
fontWeight: 500,
34-
letterSpacing: '-0.035rem',
35-
},
25+
letterSpacing: '-0.035rem',
3626
},
3727
});

src/features/home/components/ItemCard/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ const ItemCard = ({ data }: Props) => {
2727
</div>
2828
<div className={s.Footer}>
2929
<div className={s.Tokens}>
30-
{/* TODO: API 수정 요청 */}
3130
<ItemTokenList
32-
showAll={false}
31+
showCount={3}
3332
itemInfo={{
3433
productTypes: data.productTypes,
35-
quality: 'BEST',
36-
size: 'L',
37-
tradeMethods: ['DIRECT'],
34+
quality: data.quality,
35+
size: data.size,
36+
color: data.color,
37+
tradeMethods: data.tradeMethods,
3838
}}
3939
/>
4040
</div>

src/features/home/components/ItemCard/style.css.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const Header = css({
3535
export const Title = css({
3636
color: '100',
3737
fontSize: '1rem',
38-
fontWeight: 400,
38+
fontWeight: 500,
3939
lineHeight: 'normal',
4040
letterSpacing: '-0.04rem',
4141
lineClamp: 1,
@@ -44,7 +44,6 @@ export const Title = css({
4444
export const Price = css({
4545
display: 'flex',
4646
flexDir: 'column',
47-
gap: '0.125rem',
4847
});
4948

5049
export const Footer = css({

src/features/home/types.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ProductType, TransactionType } from '@/libs/types/item';
1+
import type { Color, ProductType, Quality, Size, TradeMethods, TransactionType } from '@/libs/types/item';
22

33
export interface ItemInterface {
44
itemId: number;
@@ -12,6 +12,10 @@ export interface ItemInterface {
1212
likeCount: number;
1313
chatRoomCount: number;
1414
available: boolean;
15+
quality: Quality;
16+
size: Size;
17+
color: Color;
18+
tradeMethods: TradeMethods[];
1519
}
1620

1721
export type ItemOrderType = 'RECENT' | 'LIKE' | 'RENTAL_FEE' | 'SALE_PRICE';

0 commit comments

Comments
 (0)