Skip to content

Commit

Permalink
[fix] #36 코드 수정
Browse files Browse the repository at this point in the history
[fix] #36 코드 수정
  • Loading branch information
kr-nius authored Mar 29, 2024
2 parents 5f30958 + 8e026ea commit fd70095
Show file tree
Hide file tree
Showing 11 changed files with 203 additions and 99 deletions.
29 changes: 17 additions & 12 deletions weatherfit_refactoring/@types/feed/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,19 @@ interface FEEDDATA_detail {
}

interface SelecList {
list_id : number;
selectList : string;
list_id: number
selectList: string
}


interface TabMenu {
id: number;
title?: string;
value: string;
selectLists : SelecList[];
id: number
title?: string
value: string
selectLists: SelecList[]
}

interface CategoryStore {
categoryData : TabMenu[];
categoryData: TabMenu[]
}

interface CommentType {
Expand All @@ -71,8 +70,14 @@ interface CommentType {
status: number
}


interface LIKE {
likeId : number;
nickName: string;
}
likeId: number
nickName: string
}

interface UserData {
nickname: string
name: string
email: string
pw: string
}
2 changes: 1 addition & 1 deletion weatherfit_refactoring/public/dummy_data/comment.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
{
"id": 10,
"boardId": 1,
"nickname": "도로롱",
"nickname": "황동준",
"content": "날씨랑 잘 어울려요!",
"createdDate": "2024-03-14",
"createdTime": "23:15",
Expand Down
54 changes: 54 additions & 0 deletions weatherfit_refactoring/public/dummy_data/post.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"mypost_data": [
{
"boardId": 1,
"nickName": "hae_hae",
"likeCount": 2,
"temperature": -6,
"images": "",
"category": ["후드 집업", "가죽자켓", "컨버스", "운동화", "베레모"],
"hashTag": ["hi", "하이", "안녕"],
"weatherIcon": "01d",
"likelist": [
{ "likeId": 1, "nickName": "user1" },
{ "likeId": 2, "nickName": "user2" }
],
"createDate": "2023-08-31 04:29:55",
"modifiedDate": "2023-08-31 04:29:55"
}
],
"mylikepost_data": [
{
"boardId": 1,
"nickName": "hae_hae",
"likeCount": 2,
"temperature": -6,
"images": "",
"category": ["후드 집업", "가죽자켓", "컨버스", "운동화", "베레모"],
"hashTag": ["hi", "하이", "안녕"],
"weatherIcon": "01d",
"likelist": [
{ "likeId": 1, "nickName": "user1" },
{ "likeId": 2, "nickName": "user2" }
],
"createDate": "2023-08-31 04:29:55",
"modifiedDate": "2023-08-31 04:29:55"
},
{
"boardId": 1,
"nickName": "hae_hae",
"likeCount": 2,
"temperature": -6,
"images": "",
"category": ["후드 집업", "가죽자켓", "컨버스", "운동화", "베레모"],
"hashTag": ["hi", "하이", "안녕"],
"weatherIcon": "01d",
"likelist": [
{ "likeId": 1, "nickName": "user1" },
{ "likeId": 2, "nickName": "user2" }
],
"createDate": "2023-08-31 04:29:55",
"modifiedDate": "2023-08-31 04:29:55"
}
]
}
11 changes: 11 additions & 0 deletions weatherfit_refactoring/public/dummy_data/userprofile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"userprofile_data": {
"nickname": "황동준",
"email": "user1@test.com",
"name": "황동준",
"pw": "1234"
},
"profileimage_data": {
"profileImage": "https://cdnimg.melon.co.kr/cm2/artistcrop/images/002/61/143/261143_20210325180240_500.jpg?61e575e8653e5920470a38d1482d7312/melon/optimize/90"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function Comment({
const [isEditing, setIsEditing] = useState<boolean>(false)
const [editContent, setEditContent] = useState<string>('')
const { accesstoken, setAccessToken } = AuthTokenStore()
const decoded_nickname = 'cute_ssu'
const decoded_nickname = '황동준'

useEffect(() => {
setAccessToken()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ export default function MainHeader({ title }: Props) {
{check ? (
<ButtonStore
buttonStyle={ButtonStyle.TEXT_BTN}
style="absolute right-[19px] font-gmarketsans text-black"
style="absolute right-[19px] font-gmarketsans text-black mt-[7px]"
onClickFunction={logout}>
로그아웃
</ButtonStore>
) : (
<Link
href={`/login`}
className="absolute right-[19px] font-gmarketsans text-black">
className="absolute right-[19px] font-gmarketsans text-black mt-[7px]">
로그인
</Link>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { AuthTokenStore } from '@/Store/AuthToken'

export default function ProfileImageEdit() {
// const [selectedImage, setSelectedImage] = useState(userProfileImage)
const [selectedImage, setSelectedImage] = useState(null)
const [selectedImage, setSelectedImage] = useState<string | null>(
'https://cdnimg.melon.co.kr/cm2/artistcrop/images/002/61/143/261143_20210325180240_500.jpg?61e575e8653e5920470a38d1482d7312/melon/optimize/90',
)
const { userEmail } = AuthUserStore()
const { accesstoken } = AuthTokenStore()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface Props {
export default function ProfileEditModal({ onClickFunction }: Props) {
return (
<div className="fixed top-0 left-0 w-[100%] h-[100%] bg-[#00000066] z-[100] flex justify-center items-center">
<div className="bg-[#ffffff] w-[70vw] h-[67vh] rounded-md z-[200]">
<div className="bg-[#ffffff] w-[70vw] h-[600px] rounded-md z-[200]">
{/* 헤더 부분 */}
<div className="flex justify-center items-center relative my-[10px]">
<IconStore
Expand All @@ -38,9 +38,9 @@ export default function ProfileEditModal({ onClickFunction }: Props) {
<hr className="my-[10px]" />
{/* 이메일, 이름, 닉네임 부분 */}
<div className="flex flex-col items-center">
<ProfileModalInfo title="이메일" value="user@test.com" />
<ProfileModalInfo title="이름" value="가나다" />
<ProfileModalInfo title="닉네임" value="깜찍이" />
<ProfileModalInfo title="이메일" value="user1@test.com" />
<ProfileModalInfo title="이름" value="황동준" />
<ProfileModalInfo title="닉네임" value="황동준" />
</div>
<hr className="my-[10px]" />
{/* 비밀번호 부분 */}
Expand Down
42 changes: 27 additions & 15 deletions weatherfit_refactoring/src/Components/molecules/ProfileInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { useState } from 'react'
import PostCount from './PostCount'

interface UserData {
nickname: string
name: string
email: string
pw: string
}
import Image from 'next/image'
import IconStore, { IconStyle } from '../Atoms/Icon/IconStore'

interface Props {
profileImage: string | null
Expand All @@ -20,26 +16,42 @@ export default function ProfileInfo({
myPost,
myLikePost,
}: Props) {
console.log('userInfo: ', userInfo)
console.log('userImage: ', profileImage)
return (
<div className="flex items-center justify-evenly my-[10px]">
<div className="flex items-center flex-col font-Cafe24SsurroundAir">
<div className="bg-[black] h-[80px] rounded-[50%] w-[80px]"></div>
<p className="font-bold">깜찍이</p>
{/* <div className="bg-[black] h-[80px] rounded-[50%] w-[80px]"></div>
<p className="font-bold">{userInfo.nickname}</p> */}
<div className="h-[80px] rounded-[50%] w-[80px]">
{profileImage == null ? (
<IconStore
iconStyle={IconStyle.MY_PROFILE_FILL}
size={80}
style="border-[3px] border-solid border-gray rounded-full"
/>
) : (
<Image
src={profileImage}
alt="프로필 이미지"
width={80}
height={80}
className="rounded-[50%]"
/>
)}
</div>
<p className="font-bold">{userInfo.nickname}</p>
</div>
{/* -------------------------------지우기 */}
<div className="flex items-center flex-col font-Cafe24SsurroundAir text-sm">
{/* <div className="flex items-center flex-col font-Cafe24SsurroundAir text-sm">
<p className="font-bold">내 게시물</p>
<p>{myPost.length}</p>
</div>
<div className="flex items-center flex-col font-Cafe24SsurroundAir text-sm">
<p className="font-bold">좋아요 한 게시물</p>
<p>{myLikePost.length}</p>
</div>
</div> */}
{/* -------------------------------------- */}
{/* <PostCount title="내 게시물" count={myPost.length} />
<PostCount title="좋아요 한 게시물" count={myLikePost.length} /> */}
<PostCount title="내 게시물" count={myPost.length} />
<PostCount title="좋아요 한 게시물" count={myLikePost.length} />
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function ProfilePost({ postData }: Props) {
))
) : (
<>
<p className="post_box_p">게시물을 등록해주세요.</p>
<p className="post_box_p">게시물이 없습니다.</p>
</>
)} */}
<div className="bg-[salmon] rounded-lg"></div>
Expand Down
Loading

0 comments on commit fd70095

Please sign in to comment.