diff --git a/src/app/mypage/boards/components/BoardEditPopup.tsx b/src/app/mypage/boards/_components/BoardList/BoardEditPopup.tsx
similarity index 100%
rename from src/app/mypage/boards/components/BoardEditPopup.tsx
rename to src/app/mypage/boards/_components/BoardList/BoardEditPopup.tsx
diff --git a/src/app/mypage/boards/components/BoardList/BoardItem.tsx b/src/app/mypage/boards/_components/BoardList/BoardItem.tsx
similarity index 91%
rename from src/app/mypage/boards/components/BoardList/BoardItem.tsx
rename to src/app/mypage/boards/_components/BoardList/BoardItem.tsx
index 7f2682e..f202702 100644
--- a/src/app/mypage/boards/components/BoardList/BoardItem.tsx
+++ b/src/app/mypage/boards/_components/BoardList/BoardItem.tsx
@@ -1,7 +1,7 @@
import EllipsisIcon from 'public/icons/ellipsis.svg'
-import BoardEditPopup from '@/app/mypage/boards/components/BoardEditPopup'
import React, { useState } from 'react'
-import DeleteBoardModal from '@/app/mypage/boards/components/DeleteBoardModal'
+import DeleteBoardModal from './DeleteBoardModal'
+import BoardEditPopup from './BoardEditPopup'
interface BoardListProps {
title: string
diff --git a/src/app/mypage/boards/components/BoardList/BoardPagination.tsx b/src/app/mypage/boards/_components/BoardList/BoardPagination.tsx
similarity index 100%
rename from src/app/mypage/boards/components/BoardList/BoardPagination.tsx
rename to src/app/mypage/boards/_components/BoardList/BoardPagination.tsx
diff --git a/src/app/mypage/boards/components/DeleteBoardModal.tsx b/src/app/mypage/boards/_components/BoardList/DeleteBoardModal.tsx
similarity index 100%
rename from src/app/mypage/boards/components/DeleteBoardModal.tsx
rename to src/app/mypage/boards/_components/BoardList/DeleteBoardModal.tsx
diff --git a/src/app/mypage/boards/components/BoardList/index.tsx b/src/app/mypage/boards/_components/BoardList/index.tsx
similarity index 100%
rename from src/app/mypage/boards/components/BoardList/index.tsx
rename to src/app/mypage/boards/_components/BoardList/index.tsx
diff --git a/src/app/mypage/boards/components/EmptyBoardList.tsx b/src/app/mypage/boards/_components/EmptyBoardList.tsx
similarity index 100%
rename from src/app/mypage/boards/components/EmptyBoardList.tsx
rename to src/app/mypage/boards/_components/EmptyBoardList.tsx
diff --git a/src/app/mypage/boards/page.tsx b/src/app/mypage/boards/page.tsx
index 2080ad2..b030642 100644
--- a/src/app/mypage/boards/page.tsx
+++ b/src/app/mypage/boards/page.tsx
@@ -1,7 +1,7 @@
import Header from '@/components/Header'
import { getMyBoards } from '@/lib/api/myBoard'
-import EmptyBoardList from './components/EmptyBoardList'
-import BoardList from './components/BoardList'
+import EmptyBoardList from './_components/EmptyBoardList'
+import BoardList from './_components/BoardList'
const Page = async () => {
const { pagination } = await getMyBoards()
diff --git a/src/app/mypage/leave/page.tsx b/src/app/mypage/leave/page.tsx
index e432829..1319881 100644
--- a/src/app/mypage/leave/page.tsx
+++ b/src/app/mypage/leave/page.tsx
@@ -6,7 +6,7 @@ const Page = () => {
const leaveCheckTitle = '탈퇴전 꼭 확인해주세요.'
const leaveReasonTitle = '탈퇴하려는 이유를 알려주세요.'
const leaveDescription =
- '계정을 삭제하면 복구가 불가능하며, 같은 계정으로\n재가입이 어려워요. 회원정보 및 보드가 모두\n삭제되며, 삭제된 데이터는 복구가 불가능해요.'
+ '계정을 삭제하면 복구가 불가능하며\n회원정보 및 보드가 모두 삭제돼요. \n또한, 삭제된 데이터는 복구가 불가능해요.'
return (
diff --git a/src/app/mypage/profileEdit/_components/ProfileForm.tsx b/src/app/mypage/profileEdit/_components/ProfileForm.tsx
index 626fb55..19c10b9 100644
--- a/src/app/mypage/profileEdit/_components/ProfileForm.tsx
+++ b/src/app/mypage/profileEdit/_components/ProfileForm.tsx
@@ -29,6 +29,14 @@ const ProfileForm = ({ children }: { children: ReactNode }) => {
const [unChanged, setUnChanged] = useState(true)
const [modalOpen, setModalOpen] = useState(false)
+ useEffect(() => {
+ if (session?.profile) {
+ setNewName(session?.profile.nickName)
+ setNewBirthDt(session?.profile.birthDt)
+ setNewGender(session?.profile.gender)
+ }
+ }, [session])
+
useEffect(() => {
if (
session?.profile.nickName === newName &&
@@ -86,6 +94,7 @@ const ProfileForm = ({ children }: { children: ReactNode }) => {
생년월일
>
setHasError: Dispatch>
className?: React.ComponentProps<'div'>['className']
}
const BirthDateInput = ({
+ value,
setBirthDt,
setHasError,
className = '',
@@ -26,16 +27,14 @@ const BirthDateInput = ({
const [month, setMonth] = useState('')
const [day, setDay] = useState('')
- const { data: session } = useSession()
-
useEffect(() => {
- if (!session || !session.profile.birthDt) return
+ if (!value) return
- const [y, m, d] = session.profile.birthDt.split('-')
+ const [y, m, d] = value.split('-')
setYear(y)
setMonth(m)
setDay(d)
- }, [session])
+ }, [value])
useEffect(() => {
if (!year && !month && !day) {
@@ -51,23 +50,23 @@ const BirthDateInput = ({
}, [year, month, day])
const handleYearChange = (e: ChangeEvent) => {
- const { value } = e.target
- if (/^\d{0,4}$/.test(value)) {
- setYear(value)
+ const { value: inputValue } = e.target
+ if (/^\d{0,4}$/.test(inputValue)) {
+ setYear(inputValue)
}
}
const handleMonthChange = (e: ChangeEvent) => {
- const { value } = e.target
- if (/^\d{0,2}$/.test(value) && +value <= 12) {
- setMonth(value)
+ const { value: inputValue } = e.target
+ if (/^\d{0,2}$/.test(inputValue) && +inputValue <= 12) {
+ setMonth(inputValue)
}
}
const handleDayChange = (e: ChangeEvent) => {
- const { value } = e.target
- if (/^\d{0,2}$/.test(value) && +value <= 31) {
- setDay(value)
+ const { value: inputValue } = e.target
+ if (/^\d{0,2}$/.test(inputValue) && +inputValue <= 31) {
+ setDay(inputValue)
}
}
return (
diff --git a/src/components/TextInput/NicknameInput.tsx b/src/components/TextInput/NicknameInput.tsx
index 0a002e5..5c041a9 100644
--- a/src/components/TextInput/NicknameInput.tsx
+++ b/src/components/TextInput/NicknameInput.tsx
@@ -8,7 +8,6 @@ import {
useEffect,
useState,
} from 'react'
-import { useSession } from 'next-auth/react'
import TextInput from '.'
const MAX_NICKNAME_LENGTH = 10
@@ -29,14 +28,6 @@ const NicknameInput = ({
}: NicknameInputProps) => {
const [errorMessage, setErrorMessage] = useState('')
- const { data: session } = useSession()
-
- useEffect(() => {
- if (session) {
- setValue(session.profile.nickName)
- }
- }, [session])
-
useEffect(() => {
setHasError(errorMessage.length > 0)
}, [errorMessage])
diff --git a/src/lib/api/board.ts b/src/lib/api/board.ts
index 357e916..fea9ed9 100644
--- a/src/lib/api/board.ts
+++ b/src/lib/api/board.ts
@@ -23,9 +23,7 @@ export const postBoard = async (
export const getTotalBoards = async (): Promise => {
const res = await get('/api/v1/boards/total-count', {
- next: {
- revalidate: 60 * 60, // 1 hour
- },
+ cache: 'no-cache',
})
return res.data