Skip to content

Commit

Permalink
[fix] kdt-8-4#36 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kr-nius committed Mar 29, 2024
1 parent 8c10949 commit 698258d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 27 deletions.
31 changes: 16 additions & 15 deletions weatherfit_refactoring/src/Components/Molecules/CommentModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@ export default function CommentModal({ onClickFunction }: Props) {
const [content, setContent] = useState<string>('')
const { accesstoken, setAccessToken } = AuthTokenStore()

useEffect(() => {
setAccessToken()
const commentData = async () => {
try {
const res = await fetch('/dummy_data/comment.json')
const resData = await res.json()
console.log('res: ', resData)
setComments(resData.comments_data)
} catch (err) {
console.log('err:', err)
}
}
commentData()
}, [])
// 댓글 더미 데이터
// useEffect(() => {
// setAccessToken()
// const commentData = async () => {
// try {
// const res = await fetch('/dummy_data/comment.json')
// const resData = await res.json()
// console.log('res: ', resData)
// setComments(resData.comments_data)
// } catch (err) {
// console.log('err:', err)
// }
// }
// commentData()
// }, [])

useEffect(() => {
console.log('댓글 목록 업데이트: ', comments)
Expand Down Expand Up @@ -109,7 +110,7 @@ export default function CommentModal({ onClickFunction }: Props) {
style="m-[10px] absolute bottom-[5px]"
inputStyle="w-[325px] h-[30px]"
btnText="게시"
place="황동준(으)로 작성..."
place="닉네임(으)로 작성..."
/>
</div>
</div>
Expand Down
10 changes: 0 additions & 10 deletions weatherfit_refactoring/src/Components/molecules/ProfileInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@ export default function ProfileInfo({
</div>
<p className="font-bold">{userInfo.nickname}</p>
</div>
{/* -------------------------------지우기 */}
{/* <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> */}
{/* -------------------------------------- */}
<PostCount title="내 게시물" count={myPost.length} />
<PostCount title="좋아요 한 게시물" count={myLikePost.length} />
</div>
Expand Down
4 changes: 2 additions & 2 deletions weatherfit_refactoring/src/app/mypage/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export default function Mypage() {

// const profileRes = await res.json()

// // setUserProfile(profileRes)
// // setUserImage(profileRes.image)
// setUserInfo(profileRes)
// setProfileImage(profileRes.image)

// console.log('회원정보 data: ', profileRes)

Expand Down

0 comments on commit 698258d

Please sign in to comment.