diff --git a/apis/getLetters.ts b/apis/getLetters.ts index f806059..65684d2 100644 --- a/apis/getLetters.ts +++ b/apis/getLetters.ts @@ -14,7 +14,7 @@ export type LettersResponse = { export type LetterType = 'read' | 'unread'; export async function getLetters(type: LetterType) { const accessToken = authToken.getToken(); - const url = type === 'read' ? '/api/mail/read' : '/api/mailbox'; + const url = type === 'read' ? '/api/mailbox/read' : '/api/mailbox'; return await ieumAxios.get(url, { headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${accessToken}` }, }); diff --git a/components/authEmail.tsx b/components/authEmail.tsx index e27ba6e..f61f2e3 100644 --- a/components/authEmail.tsx +++ b/components/authEmail.tsx @@ -136,8 +136,8 @@ export default function AuthEmail({ title, moveNextPage, setEmail }: Props) { const submitHandler = () => {}; return ( -
-
+
+ {title} = ({ <>
-
-
+
+
{onlyAccess === 'user' && {children}} {onlyAccess === 'notUser' && {children}} {onlyAccess === 'all' && children} diff --git a/components/pages/join/join-Password.tsx b/components/pages/join/join-Password.tsx index 6f8edee..49494b1 100644 --- a/components/pages/join/join-Password.tsx +++ b/components/pages/join/join-Password.tsx @@ -23,10 +23,29 @@ type JoinPasswordType = { email: string; }; +//초기 닉네임 설정 +const initNicknames = [ + '혁명적인설탕', + '고요한오리', + '긍정적인다람쥐', + '꾸준한호랑이', + '센스있는팬더', + '빛나는별', + '신비로운달', + '환상적인바람', + '푸른바다', + '자유로운새', +]; + +const getRandomNickname = () => { + const randomIndex = Math.floor(Math.random() * initNicknames.length); + return initNicknames[randomIndex]; +}; + const JoinPassword: React.FC = ({ email }) => { const router = useRouter(); const newSignUpMutation = useMutation(postSignUp); - const [nickname, setNickname] = useState(''); + const [nickname, setNickname] = useState(getRandomNickname()); //API로부터 받아온 닉네임들 저장하는 배열 const [nicknames, setNicknames] = useState([]); @@ -51,31 +70,6 @@ const JoinPassword: React.FC = ({ email }) => { const [isDuplicatedCheckAble, setIsDuplicatedCheckAble] = useState(false); - //초기 닉네임 설정 - const initNicknames = [ - '혁명적인설탕', - '고요한오리', - '긍정적인다람쥐', - '꾸준한호랑이', - '센스있는팬더', - '빛나는별', - '신비로운달', - '환상적인바람', - '푸른바다', - '자유로운새', - ]; - - // 초기 닉네임 중 랜덤 닉네임 1개 선택 로직 - useEffect(() => { - const getRandomNickname = () => { - const randomIndex = Math.floor(Math.random() * initNicknames.length); - return initNicknames[randomIndex]; - }; - setNickname(getRandomNickname()); - - // changeNicknameHandler(); - }, []); // 빈 배열을 의존성 배열로 사용 - const setNicknameHandler = (event: React.ChangeEvent) => { setNickname(event.target.value); setIsDuplicatedCheckAble(true); @@ -221,8 +215,8 @@ const JoinPassword: React.FC = ({ email }) => { }; return ( -
- +
+

간편가입

{/* Header */} diff --git a/components/pages/password/password-Password.tsx b/components/pages/password/password-Password.tsx index dbfe282..8424784 100644 --- a/components/pages/password/password-Password.tsx +++ b/components/pages/password/password-Password.tsx @@ -113,8 +113,8 @@ const PasswordPassword: React.FC = ({ email }) => { // event.preventDefault(); return ( -
- +
+

비밀번호 재설정

{ return ( -
+
diff --git a/components/pages/response/response-Select.tsx b/components/pages/response/response-Select.tsx index 24bc79a..2bc9ed3 100644 --- a/components/pages/response/response-Select.tsx +++ b/components/pages/response/response-Select.tsx @@ -112,7 +112,7 @@ const ResponseSelect: React.FC = ({ componentChangeHandler, title, co return ( -
+

편지 봉투를 선택하세요 @@ -207,7 +207,7 @@ const ResponseSelect: React.FC = ({ componentChangeHandler, title, co diff --git a/components/pages/response/response-Writing.tsx b/components/pages/response/response-Writing.tsx index bfd3aca..0590b89 100644 --- a/components/pages/response/response-Writing.tsx +++ b/components/pages/response/response-Writing.tsx @@ -32,14 +32,13 @@ type LoadType = { read: boolean; }; +const MAX_LENGTH_TITLE = 28; //편지 제목 글자수 제한 +const MAX_LENGTH = 3500; //편지 내용 글자수 제한 const ResponseWriting: React.FC = ({ componentChangeHandler, newtitle, newcontents, newload, selectId }) => { - const MAX_LENGTH_TITLE = 28; //편지 제목 글자수 제한 - const MAX_LENGTH = 3500; //편지 내용 글자수 제한 const { showAlert } = useAlert(); const router = useRouter(); const [title, setTitle] = useState(''); const [contents, setContents] = useState(''); - const [inputCount, setInputCount] = useState(0); const [show, setShow] = useState(false); const [load, setLoad] = useState(); const newTempMutation = useMutation(postTemp); @@ -85,17 +84,18 @@ const ResponseWriting: React.FC = ({ componentChangeHandler, newtitle const handleSendButtonClick = () => { newtitle(title); newcontents(contents); - - newCheckMutation.mutate( - { title, contents }, - { - onSuccess: () => { - newload(load); - componentChangeHandler('Select'); - }, - onError: (err) => handlerCheckError(err as AxiosError), - }, - ); + newload(load); + componentChangeHandler('Select'); + // newCheckMutation.mutate( + // { title, contents }, + // { + // onSuccess: () => { + // newload(load); + // componentChangeHandler('Select'); + // }, + // onError: (err) => handlerCheckError(err as AxiosError), + // }, + // ); }; //답장 임시저장 버튼 @@ -131,7 +131,6 @@ const ResponseWriting: React.FC = ({ componentChangeHandler, newtitle if (event.target.value.length > MAX_LENGTH) { event.target.value = event.target.value.slice(0, MAX_LENGTH); } - setInputCount(event.target.value.length); const target = event.target.value; setContents(target); }; @@ -160,7 +159,7 @@ const ResponseWriting: React.FC = ({ componentChangeHandler, newtitle return ( -

+
{newCheckMutation.isLoading ? (
AI가 편지 내용을 검사하고 있어요!
@@ -180,7 +179,7 @@ const ResponseWriting: React.FC = ({ componentChangeHandler, newtitle onChange={onInputHandler} /> = ({ componentChangeHandler, newtitle style={{ minHeight: '456px' }} /> - {inputCount}자/3500자 + {contents.length}자/3500자
- -
-
{mailBoxs}
+ +
+
+
+
우체통
+
+ +
+
{mailBoxs}
-
-
- +
+
+ ); } diff --git a/pages/reset-password.tsx b/pages/reset-password.tsx index 4a494e7..9bac957 100644 --- a/pages/reset-password.tsx +++ b/pages/reset-password.tsx @@ -1,7 +1,5 @@ import React, { useState } from 'react'; -import PasswordEmail from '../components/pages/password/password-Email'; import PasswordPassword from '../components/pages/password/password-Password'; -import OnlyNotUser from '@/components/layouts/onlyNotUser'; import Layout from '@/components/layouts/layout'; import AuthEmail from '@/components/authEmail';