Skip to content

Commit f5fd8eb

Browse files
committed
feat: 반응형 사이즈 적용
1 parent 8f44776 commit f5fd8eb

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

vite-project/src/pages/ItemDetailPage/ItemDetailPage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default function ItemDetailPage() {
2929
console.log(commentInfo);
3030
return (
3131
<>
32-
<div className="w-[1200px] h-[1257px] mx-auto">
32+
<div className="tablet:w-[696px] mobile:w-[344px] w-[1200px] h-[1257px] mx-auto">
3333
<ItemInfo
3434
images={itemInfo.images}
3535
name={itemInfo.name}

vite-project/src/pages/ItemDetailPage/ItemInfo.jsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,18 @@ export default function ItemInfo({
2020

2121
return (
2222
<>
23-
<section className="flex mt-9 space-x-9 pb-10 border-solid border-b-[1px] border-[#e5e7eb]">
23+
<section className="mobile:flex-col mobile:space-x-0 flex mt-9 space-x-9 pb-10 border-solid border-b-[1px] border-[#e5e7eb]">
2424
<img
25-
className="w-[486px] h-[486px] rounded-2xl"
25+
className="tablet:w-[340px] tablet:h-[340px] mobile:w-[343px] mobile:h-[343px] w-[486px] h-[486px] rounded-2xl"
2626
src={images}
2727
alt="상품 이미지"
2828
/>
29-
<div className="w-[690px] h-[496px]">
29+
<div className="tablet:w-[340px] mobile:w-[344px] w-[690px] h-[496px]">
3030
<div className="pb-4 mb-10 border-b-[1px] border-[#e5e7eb] border-solid">
31-
<h2 className="text-[24px] font-semibold text-[#1f2937]">{name}</h2>
32-
<h1 className="text-[40px] font-semibold text-[#1f2937]">
31+
<h2 className="tablet:text-[20px] text-[24px] font-semibold text-[#1f2937]">
32+
{name}
33+
</h2>
34+
<h1 className="tablet:text-[32px] text-[40px] font-semibold text-[#1f2937]">
3335
{Number(price).toLocaleString()}
3436
</h1>
3537
</div>
@@ -46,32 +48,32 @@ export default function ItemInfo({
4648
<span className="mb-7 block text-[16px] font-semibold text-[#4b5563]">
4749
상품 태그
4850
</span>
49-
<ul className="flex gap-[8px]">
51+
<ul className="tablet:flex tablet:flex-wrap mobile:flex mobile:flex-wrap flex gap-[8px]">
5052
{tags.map((tag, index) => (
5153
<li
5254
key={index}
53-
className="h-[36px] rounded-[26px] px-[16px] py-[6px] bg-[#f3f4f6] text-[16px] text-[#1f2937] text-center"
55+
className="tablet:inline-block mobile:inline-block h-[36px] rounded-[26px] px-[16px] py-[6px] bg-[#f3f4f6] text-[16px] text-[#1f2937] text-center"
5456
>
5557
#{tag}
5658
</li>
5759
))}
5860
</ul>
5961
</div>
6062
</div>
61-
<div className="w-[690px] flex items-center">
63+
<div className="tablet:w-[340px] mobile:w-[344px] w-[690px] flex items-center">
6264
<img className="mr-6" src={ProfileImg} alt="" />
6365
{/* src={profileImage || defaultProfileImage} 예정 */}
64-
<div className="flex w-[530px] flex-col border-r-[1px] border-[#e5e7eb] border-solid">
66+
<div className="tablet:w-[180px] mobile:w-[190px] flex w-[530px] flex-col border-r-[1px] border-[#e5e7eb] border-solid">
6567
<span className="font-medium text-[14px] text-[#4b5563]">
6668
{nickname}
6769
</span>
6870
<span className="font-normal text-[14px] text-[#9ca3af]">
6971
{formattedDate}
7072
</span>
7173
</div>
72-
<div className="gap-[10px] font-medium text-[16px] text-[#6b7280] w-[87px] h-[40px] px-[12px] py-[4px] rounded-[35px] border-[1px] border-[#e5e7eb] border-solid flex items-center ml-auto">
74+
<div className="tablet:w-[79px] mobile:w-[79px] mobile:h-[32px] gap-[10px] font-medium text-[16px] text-[#6b7280] w-[87px] h-[40px] justify-center rounded-[35px] border-[1px] border-[#e5e7eb] border-solid flex items-center ml-auto">
7375
<img
74-
className="w-[32px] h-[32px]"
76+
className="mobile:w-[24px] mobile:h-[24px] w-[32px] h-[32px]"
7577
src={likeIcon}
7678
alt="좋아요 아이콘"
7779
/>

0 commit comments

Comments
 (0)