Skip to content

Commit

Permalink
[fix] #36 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kr-nius committed Mar 29, 2024
1 parent fd70095 commit 381c939
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 48 deletions.
20 changes: 16 additions & 4 deletions weatherfit_refactoring/public/dummy_data/post.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
"nickName": "hae_hae",
"likeCount": 2,
"temperature": -6,
"images": "",
"images": {
"boardId": 1,
"imageId": 1,
"imageUrl": "/images/codi2.jpg"
},
"category": ["후드 집업", "가죽자켓", "컨버스", "운동화", "베레모"],
"hashTag": ["hi", "하이", "안녕"],
"weatherIcon": "01d",
Expand All @@ -23,7 +27,11 @@
"nickName": "hae_hae",
"likeCount": 2,
"temperature": -6,
"images": "",
"images": {
"boardId": 1,
"imageId": 1,
"imageUrl": "/images/codi1.jpg"
},
"category": ["후드 집업", "가죽자켓", "컨버스", "운동화", "베레모"],
"hashTag": ["hi", "하이", "안녕"],
"weatherIcon": "01d",
Expand All @@ -35,11 +43,15 @@
"modifiedDate": "2023-08-31 04:29:55"
},
{
"boardId": 1,
"boardId": 2,
"nickName": "hae_hae",
"likeCount": 2,
"temperature": -6,
"images": "",
"images": {
"boardId": 2,
"imageId": 1,
"imageUrl": "/images/codi2.jpg"
},
"category": ["후드 집업", "가죽자켓", "컨버스", "운동화", "베레모"],
"hashTag": ["hi", "하이", "안녕"],
"weatherIcon": "01d",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,21 @@ export default function ProfileImageEdit() {
alt="Current"
width={100}
height={100}
className="profile_image_icon_1"
className="rounded-[50%]"
/>
) : (
<Image
src={URL.createObjectURL(selectedImage)}
alt="Uploaded"
width={100}
height={100}
className="profile_image_icon_1"
className="rounded-[50%]"
/>
)
) : (
<IconStore
iconStyle={IconStyle.MY_PROFILE_FILL}
size={80}
size={100}
style="border-[3px] border-solid border-gray rounded-full"
/>
)}
Expand Down
84 changes: 43 additions & 41 deletions weatherfit_refactoring/src/Components/molecules/ProfilePost.tsx
Original file line number Diff line number Diff line change
@@ -1,52 +1,54 @@
import Image from 'next/image'

interface IMAGE {
boardId: number
imageId: number
imageUrl: string
}

interface LIKE {
likeId: number
nickName: string
}
interface FEEDATA {
boardId: number
images: IMAGE
likeCount: number
likelist: LIKE[]
nickName: string
temperature: number
weather: string
weatherIcon?: string
}

interface Props {
postData: FEEDDATA[]
}

export default function ProfilePost({ postData }: Props) {
console.log('postData: ', postData)
return (
<div className="grid grid-rows-[25vh_25vh_25vh] grid-cols-[1fr_1fr_1fr] gap-[1%] p-[10px]">
{/* {postData.length > 0 ? (
postData.map(item => (
<div key={item.boardId} className="rounded-lg">
{item.images && (
<Image
src={item.images.imageUrl}
alt="게시물 이미지"
layout="fill"
objectFit="cover"
/>
)}
</div>
))
<>
{postData.length > 0 ? (
<div className="grid grid-rows-[25vh_25vh_25vh] grid-cols-[1fr_1fr_1fr] gap-[1%] p-[10px]">
{postData.map(item => (
<div key={item.boardId} className="rounded-lg w-[120px] h-[180px]">
{item.images && (
<Image
src={item.images.imageUrl}
alt="게시물 이미지"
width={120}
height={180}
className="rounded-lg"
/>
)}
</div>
))}
</div>
) : (
<>
<p className="post_box_p">게시물이 없습니다.</p>
</>
)} */}
<div className="bg-[salmon] rounded-lg"></div>
</div>
<p className="post_box_p">게시물이 없습니다.</p>
)}
</>
// <div className="grid grid-rows-[25vh_25vh_25vh] grid-cols-[1fr_1fr_1fr] gap-[1%] p-[10px]">
// {postData.length > 0 ? (
// postData.map(item => (
// <div key={item.boardId} className="rounded-lg">
// {item.images && (
// <Image
// src={item.images.imageUrl}
// alt="게시물 이미지"
// width={120}
// height={180}
// className="rounded-lg"
// />
// )}
// </div>
// ))
// ) : (
// <>
// <p className="post_box_p">게시물이 없습니다.</p>
// </>
// )}
// {/* <div className="bg-[salmon] rounded-lg"></div> */}
// </div>
)
}

0 comments on commit 381c939

Please sign in to comment.