Skip to content

Commit 647dfc6

Browse files
committed
fix: item card design
1 parent 55885bb commit 647dfc6

File tree

5 files changed

+29
-37
lines changed

5 files changed

+29
-37
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const ItemCard = ({ data }: Props) => {
2828
<div className={s.Footer}>
2929
<div className={s.Tokens}>
3030
<ItemTokenList
31-
showAll={false}
31+
showCount={3}
3232
itemInfo={{
3333
productTypes: data.productTypes,
3434
quality: data.quality,

โ€Ž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({

0 commit comments

Comments
ย (0)