From c36133bd2080bafd10111e60dc0cc6052a827bf9 Mon Sep 17 00:00:00 2001 From: se0jinYoon Date: Fri, 13 Sep 2024 03:39:41 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EB=AA=A8=EB=8B=AC=20content=20?= =?UTF-8?q?=EC=83=81=EC=88=98=ED=8C=8C=EC=9D=BC=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/createGroup/CreateGroup.tsx | 9 +++++++-- src/pages/createGroup/constants/modalContent.ts | 3 +++ src/pages/groupFeed/components/CreateGroupBtn.tsx | 3 ++- src/pages/groupFeed/constants/modalContent.ts | 4 ++++ src/pages/groupInvite/GroupInvite.tsx | 3 ++- .../groupInvite/components/UserInfoInput.tsx | 3 ++- src/pages/groupInvite/constants/modalContent.ts | 4 ++++ src/pages/postDetail/PostDetail.tsx | 3 ++- src/pages/postDetail/constants/modalContent.ts | 4 ++++ src/pages/postPage/PostPage.tsx | 15 ++++++++------- src/pages/postPage/constants/modalContent.ts | 9 +++++++++ 11 files changed, 47 insertions(+), 13 deletions(-) create mode 100644 src/pages/createGroup/constants/modalContent.ts create mode 100644 src/pages/groupFeed/constants/modalContent.ts create mode 100644 src/pages/groupInvite/constants/modalContent.ts create mode 100644 src/pages/postDetail/constants/modalContent.ts create mode 100644 src/pages/postPage/constants/modalContent.ts diff --git a/src/pages/createGroup/CreateGroup.tsx b/src/pages/createGroup/CreateGroup.tsx index fb358600..07370c26 100644 --- a/src/pages/createGroup/CreateGroup.tsx +++ b/src/pages/createGroup/CreateGroup.tsx @@ -10,6 +10,7 @@ import { AuthorizationHeader, UnAuthorizationHeader } from '../../components/com import { DefaultModal, DefaultModalBtn } from '../../components/commons/modal/DefaultModal'; import { DEFAULT_IMG_URL } from '../../constants/defaultImgUrl'; import useModal from '../../hooks/useModal'; +import { MODAL } from './constants/modalContent'; type CreateGroupAction = | { type: 'setGroupName'; value: string } @@ -194,10 +195,14 @@ const CreateGroup = () => { isModalOpen={isModalOpen} onClickBg={handleCloseModal} sizeType="DEFAULT" - content={`생성 완료 시 필명 변경이 불가합니다. \n계속 하시겠습니까?`} + content={MODAL.ALERT_NICKNAME} modalImg="POST" > - + ); diff --git a/src/pages/createGroup/constants/modalContent.ts b/src/pages/createGroup/constants/modalContent.ts new file mode 100644 index 00000000..67a742b2 --- /dev/null +++ b/src/pages/createGroup/constants/modalContent.ts @@ -0,0 +1,3 @@ +export const MODAL = { + ALERT_NICKNAME: `생성 완료 시 필명 변경이 불가합니다. \n계속 하시겠습니까?`, +}; diff --git a/src/pages/groupFeed/components/CreateGroupBtn.tsx b/src/pages/groupFeed/components/CreateGroupBtn.tsx index 58ece46a..9ebb6d71 100644 --- a/src/pages/groupFeed/components/CreateGroupBtn.tsx +++ b/src/pages/groupFeed/components/CreateGroupBtn.tsx @@ -5,6 +5,7 @@ import { useNavigate } from 'react-router-dom'; import { MakeGroupPlusBtn, MakeGroupPlusHoverBtn } from '../../../assets/svgs'; import { FullModal, FullModalBtn } from '../../../components/commons/modal/FullModal'; import useModal from '../../../hooks/useModal'; +import { MODAL } from '../constants/modalContent'; interface groupCountProps { groupCount: number; @@ -35,7 +36,7 @@ const CreateGroupBtn = ({ groupCount }: groupCountProps) => { { const navigate = useNavigate(); @@ -79,7 +80,7 @@ const GroupInvite = () => { - + { { const navigate = useNavigate(); @@ -189,7 +190,7 @@ const PostDetail = () => { { case 'tempSave': return { ...state, - title: '임시저장 하시겠습니까?', + title: MODAL.TEMP_SAVE, leftBtnText: '아니오', leftBtnFn: () => handleCloseModal(), rightBtnText: '예', @@ -406,7 +407,7 @@ const PostPage = () => { case 'postContent': return { ...state, - title: '제출이 완료되었습니다', + title: MODAL.POST_CONTENT, leftBtnText: '홈으로 가기', leftBtnFn: () => navigate(`/group/${groupId}`), rightBtnText: '글 확인하기', @@ -418,7 +419,7 @@ const PostPage = () => { case 'putTempSaveContent': return { ...state, - title: '제출이 완료되었습니다', + title: MODAL.POST_CONTENT, leftBtnText: '홈으로 가기', leftBtnFn: () => navigate('/'), rightBtnText: '글 확인하기', @@ -430,7 +431,7 @@ const PostPage = () => { case 'putNewTempSaveContent': return { ...state, - title: '이미 임시저장된 글이 있습니다. \n덮어쓰시겠습니까?', + title: MODAL.PUT_NEW_TEMP_SAVE_CONTENT, leftBtnText: '예', leftBtnFn: tempSaveHandler, rightBtnText: '아니오', @@ -442,7 +443,7 @@ const PostPage = () => { case 'editContent': return { ...state, - title: '수정이 완료되었습니다.', + title: MODAL.EDIT_CONTENT, leftBtnText: '홈으로 가기', leftBtnFn: () => navigate('/'), rightBtnText: '글 확인하기', @@ -454,7 +455,7 @@ const PostPage = () => { case 'exitEditPage': return { ...state, - title: '작성 중이 글이 있습니다. \n 페이지를 나가시겠습니까?', + title: MODAL.EXIT_EDIT_PAGE, leftBtnText: '예', leftBtnFn: () => navigate(`/group/${groupId}`), rightBtnText: '아니오', @@ -585,7 +586,7 @@ const PostPage = () => { {/* 임시저장 이어쓰기 관련 모달 */} - + diff --git a/src/pages/postPage/constants/modalContent.ts b/src/pages/postPage/constants/modalContent.ts new file mode 100644 index 00000000..1b377aa8 --- /dev/null +++ b/src/pages/postPage/constants/modalContent.ts @@ -0,0 +1,9 @@ +export const MODAL = { + TEMP_SAVE: `임시저장 하시겠습니까?`, + POST_CONTENT: `제출이 완료되었습니다`, + PUT_NEW_TEMP_SAVE_CONTENT: `이미 임시저장된 글이 있습니다. \n덮어쓰시겠습니까?`, + EDIT_CONTENT: `수정이 완료되었습니다.`, + EXIT_EDIT_PAGE: `작성 중이 글이 있습니다. \n 페이지를 나가시겠습니까?`, + TEMP_CONTINUE: `임시 저장된 글을 계속 이어 쓸까요?`, + }; + \ No newline at end of file