From bac842e1651067fe238d226889b354b3096e6b7a Mon Sep 17 00:00:00 2001 From: publdaze Date: Tue, 21 Nov 2023 20:18:39 +0900 Subject: [PATCH 01/43] =?UTF-8?q?docs=20:=20=ED=94=84=EB=A1=9C=EC=A0=9D?= =?UTF-8?q?=ED=8A=B8=20=EC=86=8C=EA=B0=9C=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #837 --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0971fc106..092f7b7cf 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ -# Homepage-Front-R2 -키퍼 홈페이지 프론트엔드 리뉴얼2 +
+ keeper logo +
+ +#
Homepage-Front-R2
+ +> 키퍼 홈페이지 프론트엔드 리뉴얼2 +> +> 개발기간 : 2023. 11. 11. ~ 2023. 10. 15. + From 9d7aa4531c62280266bb04b54d37f01d5038b8e7 Mon Sep 17 00:00:00 2001 From: publdaze Date: Tue, 21 Nov 2023 20:18:51 +0900 Subject: [PATCH 02/43] =?UTF-8?q?docs=20:=20=EB=8B=B4=EB=8B=B9=EC=9E=90=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #837 --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/README.md b/README.md index 092f7b7cf..ca6c8cc31 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,54 @@ > > 개발기간 : 2023. 11. 11. ~ 2023. 10. 15. +## 🕹️ 주담당자 + + + + + + +
+ + main manager +
publdaze +
+
+
  • 이메일 문의
  • +
  • publdaze@naver.com
  • +
    + +## 🛠️ 유지 보수 담당자 + + + + + + + +
    + + publdaze +
    + publdaze +
    +
    +
    + + jasper200207 +
    + jasper200207 +
    +
    +
    + + pipisebastian +
    + pipisebastian +
    +
    +
    + +## 👨‍👨‍👦‍👦 기여자 + +[![contributors](https://contrib.rocks/image?repo=KEEPER31337/Homepage-Front-R2)](https://github.com/KEEPER31337/Homepage-Front-R2/graphs/contributors) From 17960bc25f2ae69cf83342dfa4da7cef1882d881 Mon Sep 17 00:00:00 2001 From: publdaze Date: Tue, 21 Nov 2023 20:36:48 +0900 Subject: [PATCH 03/43] =?UTF-8?q?docs=20:=20=EB=B0=B0=ED=8F=AC=20=EC=A3=BC?= =?UTF-8?q?=EC=86=8C=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #837 --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index ca6c8cc31..e0f37923d 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,12 @@ > > 개발기간 : 2023. 11. 11. ~ 2023. 10. 15. +## 🔗 배포 주소 + +> 운영 서버 주소 : https://keeper.or.kr/ +> +> 개발 서버 주소 : https://dev.keeper.or.kr/ + ## 🕹️ 주담당자 From ddfdbe745aaa60abd297b2ac8ea4d956ab2a13e7 Mon Sep 17 00:00:00 2001 From: publdaze Date: Tue, 21 Nov 2023 20:38:58 +0900 Subject: [PATCH 04/43] =?UTF-8?q?docs=20:=20=EB=8B=B4=EB=8B=B9=EC=9E=90=20?= =?UTF-8?q?=EA=B3=84=EC=B8=B5=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #837 --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e0f37923d..50e4c7cc6 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,9 @@ > > 개발 서버 주소 : https://dev.keeper.or.kr/ -## 🕹️ 주담당자 +## 👨‍💻 구성원 + +### 🕹️ 주담당자
    @@ -31,7 +33,7 @@
    -## 🛠️ 유지 보수 담당자 +### 🛠️ 유지 보수 담당자 @@ -62,6 +64,6 @@
    -## 👨‍👨‍👦‍👦 기여자 +### 👨‍👨‍👦‍👦 기여자 [![contributors](https://contrib.rocks/image?repo=KEEPER31337/Homepage-Front-R2)](https://github.com/KEEPER31337/Homepage-Front-R2/graphs/contributors) From 2a14852461da64144a5f1a3a646eaa66784c6924 Mon Sep 17 00:00:00 2001 From: publdaze Date: Tue, 21 Nov 2023 20:55:15 +0900 Subject: [PATCH 05/43] =?UTF-8?q?docs=20:=20=EB=AA=A9=EC=B0=A8=20=EA=B5=AC?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #837 --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 50e4c7cc6..10d132bbe 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,18 @@ > > 개발기간 : 2023. 11. 11. ~ 2023. 10. 15. +## 목차 + +[🔗 배포 주소](#-배포-주소)
    +[👨‍💻 구성원](#-구성원)
    +[👀 프로젝트 배경](#-프로젝트-배경)
    +[🚀 프로젝트 목적](#-프로젝트-목적)
    +[🔧 기술 스택](#-기술-스택)
    +[💡 시작 가이드](#-시작-가이드) +[🖥️ 화면 구성](#%EF%B8%8F-화면-구성)
    +[📌 기술 스택](#-기술-스택)
    +[💎 라이센스](#-라이센스)
    + ## 🔗 배포 주소 > 운영 서버 주소 : https://keeper.or.kr/ @@ -67,3 +79,17 @@ ### 👨‍👨‍👦‍👦 기여자 [![contributors](https://contrib.rocks/image?repo=KEEPER31337/Homepage-Front-R2)](https://github.com/KEEPER31337/Homepage-Front-R2/graphs/contributors) + +## 👀 프로젝트 배경 + +## 🚀 프로젝트 목적 + +## 🔧 기술 스택 + +## 💡 시작 가이드 + +## 🖥️ 화면 구성 + +## 📌 기술 스택 + +## 💎 라이센스 From 7029b25bb91975eaf9c914aa72cda64a8b680561 Mon Sep 17 00:00:00 2001 From: publdaze Date: Tue, 21 Nov 2023 20:57:18 +0900 Subject: [PATCH 06/43] =?UTF-8?q?docs=20:=20=EB=AA=A9=EC=B0=A8=20=EB=88=84?= =?UTF-8?q?=EB=9D=BD=EB=90=9C=20=EA=B0=9C=ED=96=89=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #837 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 10d132bbe..c3f2aef0f 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ [👀 프로젝트 배경](#-프로젝트-배경)
    [🚀 프로젝트 목적](#-프로젝트-목적)
    [🔧 기술 스택](#-기술-스택)
    -[💡 시작 가이드](#-시작-가이드) +[💡 시작 가이드](#-시작-가이드)
    [🖥️ 화면 구성](#%EF%B8%8F-화면-구성)
    [📌 기술 스택](#-기술-스택)
    [💎 라이센스](#-라이센스)
    From 8f60d0801ba7b94a7d295567a48ffac022f16fb4 Mon Sep 17 00:00:00 2001 From: publdaze Date: Tue, 21 Nov 2023 21:00:39 +0900 Subject: [PATCH 07/43] =?UTF-8?q?docs=20:=20=EC=A4=91=EB=B3=B5=EB=90=9C=20?= =?UTF-8?q?=EB=AA=A9=EC=B0=A8=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #837 --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index c3f2aef0f..b9e29df14 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ [🔧 기술 스택](#-기술-스택)
    [💡 시작 가이드](#-시작-가이드)
    [🖥️ 화면 구성](#%EF%B8%8F-화면-구성)
    -[📌 기술 스택](#-기술-스택)
    [💎 라이센스](#-라이센스)
    ## 🔗 배포 주소 @@ -90,6 +89,4 @@ ## 🖥️ 화면 구성 -## 📌 기술 스택 - ## 💎 라이센스 From 5a15b1ffe5e9789e56d2d8fafc6bc655b27c7a70 Mon Sep 17 00:00:00 2001 From: Jang seo yun <81643702+pipisebastian@users.noreply.github.com> Date: Tue, 21 Nov 2023 21:02:21 +0900 Subject: [PATCH 08/43] =?UTF-8?q?docs=20:=20=EC=8A=A4=ED=82=AC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #837 --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index b9e29df14..3497fb9f4 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,14 @@ ## 🔧 기술 스택 +### 🛠 Skill & Tool + + + +### 🧩 Communication Tool + + + ## 💡 시작 가이드 ## 🖥️ 화면 구성 From a6fa3159bffaa95037b6f97ded1f1c14ed68a615 Mon Sep 17 00:00:00 2001 From: Jang seo yun <81643702+pipisebastian@users.noreply.github.com> Date: Tue, 21 Nov 2023 21:16:08 +0900 Subject: [PATCH 09/43] =?UTF-8?q?=08docs=20:=20=EC=84=A4=EC=B9=98=20?= =?UTF-8?q?=EB=B0=A9=EB=B2=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #837 --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 3497fb9f4..46df69b96 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,27 @@ ## 💡 시작 가이드 +- nvm 설정 + + ``` + nvm install + nvm use + ``` + +- root path에 `.env` 파일 추가 + + ``` + REACT_APP_API_URL={{ apiUrl }} + HTTPS=true + ``` + +- 필요한 패키지 설치 및 실행 + + ``` + npm install + npm start + ``` + ## 🖥️ 화면 구성 ## 💎 라이센스 From 6142ce600ad67f0cefaa8720a5e4b9eef248d4b3 Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Tue, 21 Nov 2023 21:24:24 +0900 Subject: [PATCH 10/43] =?UTF-8?q?docs=20:=20LICENSE=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -#837 --- LICENSE | 9 +++++++++ README.md | 31 ++++++++++++++----------------- 2 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..ac47c31bd --- /dev/null +++ b/LICENSE @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2023 Keeper Homepage Renewal2 Frontend Developers + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 46df69b96..a867b0564 100644 --- a/README.md +++ b/README.md @@ -96,26 +96,23 @@ ## 💡 시작 가이드 - nvm 설정 - - ``` - nvm install - nvm use - ``` - + ``` + nvm install + nvm use + ``` - root path에 `.env` 파일 추가 - - ``` - REACT_APP_API_URL={{ apiUrl }} - HTTPS=true - ``` - + ``` + REACT_APP_API_URL={{ apiUrl }} + HTTPS=true + ``` - 필요한 패키지 설치 및 실행 - - ``` - npm install - npm start - ``` + ``` + npm install + npm start + ``` ## 🖥️ 화면 구성 ## 💎 라이센스 + +해당 프로젝트는 [MIT LICENSE](https://github.com/KEEPER31337/Homepage-Front-R2/blob/develop/LICENSE) 를 따릅니다. From 64288e79510d51865d647ee4f6b63d0c89c3cffe Mon Sep 17 00:00:00 2001 From: publdaze Date: Wed, 22 Nov 2023 11:15:45 +0900 Subject: [PATCH 11/43] =?UTF-8?q?docs=20:=20=ED=94=84=EB=A1=9C=EC=A0=9D?= =?UTF-8?q?=ED=8A=B8=20=EB=B0=B0=EA=B2=BD,=20=EB=AA=A9=EC=B0=A8=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #837 --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index a867b0564..a96e86066 100644 --- a/README.md +++ b/README.md @@ -81,8 +81,28 @@ ## 👀 프로젝트 배경 +#### 기존 리뉴얼 홈페이지의 문제점 + +- **통일성 부족한 디자인** + 각 페이지마다 개별적인 디자인으로 인해 통일성이 부족했습니다. +- **명확하지 않은 코딩 규칙** + 명확한 코딩 규칙이 없어 코드마다 다양한 코딩 스타일이 혼재되었습니다. +- **부족한 코드 리뷰** + 리뷰 없이 머지가 가능하여 코드 리뷰 활동이 활발히 이루어지지 않았습니다. +- **팀원 간 소통 부족** + 회의 및 업무 공유가 부족하여 다른 팀원들의 작업 현황을 파악하기 어려웠습니다. + ## 🚀 프로젝트 목적 +- **명확한 기획과 디자인** + 기획 담당과 디자인 담당을 명확히 정하고, 분야별 회의를 진행하여 통일성을 유지하고자 합니다. +- **클린 코드** + Eslint와 Prettier를 명확하게 정의하여 코드의 일관성을 높이고, 코드 리뷰를 적극적으로 수행하여 상호간에 놓친 부분을 보완하여 클린 코드를 유지하고자 합니다. +- **가시적인 진척도와 활발한 소통** + 주기적인 업무 공유 및 회의를 통해 팀원 간 의견을 조율하고, GitHub의 프로젝트 기능을 활용하여 전체적인 프로젝트 진행 상황과 개별 진척도를 명확히 파악할 수 있도록 합니다. +- **코드 재사용성 높이기** + 공통된 기능을 수행하는 컴포넌트를 개발하여 코드의 재사용성을 높입니다. 이를 통해 일관된 디자인을 유지하고 유지보수의 효율성을 향상시킬 수 있습니다. + ## 🔧 기술 스택 ### 🛠 Skill & Tool From a8b26454d3e2b5f9dc3a2c1e3c632c76fa9dea00 Mon Sep 17 00:00:00 2001 From: publdaze Date: Wed, 22 Nov 2023 11:16:37 +0900 Subject: [PATCH 12/43] =?UTF-8?q?docs=20:=20=ED=99=94=EB=A9=B4=20=EA=B5=AC?= =?UTF-8?q?=EC=84=B1=20=EC=9E=84=EC=8B=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #837 --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index a96e86066..fe8fdcdf3 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,6 @@ [🚀 프로젝트 목적](#-프로젝트-목적)
    [🔧 기술 스택](#-기술-스택)
    [💡 시작 가이드](#-시작-가이드)
    -[🖥️ 화면 구성](#%EF%B8%8F-화면-구성)
    [💎 라이센스](#-라이센스)
    ## 🔗 배포 주소 @@ -131,8 +130,6 @@ npm start ``` -## 🖥️ 화면 구성 - ## 💎 라이센스 해당 프로젝트는 [MIT LICENSE](https://github.com/KEEPER31337/Homepage-Front-R2/blob/develop/LICENSE) 를 따릅니다. From fb586b3f1fb63d9027d0ae50dce7fff3888d87b2 Mon Sep 17 00:00:00 2001 From: publdaze <78250089+publdaze@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:18:28 +0900 Subject: [PATCH 13/43] =?UTF-8?q?docs=20:=20=EA=B0=9C=ED=96=89=20=EB=93=A4?= =?UTF-8?q?=EC=96=B4=EA=B0=80=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #837 --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index fe8fdcdf3..edca52591 100644 --- a/README.md +++ b/README.md @@ -82,24 +82,24 @@ #### 기존 리뉴얼 홈페이지의 문제점 -- **통일성 부족한 디자인** +- **통일성 부족한 디자인** 각 페이지마다 개별적인 디자인으로 인해 통일성이 부족했습니다. -- **명확하지 않은 코딩 규칙** +- **명확하지 않은 코딩 규칙** 명확한 코딩 규칙이 없어 코드마다 다양한 코딩 스타일이 혼재되었습니다. -- **부족한 코드 리뷰** +- **부족한 코드 리뷰** 리뷰 없이 머지가 가능하여 코드 리뷰 활동이 활발히 이루어지지 않았습니다. -- **팀원 간 소통 부족** +- **팀원 간 소통 부족** 회의 및 업무 공유가 부족하여 다른 팀원들의 작업 현황을 파악하기 어려웠습니다. ## 🚀 프로젝트 목적 -- **명확한 기획과 디자인** +- **명확한 기획과 디자인** 기획 담당과 디자인 담당을 명확히 정하고, 분야별 회의를 진행하여 통일성을 유지하고자 합니다. -- **클린 코드** +- **클린 코드** Eslint와 Prettier를 명확하게 정의하여 코드의 일관성을 높이고, 코드 리뷰를 적극적으로 수행하여 상호간에 놓친 부분을 보완하여 클린 코드를 유지하고자 합니다. -- **가시적인 진척도와 활발한 소통** +- **가시적인 진척도와 활발한 소통** 주기적인 업무 공유 및 회의를 통해 팀원 간 의견을 조율하고, GitHub의 프로젝트 기능을 활용하여 전체적인 프로젝트 진행 상황과 개별 진척도를 명확히 파악할 수 있도록 합니다. -- **코드 재사용성 높이기** +- **코드 재사용성 높이기** 공통된 기능을 수행하는 컴포넌트를 개발하여 코드의 재사용성을 높입니다. 이를 통해 일관된 디자인을 유지하고 유지보수의 효율성을 향상시킬 수 있습니다. ## 🔧 기술 스택 From f11f49fefbd5a7f61ee2323899e113d56a37925d Mon Sep 17 00:00:00 2001 From: publdaze Date: Sun, 10 Dec 2023 12:50:27 +0900 Subject: [PATCH 14/43] =?UTF-8?q?refactor=20:=20muiTheme=20=EC=BB=A4?= =?UTF-8?q?=EC=8A=A4=ED=85=80=20=EC=BB=AC=EB=9F=AC=EB=A1=9C=20=EC=83=81?= =?UTF-8?q?=EC=88=98=20=EB=B0=9B=EC=95=84=EC=99=80=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #844 --- src/constants/muiTheme.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/constants/muiTheme.ts b/src/constants/muiTheme.ts index d95977ad1..8a17f9529 100644 --- a/src/constants/muiTheme.ts +++ b/src/constants/muiTheme.ts @@ -5,11 +5,11 @@ const muiTheme = createTheme({ palette: { mode: 'dark', primary: { - main: '#4CEEF9', + main: KEEPER_COLOR.pointBlue, }, secondary: { - main: '#26262C', - contrastText: '#4CEEF9', + main: KEEPER_COLOR.subBlack, + contrastText: KEEPER_COLOR.pointBlue, }, }, typography: { From 5c4e1fd3fc3da0081f82b0e13fd4813c5529bb81 Mon Sep 17 00:00:00 2001 From: publdaze Date: Sun, 10 Dec 2023 15:07:40 +0900 Subject: [PATCH 15/43] =?UTF-8?q?refactor=20:=20404=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80,=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=83=81?= =?UTF-8?q?=EC=88=98=20=EB=B0=9B=EC=95=84=EC=99=80=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - svg 파일은 사용되지 않는 파일이나, 이미지 파일로의 보존을 위해 남겨두고, currentColor로 색상 변경에 대응할 수 있도록 처리함. - 눈동자 색의 경우 키퍼 테마 컬러 변경으로 인해 변경되는 게 아닌 고정된 색이어야 함. 따라서 svg 파일은 변수 사용이 불가하므로 그대로 하드코딩 처리, 컴포넌트에서는 해당 파일 상단에 별도 상수로 빼주도록 처리함 #844 --- src/assets/notFound/404.svg | 30 +++++++++--------- .../NotFound/SvgComponent/Svg404Component.tsx | 31 ++++++++++--------- 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/src/assets/notFound/404.svg b/src/assets/notFound/404.svg index ddc01c0f0..f9a4a6f67 100644 --- a/src/assets/notFound/404.svg +++ b/src/assets/notFound/404.svg @@ -1,19 +1,19 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/src/pages/NotFound/SvgComponent/Svg404Component.tsx b/src/pages/NotFound/SvgComponent/Svg404Component.tsx index d2cbbcfd6..f1dc7e5f9 100644 --- a/src/pages/NotFound/SvgComponent/Svg404Component.tsx +++ b/src/pages/NotFound/SvgComponent/Svg404Component.tsx @@ -1,10 +1,13 @@ import React from 'react'; +import { KEEPER_COLOR } from '@constants/keeperTheme'; interface Svg404Component { point: { top: number; left: number }; handleKeyClick: () => void; } +const PUPIL_COLOR = '#131316'; + /* NOTE src/assets/notFound/404.svg에서 추가적인 이벤트 처리한 컴포넌트 */ const Svg404Component = ({ point, handleKeyClick }: Svg404Component) => { return ( @@ -26,46 +29,46 @@ const Svg404Component = ({ point, handleKeyClick }: Svg404Component) => { transform="rotate(88.8057 178.791 64)" fill="url(#pattern0)" /> - - - + + + window.innerWidth * (3 / 4) ? 157 + point.left / (window.innerWidth / 4) : 159} cy={41 + point.top / (window.innerHeight / 4)} rx="3.5" ry="4" - fill="#131316" + fill={PUPIL_COLOR} /> - + window.innerWidth * (3 / 4) ? 183 + point.left / (window.innerWidth / 4) : 185} cy={41 + point.top / (window.innerHeight / 4)} rx="3.5" ry="4" - fill="#131316" + fill={PUPIL_COLOR} /> - - + + - - - + + + From a00057b756ea5324d000e64e34ae8bab4e6e8708 Mon Sep 17 00:00:00 2001 From: publdaze Date: Sun, 10 Dec 2023 15:20:13 +0900 Subject: [PATCH 16/43] =?UTF-8?q?refactor=20:=20=ED=97=A4=EB=8D=94=20?= =?UTF-8?q?=EC=95=84=EC=9D=B4=EC=BD=98=20=EC=83=89=EC=83=81=20=EC=BB=A4?= =?UTF-8?q?=EC=8A=A4=ED=85=80=20=EC=BB=AC=EB=9F=AC=EB=A1=9C=20=EC=83=81?= =?UTF-8?q?=EC=88=98=20=EB=B0=9B=EC=95=84=EC=99=80=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #844 --- src/components/Layout/Header/Header.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Layout/Header/Header.tsx b/src/components/Layout/Header/Header.tsx index 38674027e..17339901a 100644 --- a/src/components/Layout/Header/Header.tsx +++ b/src/components/Layout/Header/Header.tsx @@ -4,7 +4,7 @@ import { AppBar, IconButton, Toolbar, Typography } from '@mui/material'; import { VscAccount, VscGithubInverted, VscThreeBars } from 'react-icons/vsc'; import { useRecoilValue } from 'recoil'; import { ReactComponent as Logo } from '@assets/logo/logo_neon.svg'; -import { HEADER_HEIGHT } from '@constants/keeperTheme'; +import { HEADER_HEIGHT, KEEPER_COLOR } from '@constants/keeperTheme'; import memberState from '@recoil/member.recoil'; import FilledButton from '@components/Button/FilledButton'; import AccountMenu from './Menu/AccountMenu'; @@ -57,10 +57,10 @@ const Header = ({ setMobileSidebarOpen }: HeaderProps) => { W - + - + From d1d5bf1f1eba9c3ed124deea23da03ff84615269 Mon Sep 17 00:00:00 2001 From: publdaze Date: Sun, 10 Dec 2023 15:20:31 +0900 Subject: [PATCH 17/43] =?UTF-8?q?refactor=20:=20=ED=8A=B8=EB=A0=8C?= =?UTF-8?q?=EB=94=A9=20=ED=82=A4=ED=8D=BC=20=ED=85=8C=EB=A7=88=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #844 --- src/pages/home/Trendings.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/home/Trendings.tsx b/src/pages/home/Trendings.tsx index 795025165..88605b70d 100644 --- a/src/pages/home/Trendings.tsx +++ b/src/pages/home/Trendings.tsx @@ -12,8 +12,8 @@ const Card = ({ post }: { post: TrendingPostInfo }) => {
    From 31e0686dcbb9dcb532b834d45bad6d0a080162ff Mon Sep 17 00:00:00 2001 From: publdaze Date: Sun, 10 Dec 2023 16:40:42 +0900 Subject: [PATCH 18/43] =?UTF-8?q?refactor=20:=20tailwind=20=EC=BB=A4?= =?UTF-8?q?=EC=8A=A4=ED=85=80=20=EC=BB=AC=EB=9F=AC=20=ED=82=A4=ED=8D=BC=20?= =?UTF-8?q?=ED=85=8C=EB=A7=88=EB=A1=9C=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #844 --- src/constants/keeperTheme.ts | 1 + tailwind.config.js | 109 +++++++++++++++++------------------ 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/src/constants/keeperTheme.ts b/src/constants/keeperTheme.ts index 4a3cff33d..2c27759e7 100644 --- a/src/constants/keeperTheme.ts +++ b/src/constants/keeperTheme.ts @@ -5,6 +5,7 @@ export const KEEPER_COLOR = { pointBlue: '#4CEEF9', subGray: '#575E69', subRed: '#EF4444', + subOrange: '#FFA500', }; export const SIDEBAR_WIDTH = 240; diff --git a/tailwind.config.js b/tailwind.config.js index a59598de0..df242a38c 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,64 +1,63 @@ /** @type {import('tailwindcss').Config} */ +import { KEEPER_COLOR } from './src/constants/keeperTheme'; -module.exports = { - content: ['./src/**/*.{js,jsx,ts,tsx}'], - theme: { - extend: { - colors: { - mainBlack: '#131316', - middleBlack: '#18181C', - subBlack: '#26262C', - pointBlue: '#4CEEF9', - subGray: '#575E69', - subRed: '#EF4444', - subOrange: '#FFA500', - }, - fontFamily: { - base: 'IBM Plex Sans KR, system-ui, sans-serif', - orbitron: '"Orbitron", sans-serif', - }, - fontSize: { - h1: '28px', - h3: '20px', - paragraph: '14px', - small: '10px', - }, - spacing: { - header: '66px', - sidebar: '240px', - }, - maxWidth: { - container: '1080px', - }, - minWidth: { - sidebar: '240px', - }, - backgroundImage: { - galaxy: "url('/public/img/background_galaxy.png')", - }, - keyframes: { - typing: { - '0%': { - width: '0%', - visibility: 'hidden', - }, - '100%': { - width: '100%', - }, +export const content = ['./src/**/*.{js,jsx,ts,tsx}']; +export const theme = { + extend: { + colors: { + mainBlack: KEEPER_COLOR.mainBlack, + middleBlack: KEEPER_COLOR.middleBlack, + subBlack: KEEPER_COLOR.subBlack, + pointBlue: KEEPER_COLOR.pointBlue, + subGray: KEEPER_COLOR.subGray, + subRed: KEEPER_COLOR.subRed, + subOrange: KEEPER_COLOR.subOrange, + }, + fontFamily: { + base: 'IBM Plex Sans KR, system-ui, sans-serif', + orbitron: '"Orbitron", sans-serif', + }, + fontSize: { + h1: '28px', + h3: '20px', + paragraph: '14px', + small: '10px', + }, + spacing: { + header: '66px', + sidebar: '240px', + }, + maxWidth: { + container: '1080px', + }, + minWidth: { + sidebar: '240px', + }, + backgroundImage: { + galaxy: "url('/public/img/background_galaxy.png')", + }, + keyframes: { + typing: { + '0%': { + width: '0%', + visibility: 'hidden', }, - blink: { - '50%': { - borderColor: 'transparent', - }, - '100%': { - borderColor: 'white', - }, + '100%': { + width: '100%', }, }, - animation: { - typing: 'typing 2s steps(25), blink', + blink: { + '50%': { + borderColor: 'transparent', + }, + '100%': { + borderColor: 'white', + }, }, }, + animation: { + typing: 'typing 2s steps(25), blink', + }, }, - plugins: [], }; +export const plugins = []; From 4ec8d91d9a005a08ce1d94a320722b3455c4ecb5 Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Sun, 10 Dec 2023 17:34:45 +0900 Subject: [PATCH 19/43] =?UTF-8?q?style=20:=20helper=20text=20contants=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=EB=AA=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 기존 errorMsg에서 helper text임을 명확하게 표현 - #847 --- src/constants/{errorMsg.ts => helperText.ts} | 0 src/pages/Profile/Modal/EditAccountModal.tsx | 2 +- src/pages/Profile/Modal/EditProfileModal.tsx | 2 +- src/pages/Profile/Modal/SendPointModal.tsx | 2 +- src/pages/SignUp/Section/SignUpSecondInputSection.tsx | 2 +- src/pages/SignUp/Section/SignUpThirdInputSection.tsx | 2 +- src/pages/Study/Modal/StudyModal.tsx | 2 +- src/pages/board/BoardView/Modal/SecretPostModal.tsx | 2 +- src/pages/board/BoardWrite/BoardWrite.tsx | 2 +- src/pages/board/BoardWrite/Modal/SettingUploadModal.tsx | 2 +- src/pages/login/Search/SearchPWFirstStep.tsx | 2 +- 11 files changed, 10 insertions(+), 10 deletions(-) rename src/constants/{errorMsg.ts => helperText.ts} (100%) diff --git a/src/constants/errorMsg.ts b/src/constants/helperText.ts similarity index 100% rename from src/constants/errorMsg.ts rename to src/constants/helperText.ts diff --git a/src/pages/Profile/Modal/EditAccountModal.tsx b/src/pages/Profile/Modal/EditAccountModal.tsx index 589e83c07..79b86016f 100644 --- a/src/pages/Profile/Modal/EditAccountModal.tsx +++ b/src/pages/Profile/Modal/EditAccountModal.tsx @@ -14,7 +14,7 @@ import { useWithdrawalMutation, } from '@api/memberApi'; import { useCheckEmailDuplicationQuery } from '@api/signUpApi'; -import { REQUIRE_ERROR_MSG } from '@constants/errorMsg'; +import { REQUIRE_ERROR_MSG } from '@constants/helperText'; import memberState from '@recoil/member.recoil'; import { emailRegex } from '@utils/validateEmail'; import FilledButton from '@components/Button/FilledButton'; diff --git a/src/pages/Profile/Modal/EditProfileModal.tsx b/src/pages/Profile/Modal/EditProfileModal.tsx index 6ba5a6759..d3690db04 100644 --- a/src/pages/Profile/Modal/EditProfileModal.tsx +++ b/src/pages/Profile/Modal/EditProfileModal.tsx @@ -3,7 +3,7 @@ import { Controller, FieldValues, SubmitHandler, useForm } from 'react-hook-form import { Stack } from '@mui/material'; import { ProfileInfo } from '@api/dto'; import { useEditProfileMutation, useEditProfileThumbnailMutation } from '@api/memberApi'; -import { REQUIRE_ERROR_MSG } from '@constants/errorMsg'; +import { REQUIRE_ERROR_MSG } from '@constants/helperText'; import StandardDatePicker from '@components/DatePicker/StandardDatePicker'; import StandardInput from '@components/Input/StandardInput'; import ActionModal from '@components/Modal/ActionModal'; diff --git a/src/pages/Profile/Modal/SendPointModal.tsx b/src/pages/Profile/Modal/SendPointModal.tsx index aa5e9c267..7cff73c12 100644 --- a/src/pages/Profile/Modal/SendPointModal.tsx +++ b/src/pages/Profile/Modal/SendPointModal.tsx @@ -4,7 +4,7 @@ import { InputLabel } from '@mui/material'; import { useRecoilValue } from 'recoil'; import { useGetProfileQuery } from '@api/memberApi'; import { useSendPointMutation } from '@api/pointApi'; -import { REQUIRE_ERROR_MSG } from '@constants/errorMsg'; +import { REQUIRE_ERROR_MSG } from '@constants/helperText'; import memberState from '@recoil/member.recoil'; import StandardInput from '@components/Input/StandardInput'; import ActionModal from '@components/Modal/ActionModal'; diff --git a/src/pages/SignUp/Section/SignUpSecondInputSection.tsx b/src/pages/SignUp/Section/SignUpSecondInputSection.tsx index 8e454ffc2..dcde5db6a 100644 --- a/src/pages/SignUp/Section/SignUpSecondInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpSecondInputSection.tsx @@ -5,7 +5,7 @@ import { Stack } from '@mui/material'; import { VscCheck } from 'react-icons/vsc'; import { useSetRecoilState } from 'recoil'; import { signUpKeys, useCheckStudentIdDuplicationQuery } from '@api/signUpApi'; -import { NUMBER_ERROR_MSG, REQUIRE_ERROR_MSG } from '@constants/errorMsg'; +import { NUMBER_ERROR_MSG, REQUIRE_ERROR_MSG } from '@constants/helperText'; import FilledButton from '@components/Button/FilledButton'; import OutlinedButton from '@components/Button/OutlinedButton'; import StandardDatePicker from '@components/DatePicker/StandardDatePicker'; diff --git a/src/pages/SignUp/Section/SignUpThirdInputSection.tsx b/src/pages/SignUp/Section/SignUpThirdInputSection.tsx index 0d32074e4..dabf555ad 100644 --- a/src/pages/SignUp/Section/SignUpThirdInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpThirdInputSection.tsx @@ -6,7 +6,7 @@ import { Stack, Typography } from '@mui/material'; import { DateTime } from 'luxon'; import { useRecoilValue } from 'recoil'; import { useCheckEmailDuplicationQuery, useEmailAuthMutation, useSignUpMutation } from '@api/signUpApi'; -import { REQUIRE_ERROR_MSG } from '@constants/errorMsg'; +import { REQUIRE_ERROR_MSG } from '@constants/helperText'; import { emailRegex } from '@utils/validateEmail'; import OutlinedButton from '@components/Button/OutlinedButton'; import EmailAuthInput from '@components/Input/EmailAuthInput'; diff --git a/src/pages/Study/Modal/StudyModal.tsx b/src/pages/Study/Modal/StudyModal.tsx index 5ed2f9350..4d734ff7e 100644 --- a/src/pages/Study/Modal/StudyModal.tsx +++ b/src/pages/Study/Modal/StudyModal.tsx @@ -14,7 +14,7 @@ import { useEditStudyThumbnailMutation, useGetStudyQuery, } from '@api/studyApi'; -import { REQUIRE_ERROR_MSG } from '@constants/errorMsg'; +import { REQUIRE_ERROR_MSG } from '@constants/helperText'; import memberState from '@recoil/member.recoil'; import AutoComplete, { MultiAutoCompleteValue } from '@components/Input/AutoComplete'; import StandardInput from '@components/Input/StandardInput'; diff --git a/src/pages/board/BoardView/Modal/SecretPostModal.tsx b/src/pages/board/BoardView/Modal/SecretPostModal.tsx index febb863c0..8fddfeeec 100644 --- a/src/pages/board/BoardView/Modal/SecretPostModal.tsx +++ b/src/pages/board/BoardView/Modal/SecretPostModal.tsx @@ -2,7 +2,7 @@ import React, { Dispatch, SetStateAction } from 'react'; import { Controller, useForm } from 'react-hook-form'; import { useNavigate } from 'react-router-dom'; import { Typography } from '@mui/material'; -import { REQUIRE_ERROR_MSG } from '@constants/errorMsg'; +import { REQUIRE_ERROR_MSG } from '@constants/helperText'; import { POST_PASSWORD_MAX_LENGTH } from '@pages/board/BoardWrite/Modal/SettingUploadModal'; import StandardInput from '@components/Input/StandardInput'; import ActionModal from '@components/Modal/ActionModal'; diff --git a/src/pages/board/BoardWrite/BoardWrite.tsx b/src/pages/board/BoardWrite/BoardWrite.tsx index 5422ce7b7..4c72ea2d5 100644 --- a/src/pages/board/BoardWrite/BoardWrite.tsx +++ b/src/pages/board/BoardWrite/BoardWrite.tsx @@ -13,7 +13,7 @@ import { useEditPostThumbnailMutation, useUploadPostMutation, } from '@api/postApi'; -import { REQUIRE_ERROR_MSG } from '@constants/errorMsg'; +import { REQUIRE_ERROR_MSG } from '@constants/helperText'; import memberState from '@recoil/member.recoil'; import { categoryNameToId } from '@utils/converter'; import OutlinedButton from '@components/Button/OutlinedButton'; diff --git a/src/pages/board/BoardWrite/Modal/SettingUploadModal.tsx b/src/pages/board/BoardWrite/Modal/SettingUploadModal.tsx index a8507fb50..2146d252a 100644 --- a/src/pages/board/BoardWrite/Modal/SettingUploadModal.tsx +++ b/src/pages/board/BoardWrite/Modal/SettingUploadModal.tsx @@ -2,7 +2,7 @@ import React, { useEffect } from 'react'; import { Controller, useForm } from 'react-hook-form'; import { Checkbox, FormControlLabel, FormGroup, Typography, useMediaQuery, useTheme } from '@mui/material'; import { UploadPostSettings, PostInfo } from '@api/dto'; -import { REQUIRE_ERROR_MSG } from '@constants/errorMsg'; +import { REQUIRE_ERROR_MSG } from '@constants/helperText'; import StandardInput from '@components/Input/StandardInput'; import ActionModal from '@components/Modal/ActionModal'; import ImageUploader from '@components/Uploader/ImageUploader'; diff --git a/src/pages/login/Search/SearchPWFirstStep.tsx b/src/pages/login/Search/SearchPWFirstStep.tsx index 4756b7177..fcfcd50fe 100644 --- a/src/pages/login/Search/SearchPWFirstStep.tsx +++ b/src/pages/login/Search/SearchPWFirstStep.tsx @@ -2,7 +2,7 @@ import React, { useState } from 'react'; import { Divider, Typography, useMediaQuery, useTheme } from '@mui/material'; import { DateTime } from 'luxon'; import { useCheckAuthCodeMutation, useRequestAuthCodeMutation } from '@api/SearchAccountApi'; -import { REQUIRE_ERROR_MSG } from '@constants/errorMsg'; +import { REQUIRE_ERROR_MSG } from '@constants/helperText'; import { validateEmail } from '@utils/validateEmail'; import OutlinedButton from '@components/Button/OutlinedButton'; import EmailAuthInput from '@components/Input/EmailAuthInput'; From 24a7d91bfa22f34014c2d759d579203d7a578486 Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Sun, 10 Dec 2023 17:37:54 +0900 Subject: [PATCH 20/43] =?UTF-8?q?refactor=20:=20=ED=95=84=EC=88=98=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20helper=20text=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #847 --- src/pages/Profile/Modal/EditAccountModal.tsx | 10 +++++----- src/pages/SignUp/Section/SignUpFirstInputSection.tsx | 7 ++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/pages/Profile/Modal/EditAccountModal.tsx b/src/pages/Profile/Modal/EditAccountModal.tsx index 79b86016f..223c20da8 100644 --- a/src/pages/Profile/Modal/EditAccountModal.tsx +++ b/src/pages/Profile/Modal/EditAccountModal.tsx @@ -97,7 +97,7 @@ const EditEmailSection = () => { defaultValue="" control={control} rules={{ - required: '필수 정보입니다.', + required: REQUIRE_ERROR_MSG, }} render={({ field, fieldState: { error } }) => { return ( @@ -206,7 +206,7 @@ const EditPasswordSection = () => { defaultValue="" control={control} rules={{ - required: '필수 정보입니다.', + required: REQUIRE_ERROR_MSG, }} render={({ field, fieldState: { error } }) => { return ( @@ -226,7 +226,7 @@ const EditPasswordSection = () => { defaultValue="" control={control} rules={{ - required: '필수 정보입니다.', + required: REQUIRE_ERROR_MSG, minLength: { value: 8, message: '8글자 이상 입력해주세요.', @@ -254,7 +254,7 @@ const EditPasswordSection = () => { defaultValue="" control={control} rules={{ - required: '필수 정보입니다.', + required: REQUIRE_ERROR_MSG, validate: { confirmMatchPassward: (value) => { if (getValues('newPassword') !== value) return '비밀번호가 일치하지 않습니다.'; @@ -348,7 +348,7 @@ const EditAccountModal = ({ open, onClose }: EditAccountModalProps) => { defaultValue="" control={control} rules={{ - required: '필수 정보입니다.', + required: REQUIRE_ERROR_MSG, }} render={({ field, fieldState: { error } }) => { return ( diff --git a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx index 26ae00350..a75ba3033 100644 --- a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx @@ -6,6 +6,7 @@ import { VscCheck } from 'react-icons/vsc'; import { useSetRecoilState } from 'recoil'; import { signUpKeys, useCheckLoginIdDuplicationQuery } from '@api/signUpApi'; +import { REQUIRE_ERROR_MSG } from '@constants/helperText'; import FilledButton from '@components/Button/FilledButton'; import OutlinedButton from '@components/Button/OutlinedButton'; import StandardInput from '@components/Input/StandardInput'; @@ -71,7 +72,7 @@ const SignUpFirstInputSection = ({ setCurrentStep }: SignUpFirstInputSectionProp defaultValue="" control={control} rules={{ - required: '필수 정보입니다.', + required: REQUIRE_ERROR_MSG, minLength: { value: 4, message: '4글자 이상 입력해주세요.', @@ -107,7 +108,7 @@ const SignUpFirstInputSection = ({ setCurrentStep }: SignUpFirstInputSectionProp defaultValue="" control={control} rules={{ - required: '필수 정보입니다.', + required: REQUIRE_ERROR_MSG, minLength: { value: 8, message: '8글자 이상 입력해주세요.', @@ -135,7 +136,7 @@ const SignUpFirstInputSection = ({ setCurrentStep }: SignUpFirstInputSectionProp defaultValue="" control={control} rules={{ - required: '필수 정보입니다.', + required: REQUIRE_ERROR_MSG, validate: { confirmMatchPassward: (value) => { if (getValues('password') !== value) return '비밀번호가 일치하지 않습니다.'; From b16de0b920ff14580cd9abb8b4911c3bb1e68ced Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Sun, 10 Dec 2023 17:39:24 +0900 Subject: [PATCH 21/43] =?UTF-8?q?refactor=20:=20=EC=88=AB=EC=9E=90?= =?UTF-8?q?=EB=A7=8C=20=EC=9E=85=EB=A0=A5=20helper=20text=20=ED=86=B5?= =?UTF-8?q?=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #847 --- src/pages/Profile/Modal/SendPointModal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Profile/Modal/SendPointModal.tsx b/src/pages/Profile/Modal/SendPointModal.tsx index 7cff73c12..fb74b821d 100644 --- a/src/pages/Profile/Modal/SendPointModal.tsx +++ b/src/pages/Profile/Modal/SendPointModal.tsx @@ -4,7 +4,7 @@ import { InputLabel } from '@mui/material'; import { useRecoilValue } from 'recoil'; import { useGetProfileQuery } from '@api/memberApi'; import { useSendPointMutation } from '@api/pointApi'; -import { REQUIRE_ERROR_MSG } from '@constants/helperText'; +import { NUMBER_ERROR_MSG, REQUIRE_ERROR_MSG } from '@constants/helperText'; import memberState from '@recoil/member.recoil'; import StandardInput from '@components/Input/StandardInput'; import ActionModal from '@components/Modal/ActionModal'; @@ -76,7 +76,7 @@ const SendPointModal = ({ open, onClose, sendTo }: SendPointModalProps) => { }, pattern: { value: /^[0-9]+$/, - message: '숫자만 입력 가능합니다.', + message: NUMBER_ERROR_MSG, }, }} render={({ field, fieldState: { error } }) => ( From 87740f830ba24b006b7b8def9ce9373730fa771c Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Sun, 10 Dec 2023 17:49:31 +0900 Subject: [PATCH 22/43] =?UTF-8?q?refactor=20:=20=EC=B5=9C=EC=86=8C=20?= =?UTF-8?q?=EB=AC=B8=EC=9E=90=EC=97=B4=20=EA=B8=B8=EC=9D=B4=20helper=20tex?= =?UTF-8?q?t=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #847 --- src/constants/helperText.ts | 2 ++ src/pages/Profile/Modal/EditAccountModal.tsx | 6 +++--- src/pages/SignUp/Section/SignUpFirstInputSection.tsx | 8 ++++---- src/pages/login/Search/SearchPWSecondStep.tsx | 3 ++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/constants/helperText.ts b/src/constants/helperText.ts index 6a4c7c388..25ed96c64 100644 --- a/src/constants/helperText.ts +++ b/src/constants/helperText.ts @@ -1,2 +1,4 @@ export const REQUIRE_ERROR_MSG = '필수 정보입니다.'; export const NUMBER_ERROR_MSG = '숫자만 입력 가능합니다.'; +export const PASSWORD_ERROR_MSG = '8~20자 영문과 숫자를 사용하세요.'; +export const MIN_LENGTH_ERROR_MSG = (min: number) => `${min}글자 이상 입력해주세요.` as const; diff --git a/src/pages/Profile/Modal/EditAccountModal.tsx b/src/pages/Profile/Modal/EditAccountModal.tsx index 223c20da8..7a76c35f8 100644 --- a/src/pages/Profile/Modal/EditAccountModal.tsx +++ b/src/pages/Profile/Modal/EditAccountModal.tsx @@ -14,7 +14,7 @@ import { useWithdrawalMutation, } from '@api/memberApi'; import { useCheckEmailDuplicationQuery } from '@api/signUpApi'; -import { REQUIRE_ERROR_MSG } from '@constants/helperText'; +import { MIN_LENGTH_ERROR_MSG, PASSWORD_ERROR_MSG, REQUIRE_ERROR_MSG } from '@constants/helperText'; import memberState from '@recoil/member.recoil'; import { emailRegex } from '@utils/validateEmail'; import FilledButton from '@components/Button/FilledButton'; @@ -229,11 +229,11 @@ const EditPasswordSection = () => { required: REQUIRE_ERROR_MSG, minLength: { value: 8, - message: '8글자 이상 입력해주세요.', + message: MIN_LENGTH_ERROR_MSG(8), }, pattern: { value: /^(?=.*[a-zA-Z])(?=.*[0-9]).{8,20}$/, - message: '8~20자 영문과 숫자를 사용하세요.', + message: PASSWORD_ERROR_MSG, }, }} render={({ field, fieldState: { error } }) => { diff --git a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx index a75ba3033..ff4014a9d 100644 --- a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx @@ -6,7 +6,7 @@ import { VscCheck } from 'react-icons/vsc'; import { useSetRecoilState } from 'recoil'; import { signUpKeys, useCheckLoginIdDuplicationQuery } from '@api/signUpApi'; -import { REQUIRE_ERROR_MSG } from '@constants/helperText'; +import { MIN_LENGTH_ERROR_MSG, PASSWORD_ERROR_MSG, REQUIRE_ERROR_MSG } from '@constants/helperText'; import FilledButton from '@components/Button/FilledButton'; import OutlinedButton from '@components/Button/OutlinedButton'; import StandardInput from '@components/Input/StandardInput'; @@ -75,7 +75,7 @@ const SignUpFirstInputSection = ({ setCurrentStep }: SignUpFirstInputSectionProp required: REQUIRE_ERROR_MSG, minLength: { value: 4, - message: '4글자 이상 입력해주세요.', + message: MIN_LENGTH_ERROR_MSG(4), }, pattern: { value: /^[a-zA-Z0-9_]{4,12}$/, @@ -111,11 +111,11 @@ const SignUpFirstInputSection = ({ setCurrentStep }: SignUpFirstInputSectionProp required: REQUIRE_ERROR_MSG, minLength: { value: 8, - message: '8글자 이상 입력해주세요.', + message: MIN_LENGTH_ERROR_MSG(8), }, pattern: { value: /^(?=.*[a-zA-Z])(?=.*[0-9]).{8,20}$/, - message: '8~20자 영문과 숫자를 사용하세요.', + message: PASSWORD_ERROR_MSG, }, }} render={({ field, fieldState: { error } }) => { diff --git a/src/pages/login/Search/SearchPWSecondStep.tsx b/src/pages/login/Search/SearchPWSecondStep.tsx index 151be0191..dda683893 100644 --- a/src/pages/login/Search/SearchPWSecondStep.tsx +++ b/src/pages/login/Search/SearchPWSecondStep.tsx @@ -1,6 +1,7 @@ import React, { useEffect, useState } from 'react'; import { Divider } from '@mui/material'; import { useChangePasswordMutation } from '@api/SearchAccountApi'; +import { PASSWORD_ERROR_MSG } from '@constants/helperText'; import OutlinedButton from '@components/Button/OutlinedButton'; import StandardInput from '@components/Input/StandardInput'; @@ -45,7 +46,7 @@ const SearchPWSecondStep = ({ setCurrentStep, firstForm }: SearchPWSecondStepPro const handleBlur = (e: React.FocusEvent) => { const { name, value } = e.currentTarget; if (name === 'newPassword') { - if (value && !passwordRegex.test(value)) setPasswordErrorMsg('8~20자 영문과 숫자를 사용하세요.'); + if (value && !passwordRegex.test(value)) setPasswordErrorMsg(PASSWORD_ERROR_MSG); } if (name === 'confirmPassword') { if (!(value.length > 0 && isSame)) { From d58e6a43ad34dd7d2fde9114fa6a8358301deb40 Mon Sep 17 00:00:00 2001 From: publdaze Date: Sun, 10 Dec 2023 18:08:54 +0900 Subject: [PATCH 23/43] =?UTF-8?q?refactor=20:=20=EA=B0=9D=EC=B2=B4=20as=20?= =?UTF-8?q?const=20=EB=B6=99=EC=9D=B4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #844 --- src/constants/keeperTheme.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/constants/keeperTheme.ts b/src/constants/keeperTheme.ts index 2c27759e7..907f482ac 100644 --- a/src/constants/keeperTheme.ts +++ b/src/constants/keeperTheme.ts @@ -6,7 +6,7 @@ export const KEEPER_COLOR = { subGray: '#575E69', subRed: '#EF4444', subOrange: '#FFA500', -}; +} as const; export const SIDEBAR_WIDTH = 240; -export const HEADER_HEIGHT = { xs: 56, sm: 66 }; +export const HEADER_HEIGHT = { xs: 56, sm: 66 } as const; From d7d38a5437adf9f136bc851ef5e2f7cbc4213704 Mon Sep 17 00:00:00 2001 From: pipisebastian Date: Sun, 10 Dec 2023 18:10:06 +0900 Subject: [PATCH 24/43] =?UTF-8?q?feat=20:=20member=20role=20=EC=83=81?= =?UTF-8?q?=EC=88=98=20=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #848 --- src/constants/member.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/constants/member.ts diff --git a/src/constants/member.ts b/src/constants/member.ts new file mode 100644 index 000000000..b9a0549ab --- /dev/null +++ b/src/constants/member.ts @@ -0,0 +1,32 @@ +export const MEMBER_ROLE_PREFIX = 'ROLE_'; + +// 1. +export const MEMBER_ROLE = { + 회장: 'ROLE_회장', + 부회장: 'ROLE_부회장', + 서기: 'ROLE_서기', + 총무: 'ROLE_총무', + 사서: 'ROLE_사서', + 학술부장: 'ROLE_학술부장', + 대외부장: 'ROLE_대외부장', + 전산관리자: 'ROLE_전산관리자', + FRONT_전산관리자: 'ROLE_FRONT_전산관리자', + BACK_전산관리자: 'ROLE_BACK_전산관리자', + INFRA_전산관리자: 'ROLE_INFRA_전산관리자', + 회원: 'ROLE_회원', + 출제자: 'ROLE_출제자', +} as const; + +// 2. +export const MEMBER_ROLE2 = { + 회장: `${MEMBER_ROLE_PREFIX}회장`, + 부회장: `${MEMBER_ROLE_PREFIX}부회장`, +} as const; + +// 3. +const prefix = (detail: string) => `${MEMBER_ROLE_PREFIX}${detail}`; + +export const MEMBER_ROLE3 = { + 회장: prefix('회장'), + 부회장: prefix('부회장'), +} as const; From 50041ff97ccbab35275b310b5a2d695d18fe08ae Mon Sep 17 00:00:00 2001 From: pipisebastian Date: Sun, 10 Dec 2023 18:11:37 +0900 Subject: [PATCH 25/43] =?UTF-8?q?refactor=20:=20=EC=83=81=EC=88=98=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #848 --- src/components/Layout/Sidebar/Sidebar.tsx | 9 ++++++- src/constants/badge.ts | 21 ++++++++-------- src/constants/category.ts | 19 ++++++++------- src/mocks/DutyManageApi.ts | 19 ++++++++------- src/pages/Library/Library.tsx | 3 ++- src/pages/Profile/Section/BadgeSection.tsx | 5 ++-- src/pages/Profile/Tab/BookTab/BookTab.tsx | 3 ++- .../DutyManage/Button/DutyProfileButton.tsx | 3 ++- src/pages/admin/DutyManage/DutyManage.tsx | 24 +++++++++---------- .../DutyManage/Tooltip/DutyProfileTooltip.tsx | 12 ++++------ src/pages/senimarAttend/SenimarAttend.tsx | 3 ++- 11 files changed, 67 insertions(+), 54 deletions(-) diff --git a/src/components/Layout/Sidebar/Sidebar.tsx b/src/components/Layout/Sidebar/Sidebar.tsx index b3e01826f..0359f5048 100644 --- a/src/components/Layout/Sidebar/Sidebar.tsx +++ b/src/components/Layout/Sidebar/Sidebar.tsx @@ -4,6 +4,7 @@ import { VscBug } from 'react-icons/vsc'; import { Role } from '@api/dto'; import CATEGORIES from '@constants/category'; import { KEEPER_COLOR, SIDEBAR_WIDTH } from '@constants/keeperTheme'; +import { MEMBER_ROLE } from '@constants/member'; import useCheckAuth from '@hooks/useCheckAuth'; import CategoryNav from '@components/Navigation/CategoryNav'; @@ -13,7 +14,13 @@ interface SidebarProps { } const Sidebar = ({ mobileSidebarOpen, setMobileSidebarOpen }: SidebarProps) => { - const executiveRoles: Role[] = ['ROLE_회장', 'ROLE_부회장', 'ROLE_서기', 'ROLE_총무', 'ROLE_사서']; + const executiveRoles: Role[] = [ + MEMBER_ROLE.회장, + MEMBER_ROLE.부회장, + MEMBER_ROLE.서기, + MEMBER_ROLE.총무, + MEMBER_ROLE.사서, + ]; const { checkIncludeOneOfAuths } = useCheckAuth(); const theme = useTheme(); diff --git a/src/constants/badge.ts b/src/constants/badge.ts index 448e6ab9d..d75cb6ffc 100644 --- a/src/constants/badge.ts +++ b/src/constants/badge.ts @@ -9,18 +9,19 @@ import librarianBadge from '@assets/dutyManage/badge_8_librarian.gif'; import graduateBadge from '@assets/profileBadge/profile_badge_state_graduate.gif'; import regularBadge from '@assets/profileBadge/profile_badge_state_regular.gif'; import sleepBadge from '@assets/profileBadge/profile_badge_state_sleep.gif'; +import { MEMBER_ROLE } from './member'; const roles = [ - { name: 'ROLE_회장', img: chairmanBadge }, - { name: 'ROLE_부회장', img: viceChairmanBadge }, - { name: 'ROLE_서기', img: clerkBadge }, - { name: 'ROLE_총무', img: administratorBadge }, - { name: 'ROLE_사서', img: librarianBadge }, - { name: 'ROLE_학술부장', img: studyManagerBadge }, - { name: 'ROLE_대외부장', img: externalManagerBadge }, - { name: 'ROLE_FRONT_전산관리자', img: ITManagerBadge }, - { name: 'ROLE_BACK_전산관리자', img: ITManagerBadge }, - { name: 'ROLE_INFRA_전산관리자', img: ITManagerBadge }, + { name: MEMBER_ROLE.회장, img: chairmanBadge }, + { name: MEMBER_ROLE.부회장, img: viceChairmanBadge }, + { name: MEMBER_ROLE.서기, img: clerkBadge }, + { name: MEMBER_ROLE.총무, img: administratorBadge }, + { name: MEMBER_ROLE.사서, img: librarianBadge }, + { name: MEMBER_ROLE.학술부장, img: studyManagerBadge }, + { name: MEMBER_ROLE.대외부장, img: externalManagerBadge }, + { name: MEMBER_ROLE.FRONT_전산관리자, img: ITManagerBadge }, + { name: MEMBER_ROLE.BACK_전산관리자, img: ITManagerBadge }, + { name: MEMBER_ROLE.INFRA_전산관리자, img: ITManagerBadge }, ]; const types: { [key: string]: string } = { 정회원: regularBadge, 졸업: graduateBadge, 휴면회원: sleepBadge }; diff --git a/src/constants/category.ts b/src/constants/category.ts index d637759a0..6e9a0e857 100644 --- a/src/constants/category.ts +++ b/src/constants/category.ts @@ -1,4 +1,5 @@ import { Role } from '@api/dto'; +import { MEMBER_ROLE } from '@constants/member'; export interface CategoryMenu { id: number; @@ -152,19 +153,19 @@ const CATEGORIES: Category[] = [ id: 605, name: '문제관리', path: 'admin/challengeManage', - roles: ['ROLE_회장', 'ROLE_출제자'], + roles: [MEMBER_ROLE.회장, MEMBER_ROLE.출제자], }, { id: 606, name: '제출로그', path: 'admin/submissions', - roles: ['ROLE_회장', 'ROLE_출제자'], + roles: [MEMBER_ROLE.회장, MEMBER_ROLE.출제자], }, { id: 607, name: '대회운영', path: 'admin/operation', - roles: ['ROLE_회장'], + roles: [MEMBER_ROLE.회장], }, ], }, */ @@ -177,37 +178,37 @@ const CATEGORIES: Category[] = [ id: 701, name: '직책관리', path: 'dutyManage', - roles: ['ROLE_회장', 'ROLE_부회장'], + roles: [MEMBER_ROLE.회장, MEMBER_ROLE.부회장], }, /* { id: 702, name: '선거관리', path: 'electionManage', - roles: ['ROLE_회장'], + roles: [MEMBER_ROLE.회장], }, */ { id: 703, name: '도서관리', path: 'libraryManage', - roles: ['ROLE_회장', 'ROLE_부회장', 'ROLE_사서'], + roles: [MEMBER_ROLE.회장, MEMBER_ROLE.부회장, MEMBER_ROLE.사서], }, { id: 704, name: '세미나관리', path: 'seminarManage', - roles: ['ROLE_회장', 'ROLE_부회장', 'ROLE_서기'], + roles: [MEMBER_ROLE.회장, MEMBER_ROLE.부회장, MEMBER_ROLE.서기], }, { id: 705, name: '활동인원관리', path: 'activeMemberManage', - roles: ['ROLE_회장', 'ROLE_부회장', 'ROLE_서기'], + roles: [MEMBER_ROLE.회장, MEMBER_ROLE.부회장, MEMBER_ROLE.서기], }, { id: 706, name: '상벌점관리', path: 'meritManage', - roles: ['ROLE_회장', 'ROLE_부회장', 'ROLE_서기'], + roles: [MEMBER_ROLE.회장, MEMBER_ROLE.부회장, MEMBER_ROLE.서기], }, ], }, diff --git a/src/mocks/DutyManageApi.ts b/src/mocks/DutyManageApi.ts index 9701a291d..f7cb40f6c 100644 --- a/src/mocks/DutyManageApi.ts +++ b/src/mocks/DutyManageApi.ts @@ -6,6 +6,7 @@ import ITManagerBadge from '@assets/dutyManage/badge_5_it_manager.gif'; import clerkBadge from '@assets/dutyManage/badge_6_clerk.gif'; import administratorBadge from '@assets/dutyManage/badge_7_administrator.gif'; import librarianBadge from '@assets/dutyManage/badge_8_librarian.gif'; +import { MEMBER_ROLE } from '@constants/member'; interface RoleDutyList { jobName: string; @@ -82,14 +83,16 @@ const roleDutyListInfo: RoleDutyList[] = [ ]; const roles = [ - { name: 'ROLE_회장', img: chairmanBadge }, - { name: 'ROLE_부회장', img: viceChairmanBadge }, - { name: 'ROLE_대외부장', img: externalManagerBadge }, - { name: 'ROLE_학술부장', img: studyManagerBadge }, - { name: 'ROLE_전산관리자', img: ITManagerBadge }, - { name: 'ROLE_서기', img: clerkBadge }, - { name: 'ROLE_총무', img: administratorBadge }, - { name: 'ROLE_사서', img: librarianBadge }, + { name: MEMBER_ROLE.회장, img: chairmanBadge }, + { name: MEMBER_ROLE.부회장, img: viceChairmanBadge }, + { name: MEMBER_ROLE.대외부장, img: externalManagerBadge }, + { name: MEMBER_ROLE.학술부장, img: studyManagerBadge }, + { name: MEMBER_ROLE.FRONT_전산관리자, img: ITManagerBadge }, + { name: MEMBER_ROLE.BACK_전산관리자, img: ITManagerBadge }, + { name: MEMBER_ROLE.INFRA_전산관리자, img: ITManagerBadge }, + { name: MEMBER_ROLE.서기, img: clerkBadge }, + { name: MEMBER_ROLE.총무, img: administratorBadge }, + { name: MEMBER_ROLE.사서, img: librarianBadge }, ]; export type JobInfoType = { diff --git a/src/pages/Library/Library.tsx b/src/pages/Library/Library.tsx index cb340e4c0..9df2ea924 100644 --- a/src/pages/Library/Library.tsx +++ b/src/pages/Library/Library.tsx @@ -4,6 +4,7 @@ import Typography from '@mui/material/Typography'; import { BookListSearch } from '@api/dto'; import { useGetExecutiveInfoQuery } from '@api/dutyManageApi'; import { useGetBookListQuery, useRequestBorrowBookMutation, useGetBookBorrowsQuery } from '@api/libraryApi'; +import { MEMBER_ROLE } from '@constants/member'; import usePagination from '@hooks/usePagination'; import StandardTablePagination from '@components/Pagination/StandardTablePagination'; import PageTitle from '@components/Typography/PageTitle'; @@ -28,7 +29,7 @@ const Library = () => { const { data: executiveInfos } = useGetExecutiveInfoQuery(); const { mutate: RequestBorrowBook } = useRequestBorrowBookMutation(); - const librarian = executiveInfos?.find((role) => role.jobName === 'ROLE_사서')?.realName || ''; + const librarian = executiveInfos?.find((role) => role.jobName === MEMBER_ROLE.사서)?.realName || ''; const handleRequestBook = (bookId: number) => { RequestBorrowBook(bookId, { diff --git a/src/pages/Profile/Section/BadgeSection.tsx b/src/pages/Profile/Section/BadgeSection.tsx index c6e092184..e2d563904 100644 --- a/src/pages/Profile/Section/BadgeSection.tsx +++ b/src/pages/Profile/Section/BadgeSection.tsx @@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react'; import { Tooltip } from '@mui/material'; import { Role, RoleInfo } from '@api/dto'; import { roles, types } from '@constants/badge'; +import { MEMBER_ROLE_PREFIX, MEMBER_ROLE } from '@constants/member'; interface FollowListProps { memberType: string; @@ -13,7 +14,7 @@ const BadgeSection = ({ memberType, memberJobs }: FollowListProps) => { useEffect(() => { const updatedMemberJobInfo = memberJobs - .filter((job) => job !== 'ROLE_회원' && job !== 'ROLE_출제자') + .filter((job) => job !== MEMBER_ROLE.회원 && job !== MEMBER_ROLE.출제자) .map((job) => { const filteredRole = roles.find((role) => role.name === job); return { @@ -27,7 +28,7 @@ const BadgeSection = ({ memberType, memberJobs }: FollowListProps) => { return (
    {MemberJobInfo.map((job: RoleInfo) => ( - + ))} diff --git a/src/pages/Profile/Tab/BookTab/BookTab.tsx b/src/pages/Profile/Tab/BookTab/BookTab.tsx index 2fb69b095..6a7142331 100644 --- a/src/pages/Profile/Tab/BookTab/BookTab.tsx +++ b/src/pages/Profile/Tab/BookTab/BookTab.tsx @@ -7,6 +7,7 @@ import { useCancleReturnBookMutation, useCancleBorrowBookMutation, } from '@api/libraryApi'; +import { MEMBER_ROLE } from '@constants/member'; import BookCard from './Card/BookCard'; import BookGuide from './Guide/BookGuide'; @@ -20,7 +21,7 @@ const BookTab = () => { const { mutate: cancleReturnBookMutation } = useCancleReturnBookMutation(); const { mutate: cancleBorrowBookMutation } = useCancleBorrowBookMutation(); - const librarian = executiveInfos?.find((role) => role.jobName === 'ROLE_사서')?.realName || ''; + const librarian = executiveInfos?.find((role) => role.jobName === MEMBER_ROLE.사서)?.realName || ''; const borrowLength = borrowedBookListData?.content?.filter((bookInfo) => bookInfo.status === '대출대기').length; const returnLength = borrowedBookListData?.content?.filter((bookInfo) => bookInfo.status === '반납대기').length; diff --git a/src/pages/admin/DutyManage/Button/DutyProfileButton.tsx b/src/pages/admin/DutyManage/Button/DutyProfileButton.tsx index 443a25394..76456672a 100644 --- a/src/pages/admin/DutyManage/Button/DutyProfileButton.tsx +++ b/src/pages/admin/DutyManage/Button/DutyProfileButton.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { Button, Typography } from '@mui/material'; import { useGetExecutiveInfoQuery } from '@api/dutyManageApi'; +import { MEMBER_ROLE } from '@constants/member'; import muiTheme from '@constants/muiTheme'; import { convertJobName } from '@mocks/DutyManageApi'; @@ -21,7 +22,7 @@ const DutyProfileButton = ({ jobName, badgeImage, setTooltipOpen, toggleModalOpe toggleModalOpen(); }; - if (jobName === 'ROLE_전산관리자') { + if (jobName === MEMBER_ROLE.전산관리자) { return (
    diff --git a/src/pages/admin/DutyManage/DutyManage.tsx b/src/pages/admin/DutyManage/DutyManage.tsx index 01e24d5da..db45acf96 100644 --- a/src/pages/admin/DutyManage/DutyManage.tsx +++ b/src/pages/admin/DutyManage/DutyManage.tsx @@ -1,21 +1,21 @@ import React from 'react'; +import { MEMBER_ROLE } from '@constants/member'; import PageTitle from '@components/Typography/PageTitle'; - import DutyProfileTooltip from './Tooltip/DutyProfileTooltip'; const jobNameArray = [ - { key: 1, jobName: 'ROLE_학술부장' }, - { key: 2, jobName: 'ROLE_대외부장' }, - { key: 3, jobName: 'ROLE_전산관리자' }, - { key: 4, jobName: 'ROLE_서기' }, - { key: 5, jobName: 'ROLE_사서' }, - { key: 6, jobName: 'ROLE_총무' }, + { key: 1, jobName: MEMBER_ROLE.학술부장 }, + { key: 2, jobName: MEMBER_ROLE.대외부장 }, + { key: 3, jobName: MEMBER_ROLE.전산관리자 }, + { key: 4, jobName: MEMBER_ROLE.서기 }, + { key: 5, jobName: MEMBER_ROLE.사서 }, + { key: 6, jobName: MEMBER_ROLE.총무 }, ]; const ITjobNameArray = [ - { key: 1, jobName: 'ROLE_FRONT_전산관리자' }, - { key: 2, jobName: 'ROLE_BACK_전산관리자' }, - { key: 3, jobName: 'ROLE_INFRA_전산관리자' }, + { key: 1, jobName: MEMBER_ROLE.FRONT_전산관리자 }, + { key: 2, jobName: MEMBER_ROLE.BACK_전산관리자 }, + { key: 3, jobName: MEMBER_ROLE.INFRA_전산관리자 }, ]; const MiddleBar = () => { @@ -66,7 +66,7 @@ const ViceChairman = () => {
    - +
    @@ -78,7 +78,7 @@ const DutyManage = () => {
    직책관리
    - + diff --git a/src/pages/admin/DutyManage/Tooltip/DutyProfileTooltip.tsx b/src/pages/admin/DutyManage/Tooltip/DutyProfileTooltip.tsx index 0887743aa..79c955ac5 100644 --- a/src/pages/admin/DutyManage/Tooltip/DutyProfileTooltip.tsx +++ b/src/pages/admin/DutyManage/Tooltip/DutyProfileTooltip.tsx @@ -3,6 +3,7 @@ import { Typography } from '@mui/material'; import List from '@mui/material/List'; import ListItem from '@mui/material/ListItem'; import { VscSearch } from 'react-icons/vsc'; +import { MEMBER_ROLE } from '@constants/member'; import muiTheme from '@constants/muiTheme'; import { roleDutyListInfo, roles } from '@mocks/DutyManageApi'; @@ -50,12 +51,7 @@ const DutyProfileTooltip = ({ jobName }: DutyProfileTooltipProps) => { const [tooltipOpen, setTooltipOpen] = useState(false); const [modalOpen, toggleModalOpen] = useReducer((prev) => !prev, false); - let badgeImage; - if (jobName.search('전산관리자') !== -1) { - badgeImage = roles.find((role) => role.name === 'ROLE_전산관리자')?.img; - } else { - badgeImage = roles.find((role) => role.name === jobName)?.img; - } + const badgeImage = roles.find((role) => role.name === jobName)?.img; return (
    @@ -65,7 +61,7 @@ const DutyProfileTooltip = ({ jobName }: DutyProfileTooltipProps) => { setTooltipOpen={setTooltipOpen} toggleModalOpen={toggleModalOpen} /> - {jobName !== 'ROLE_전산관리자' ? ( + {jobName !== MEMBER_ROLE.전산관리자 && ( <> { badgeImage={badgeImage} /> - ) : null} + )}
    ); }; diff --git a/src/pages/senimarAttend/SenimarAttend.tsx b/src/pages/senimarAttend/SenimarAttend.tsx index 0b650e475..4ce8edaa2 100644 --- a/src/pages/senimarAttend/SenimarAttend.tsx +++ b/src/pages/senimarAttend/SenimarAttend.tsx @@ -8,6 +8,7 @@ import { useGetRecentlyDoneSeminarInfoQuery, useGetRecentlyUpcomingSeminarInfoQuery, } from '@api/seminarApi'; +import { MEMBER_ROLE } from '@constants/member'; import useCheckAuth from '@hooks/useCheckAuth'; import memberState from '@recoil/member.recoil'; import starterState from '@recoil/seminarStarter.recoil'; @@ -30,7 +31,7 @@ const SeminarAttend = () => { const { data: availableSeminarData } = useGetAvailableSeminarInfoQuery(); const { checkIncludeOneOfAuths } = useCheckAuth(); - const authorizedMember = checkIncludeOneOfAuths(['ROLE_회장', 'ROLE_부회장', 'ROLE_서기']); + const authorizedMember = checkIncludeOneOfAuths([MEMBER_ROLE.회장, MEMBER_ROLE.부회장, MEMBER_ROLE.서기]); const startMember: number | undefined = useRecoilValue(starterState); const member: MemberInfo | null = useRecoilValue(memberState); From 831bc6fcc7f16d617aa0b33d2441be2efa5cc053 Mon Sep 17 00:00:00 2001 From: pipisebastian Date: Sun, 10 Dec 2023 18:50:33 +0900 Subject: [PATCH 26/43] =?UTF-8?q?refactor=20:=20=EB=B0=B1=EC=97=94?= =?UTF-8?q?=EB=93=9C=20=EC=88=98=EB=9F=89=EC=9C=BC=EB=A1=9C=20=EC=9D=BC?= =?UTF-8?q?=EC=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/LibraryManage/Modal/UploadBookModal.tsx | 4 ++-- .../Selector/TotalBookNumberSelector.tsx | 13 +------------ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/pages/admin/LibraryManage/Modal/UploadBookModal.tsx b/src/pages/admin/LibraryManage/Modal/UploadBookModal.tsx index da29a157d..287860dd0 100644 --- a/src/pages/admin/LibraryManage/Modal/UploadBookModal.tsx +++ b/src/pages/admin/LibraryManage/Modal/UploadBookModal.tsx @@ -47,11 +47,11 @@ const UploadBookModal = ({ open, onClose, bookDetail }: SelectorProps) => { setAuthorHelperText('저자명을 입력해주세요'); setIsInvalidAuthor(true); } - if (titleTrim.length > 30) { + if (titleTrim.length > 200) { setTitleHelperText('도서명은 200자 이내여야 합니다.'); setIsInvalidTitle(true); } - if (authorTrim.length > 20) { + if (authorTrim.length > 30) { setAuthorHelperText('저자명은 30자 이내여야 합니다.'); setIsInvalidAuthor(true); } diff --git a/src/pages/admin/LibraryManage/Selector/TotalBookNumberSelector.tsx b/src/pages/admin/LibraryManage/Selector/TotalBookNumberSelector.tsx index ee49c0898..cad212787 100644 --- a/src/pages/admin/LibraryManage/Selector/TotalBookNumberSelector.tsx +++ b/src/pages/admin/LibraryManage/Selector/TotalBookNumberSelector.tsx @@ -8,18 +8,7 @@ interface TotalBookNumberProps { } const TotalBookNumberSelector = ({ value, setValue }: TotalBookNumberProps) => { - const bookNumberList = [ - { id: 1, content: '1권' }, - { id: 2, content: '2권' }, - { id: 3, content: '3권' }, - { id: 4, content: '4권' }, - { id: 5, content: '5권' }, - { id: 6, content: '6권' }, - { id: 7, content: '7권' }, - { id: 8, content: '8권' }, - { id: 9, content: '9권' }, - { id: 10, content: '10권' }, - ]; + const bookNumberList = Array.from({ length: 20 }, (_, index) => ({ id: index + 1, content: `${index + 1}권` })); const handleTotalBookNumberChange = (event: SelectChangeEvent) => { setValue(Number(event.target.value as string)); From d76f4442e4a8f34374357e9c2edcbee02a68a5b9 Mon Sep 17 00:00:00 2001 From: pipisebastian Date: Sun, 10 Dec 2023 19:20:05 +0900 Subject: [PATCH 27/43] =?UTF-8?q?refactor=20:=20=EC=A0=84=EC=82=B0?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20=EA=B4=80=EB=A0=A8=20=EC=A3=BC?= =?UTF-8?q?=EC=84=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/admin/DutyManage/Tooltip/DutyProfileTooltip.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/admin/DutyManage/Tooltip/DutyProfileTooltip.tsx b/src/pages/admin/DutyManage/Tooltip/DutyProfileTooltip.tsx index 79c955ac5..de8b48605 100644 --- a/src/pages/admin/DutyManage/Tooltip/DutyProfileTooltip.tsx +++ b/src/pages/admin/DutyManage/Tooltip/DutyProfileTooltip.tsx @@ -52,7 +52,7 @@ const DutyProfileTooltip = ({ jobName }: DutyProfileTooltipProps) => { const [modalOpen, toggleModalOpen] = useReducer((prev) => !prev, false); const badgeImage = roles.find((role) => role.name === jobName)?.img; - + // NOTE jobName으로는 "ROLE_전산관리자" 내려오지만, roles에는 존재하지 않습니다! 세부적인 전산관리자(프론트, 백, 인프라)만 존재합니다 return (
    Date: Sun, 10 Dec 2023 18:51:22 +0900 Subject: [PATCH 28/43] =?UTF-8?q?refactor=20:=20=EC=BB=A4=EC=8A=A4?= =?UTF-8?q?=ED=85=80=20=EB=84=88=EB=B9=84=20=EC=83=81=EC=88=98=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #850 --- src/components/Layout/Header/Header.tsx | 4 ++-- src/components/Layout/Sidebar/Sidebar.tsx | 4 ++-- src/constants/keeperTheme.ts | 10 ++++++++-- tailwind.config.js | 10 +++++----- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/components/Layout/Header/Header.tsx b/src/components/Layout/Header/Header.tsx index 17339901a..ea4f77946 100644 --- a/src/components/Layout/Header/Header.tsx +++ b/src/components/Layout/Header/Header.tsx @@ -4,7 +4,7 @@ import { AppBar, IconButton, Toolbar, Typography } from '@mui/material'; import { VscAccount, VscGithubInverted, VscThreeBars } from 'react-icons/vsc'; import { useRecoilValue } from 'recoil'; import { ReactComponent as Logo } from '@assets/logo/logo_neon.svg'; -import { HEADER_HEIGHT, KEEPER_COLOR } from '@constants/keeperTheme'; +import { KEEPER_HEIGHT, KEEPER_COLOR } from '@constants/keeperTheme'; import memberState from '@recoil/member.recoil'; import FilledButton from '@components/Button/FilledButton'; import AccountMenu from './Menu/AccountMenu'; @@ -33,7 +33,7 @@ const Header = ({ setMobileSidebarOpen }: HeaderProps) => { theme.zIndex.drawer + 1, height: HEADER_HEIGHT }} + sx={{ zIndex: (theme) => theme.zIndex.drawer + 1, height: KEEPER_HEIGHT.header }} >
    diff --git a/src/components/Layout/Sidebar/Sidebar.tsx b/src/components/Layout/Sidebar/Sidebar.tsx index b3e01826f..3812bc848 100644 --- a/src/components/Layout/Sidebar/Sidebar.tsx +++ b/src/components/Layout/Sidebar/Sidebar.tsx @@ -3,7 +3,7 @@ import { Button, Drawer, Toolbar, useMediaQuery, useTheme } from '@mui/material' import { VscBug } from 'react-icons/vsc'; import { Role } from '@api/dto'; import CATEGORIES from '@constants/category'; -import { KEEPER_COLOR, SIDEBAR_WIDTH } from '@constants/keeperTheme'; +import { KEEPER_COLOR, KEEPER_WIDTH } from '@constants/keeperTheme'; import useCheckAuth from '@hooks/useCheckAuth'; import CategoryNav from '@components/Navigation/CategoryNav'; @@ -26,7 +26,7 @@ const Sidebar = ({ mobileSidebarOpen, setMobileSidebarOpen }: SidebarProps) => { open={mobileSidebarOpen} onClose={() => setMobileSidebarOpen(false)} sx={{ - [`& .MuiDrawer-paper`]: { width: SIDEBAR_WIDTH, bgcolor: KEEPER_COLOR.mainBlack }, + [`& .MuiDrawer-paper`]: { width: KEEPER_WIDTH.sidebar, bgcolor: KEEPER_COLOR.mainBlack }, }} > diff --git a/src/constants/keeperTheme.ts b/src/constants/keeperTheme.ts index 907f482ac..c64740955 100644 --- a/src/constants/keeperTheme.ts +++ b/src/constants/keeperTheme.ts @@ -8,5 +8,11 @@ export const KEEPER_COLOR = { subOrange: '#FFA500', } as const; -export const SIDEBAR_WIDTH = 240; -export const HEADER_HEIGHT = { xs: 56, sm: 66 } as const; +export const KEEPER_WIDTH = { + sidebar: 240, + container: 1080, +} as const; + +export const KEEPER_HEIGHT = { + header: { xs: 56, sm: 66 }, +} as const; diff --git a/tailwind.config.js b/tailwind.config.js index df242a38c..85aa1a2ee 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,5 +1,5 @@ /** @type {import('tailwindcss').Config} */ -import { KEEPER_COLOR } from './src/constants/keeperTheme'; +import { KEEPER_HEIGHT, KEEPER_COLOR, KEEPER_WIDTH } from './src/constants/keeperTheme'; export const content = ['./src/**/*.{js,jsx,ts,tsx}']; export const theme = { @@ -24,14 +24,14 @@ export const theme = { small: '10px', }, spacing: { - header: '66px', - sidebar: '240px', + header: KEEPER_HEIGHT.header.sm, + sidebar: KEEPER_WIDTH.sidebar, }, maxWidth: { - container: '1080px', + container: KEEPER_WIDTH.container, }, minWidth: { - sidebar: '240px', + sidebar: KEEPER_WIDTH.sidebar, }, backgroundImage: { galaxy: "url('/public/img/background_galaxy.png')", From 9847b6945cf720d1d8a3c4abeb554a33b1b17bbe Mon Sep 17 00:00:00 2001 From: munkyeong Date: Sun, 10 Dec 2023 19:40:31 +0900 Subject: [PATCH 29/43] =?UTF-8?q?refactor=20:=20api=20=EA=B4=80=EB=A0=A8?= =?UTF-8?q?=20error/success=20=EB=A9=94=EC=8B=9C=EC=A7=80=20=EB=B3=80?= =?UTF-8?q?=EC=88=98=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/memberApi.ts | 9 +-- src/api/postApi.ts | 7 ++- src/api/seminarApi.ts | 3 +- src/constants/apiResponseMsg.ts | 57 +++++++++++++++++++ src/pages/Profile/Modal/EditAccountModal.tsx | 5 +- .../Section/SignUpFirstInputSection.tsx | 3 +- .../Section/SignUpThirdInputSection.tsx | 3 +- .../senimarAttend/Card/MemberCardContent.tsx | 5 +- 8 files changed, 78 insertions(+), 14 deletions(-) create mode 100644 src/constants/apiResponseMsg.ts diff --git a/src/api/memberApi.ts b/src/api/memberApi.ts index 93a5dec59..1c73a8451 100644 --- a/src/api/memberApi.ts +++ b/src/api/memberApi.ts @@ -4,6 +4,7 @@ import axios from 'axios'; import { useApiError } from '@hooks/useGetApiError'; import { formatGeneration } from '@utils/converter'; import { ProfileInfo, MemberDetailInfo } from './dto'; +import { PASSWORD } from '@constants/apiResponseMsg'; const memberKeys = { memberList: ['member', 'memberList'] as const, @@ -123,7 +124,7 @@ const useEditEmailMutation = () => { const { handleError } = useApiError({ 400: { default: () => { - toast.error('현재 비밀번호가 일치하지 않습니다.'); + toast.error(PASSWORD.error.passwordMismatch); }, }, }); @@ -138,7 +139,7 @@ const useEditPasswordMutation = () => { const { handleError } = useApiError({ 400: { default: () => { - toast.error('현재 비밀번호가 일치하지 않습니다.'); + toast.error(PASSWORD.error.passwordMismatch); }, }, }); @@ -147,7 +148,7 @@ const useEditPasswordMutation = () => { return useMutation(fetcher, { onSuccess: () => { - toast.success('비밀번호가 변경되었습니다.'); + toast.success(PASSWORD.success.changedSuccess); }, onError: (err) => handleError(err, 400), }); @@ -157,7 +158,7 @@ const useWithdrawalMutation = () => { const { handleError } = useApiError({ 400: { default: () => { - toast.error('비밀번호가 일치하지 않습니다.'); + toast.error(PASSWORD.error.passwordMismatch); }, }, }); diff --git a/src/api/postApi.ts b/src/api/postApi.ts index f3d08cad7..c0840f665 100644 --- a/src/api/postApi.ts +++ b/src/api/postApi.ts @@ -15,6 +15,7 @@ import { PageAndSize, MemberPost, } from './dto'; +import { POST } from '@constants/apiResponseMsg'; const postKeys = { memberPost: (param: PageAndSize & { memberId: number }) => ['memberPost', param] as const, @@ -151,12 +152,12 @@ const useGetEachPostQuery = ( 400: { default: () => { // TODO 페이지 문구로 띄워주기 - toast.error('게시글 열람 조건을 충족하지 않습니다.'); + toast.error(POST.error.readCondition); }, }, 403: { 40301: () => { - toast.error('게시글의 비밀번호가 일치하지 않습니다.'); + toast.error(POST.error.passwordMismatch); }, 40302: () => { // 비밀글 여부 true로 변경 @@ -226,7 +227,7 @@ const useDownloadFileMutation = () => { }, onError: (error) => { if ((error as AxiosError)?.response?.status === 400) { - toast.error('댓글 작성이 필요합니다.'); + toast.error(POST.error.commentRequired); } }, }); diff --git a/src/api/seminarApi.ts b/src/api/seminarApi.ts index d5ba3ac12..715199805 100644 --- a/src/api/seminarApi.ts +++ b/src/api/seminarApi.ts @@ -3,6 +3,7 @@ import axios from 'axios'; import { DateTime } from 'luxon'; import { useApiError } from '@hooks/useGetApiError'; import { AttendSeminarListInfo, SeminarStatus, SeminarInfo, SeminarCardInfo } from './dto'; +import { SEMINAR } from '@constants/apiResponseMsg'; const seminarKeys = { getSeminarList: ['getSeminar', 'seminarList'] as const, @@ -143,7 +144,7 @@ const useAddSeminarMutation = ({ setHelperText }: { setHelperText: React.Dispatc const { handleError } = useApiError({ 409: { 40901: () => { - setHelperText('동일한 날짜의 세미나는 생성할 수 없습니다.'); + setHelperText(SEMINAR.error.duplicateSeminarDate); }, }, }); diff --git a/src/constants/apiResponseMsg.ts b/src/constants/apiResponseMsg.ts new file mode 100644 index 000000000..a0a2ab4ca --- /dev/null +++ b/src/constants/apiResponseMsg.ts @@ -0,0 +1,57 @@ +export const COMMON = {} as const; + +export const PASSWORD = { + success: { + changedSuccess: '비밀번호가 변경되었습니다.', + }, + error: { + passwordMismatch: '현재 비밀번호가 일치하지 않습니다.', + }, +} as const; + +export const POST = { + success: {}, + error: { + readCondition: '게시글 열람 조건을 충족하지 않습니다.', + passwordMismatch: '게시글의 비밀번호가 일치하지 않습니다.', + commentRequired: '댓글 작성이 필요합니다.', + }, +} as const; + +export const SEMINAR = { + success: {}, + error: { + duplicateSeminarDate: '동일한 날짜의 세미나는 생성할 수 없습니다.', + }, +} as const; + +export const EMAIL = { + success: { + changedSuccess: '이메일 변경 성공하였습니다.', + }, + error: { + existingEmail: '이미 존재하는 이메일입니다.', + }, +} as const; + +export const MEMBER_CARD = { + success: {}, + error: { + noSubmissionsLeft: '남은 제출 횟수가 없습니다.', + invalidAttendanceWithCount: (min: number) => `출석코드가 틀렸습니다. (남은 제출횟수 ${min}회)` as const, + }, +} as const; + +export const ID = { + success: {}, + errror: { + existingId: '이미 존재하는 아이디입니다.', + }, +}; + +export const StudentID = { + success: {}, + errror: { + existingStudentId: '이미 존재하는 학번입니다.', + }, +}; diff --git a/src/pages/Profile/Modal/EditAccountModal.tsx b/src/pages/Profile/Modal/EditAccountModal.tsx index 589e83c07..41cb5ff50 100644 --- a/src/pages/Profile/Modal/EditAccountModal.tsx +++ b/src/pages/Profile/Modal/EditAccountModal.tsx @@ -23,6 +23,7 @@ import EmailAuthInput from '@components/Input/EmailAuthInput'; import StandardInput from '@components/Input/StandardInput'; import TimerInput from '@components/Input/TimerInput'; import ConfirmModal from '@components/Modal/ConfirmModal'; +import { EMAIL } from '@constants/apiResponseMsg'; const EditEmailSection = () => { const [expirationTime, setExpirationTime] = useState(null); @@ -57,7 +58,7 @@ const EditEmailSection = () => { { email, auth, password }, { onSuccess: () => { - toast.success('이메일 변경 성공하였습니다.'); + toast.success(EMAIL.success.changedSuccess); setIsEmailSent(false); reset(); }, @@ -69,7 +70,7 @@ const EditEmailSection = () => { if (!checkEmailDuplicationSuccess) return; if (isEmailDuplicate.duplicate === true) { - setError('email', { message: '이미 존재하는 이메일입니다.' }); + setError('email', { message: EMAIL.error.existingEmail }); setIsEmailSent(false); return; } diff --git a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx index 26ae00350..6399fb171 100644 --- a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx @@ -10,6 +10,7 @@ import FilledButton from '@components/Button/FilledButton'; import OutlinedButton from '@components/Button/OutlinedButton'; import StandardInput from '@components/Input/StandardInput'; import signUpPageState from '../SignUp.recoil'; +import { ID } from '@constants/apiResponseMsg'; interface SignUpFirstInputSectionProps { setCurrentStep: React.Dispatch>; @@ -50,7 +51,7 @@ const SignUpFirstInputSection = ({ setCurrentStep }: SignUpFirstInputSectionProp if (!isLoginIdDuplicate) return; if (isLoginIdDuplicate.duplicate === true) { - setError('loginId', { message: '이미 존재하는 아이디입니다.' }); + setError('loginId', { message: ID.errror.existingId }); setCheckLoginIdDuplicateEnabled(false); } }, [isLoginIdDuplicate]); diff --git a/src/pages/SignUp/Section/SignUpThirdInputSection.tsx b/src/pages/SignUp/Section/SignUpThirdInputSection.tsx index 0d32074e4..f09a399ac 100644 --- a/src/pages/SignUp/Section/SignUpThirdInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpThirdInputSection.tsx @@ -13,6 +13,7 @@ import EmailAuthInput from '@components/Input/EmailAuthInput'; import TimerInput from '@components/Input/TimerInput'; import MailAuthenticationModal from '@components/Modal/MailAuthenticationModal'; import signUpPageState from '../SignUp.recoil'; +import { EMAIL } from '@constants/apiResponseMsg'; const SignUpThirdInputSection = () => { const [expirationTime, setExpirationTime] = useState(null); @@ -73,7 +74,7 @@ const SignUpThirdInputSection = () => { if (!checkEmailDuplicationSuccess) return; if (isEmailDuplicate.duplicate === true) { - setError('email', { message: '이미 존재하는 이메일입니다.' }); + setError('email', { message: EMAIL.error.existingEmail }); setIsEmailSent(false); return; } diff --git a/src/pages/senimarAttend/Card/MemberCardContent.tsx b/src/pages/senimarAttend/Card/MemberCardContent.tsx index c8ead08ea..85b6a30bc 100644 --- a/src/pages/senimarAttend/Card/MemberCardContent.tsx +++ b/src/pages/senimarAttend/Card/MemberCardContent.tsx @@ -11,6 +11,7 @@ import Countdown from '../Countdown/Countdown'; import SeminarInput from '../Input/SeminarInput'; import SeminarAttendStatus from '../Status/SeminarAttendStatus'; import attendCountState from '../seminarAttend.recoil'; +import { MEMBER_CARD } from '@constants/apiResponseMsg'; interface ErrorResponse { message: string; @@ -51,10 +52,10 @@ const MemberCardContent = ({ seminarId }: { seminarId: number }) => { if (remainAttendCount <= 0) { setExcessModalOpen(true); - setIncorrectCodeMsg('남은 제출 횟수가 없습니다.'); + setIncorrectCodeMsg(MEMBER_CARD.error.noSubmissionsLeft); return; } - setIncorrectCodeMsg(`출석코드가 틀렸습니다. (남은 제출횟수 ${remainAttendCount}회)`); + setIncorrectCodeMsg(MEMBER_CARD.error.invalidAttendanceWithCount(remainAttendCount)); return; } const errorMessage = axiosError?.response?.data?.message; From c77e8a606e92d2293c98c0db9fcda7fa52250e0b Mon Sep 17 00:00:00 2001 From: publdaze Date: Sun, 10 Dec 2023 19:52:45 +0900 Subject: [PATCH 30/43] =?UTF-8?q?chore=20:=20chat=20gpt=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EB=A6=AC=EB=B7=B0=20=EC=84=A4=EC=A0=95=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gpt_review.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/workflows/gpt_review.yml diff --git a/.github/workflows/gpt_review.yml b/.github/workflows/gpt_review.yml deleted file mode 100644 index 75aa3cf85..000000000 --- a/.github/workflows/gpt_review.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Code Review - -permissions: - contents: read - pull-requests: write - -on: - pull_request: - types: [opened, reopened, synchronize] - -jobs: - test: - if: ${{ contains(github.event.*.labels.*.name, 'gpt review') }} - runs-on: ubuntu-latest - steps: - - uses: anc95/ChatGPT-CodeReview@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - LANGUAGE: Korean From 7a2c71b084ff05069122cc2b7c10575d3a59d95b Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Sun, 10 Dec 2023 19:58:18 +0900 Subject: [PATCH 31/43] =?UTF-8?q?refactor=20:=20helper=20text=20constants?= =?UTF-8?q?=EB=A1=9C=20=EB=B9=BC=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #847 --- src/constants/helperText.ts | 59 +++++++++++++++++-- src/pages/Profile/Modal/EditAccountModal.tsx | 26 ++++---- src/pages/Profile/Modal/EditProfileModal.tsx | 8 +-- src/pages/Profile/Modal/SendPointModal.tsx | 12 ++-- .../Section/SignUpFirstInputSection.tsx | 20 +++---- .../Section/SignUpSecondInputSection.tsx | 12 ++-- .../Section/SignUpThirdInputSection.tsx | 8 +-- src/pages/SignUp/SignUp.tsx | 14 ++--- src/pages/Study/Modal/StudyModal.tsx | 16 ++--- .../LibraryManage/Modal/UploadBookModal.tsx | 9 +-- .../board/BoardView/Modal/SecretPostModal.tsx | 6 +- src/pages/board/BoardWrite/BoardWrite.tsx | 8 +-- .../BoardWrite/Modal/SettingUploadModal.tsx | 6 +- src/pages/login/Search/SearchPWFirstStep.tsx | 8 +-- src/pages/login/Search/SearchPWSecondStep.tsx | 8 +-- 15 files changed, 136 insertions(+), 84 deletions(-) diff --git a/src/constants/helperText.ts b/src/constants/helperText.ts index 25ed96c64..45d23542e 100644 --- a/src/constants/helperText.ts +++ b/src/constants/helperText.ts @@ -1,4 +1,55 @@ -export const REQUIRE_ERROR_MSG = '필수 정보입니다.'; -export const NUMBER_ERROR_MSG = '숫자만 입력 가능합니다.'; -export const PASSWORD_ERROR_MSG = '8~20자 영문과 숫자를 사용하세요.'; -export const MIN_LENGTH_ERROR_MSG = (min: number) => `${min}글자 이상 입력해주세요.` as const; +export const COMMON = { + success: {}, + error: { + required: '필수 정보입니다.', + onlyNumber: '숫자만 입력 가능합니다.', + onlyHttps: 'https:// 로 시작해야 합니다.', + underMinLen: (min: number) => `${min}글자 이상 입력해주세요.` as const, + overMaxLen: (max: number) => `최대 ${max}글자 입력해주세요.` as const, + }, +} as const; + +export const EMAIL_MSG = { + success: {}, + error: { + formatError: '이메일 형식을 확인해주세요.', + }, +} as const; + +export const PASSWORD_MSG = { + success: { + correct: '비밀번호가 일치합니다.', + }, + error: { + incorrect: '비밀번호가 일치하지 않습니다.', + formatError: '8~20자 영문과 숫자를 사용하세요.', + }, +} as const; + +export const NAME_MSG = { + success: {}, + error: { + formatError: '1~20자 한글, 영어만 가능합니다.', + }, +} as const; + +export const SEND_POINT_MSG = { + success: {}, + error: { + overMaxValue: '보유 포인트보다 많은 포인트를 보낼 수 없습니다.', + }, +} as const; + +export const LOGIN_ID_MSG = { + success: {}, + error: { + formatError: '4~12자 영어, 숫자, _ 만 가능합니다.', + }, +} as const; + +export const STUDY_MSG = { + success: {}, + error: { + onlyGitLink: '깃허브 링크만 입력이 가능합니다.', + }, +} as const; diff --git a/src/pages/Profile/Modal/EditAccountModal.tsx b/src/pages/Profile/Modal/EditAccountModal.tsx index 7a76c35f8..07014a09b 100644 --- a/src/pages/Profile/Modal/EditAccountModal.tsx +++ b/src/pages/Profile/Modal/EditAccountModal.tsx @@ -14,7 +14,7 @@ import { useWithdrawalMutation, } from '@api/memberApi'; import { useCheckEmailDuplicationQuery } from '@api/signUpApi'; -import { MIN_LENGTH_ERROR_MSG, PASSWORD_ERROR_MSG, REQUIRE_ERROR_MSG } from '@constants/helperText'; +import { COMMON, EMAIL_MSG, PASSWORD_MSG } from '@constants/helperText'; import memberState from '@recoil/member.recoil'; import { emailRegex } from '@utils/validateEmail'; import FilledButton from '@components/Button/FilledButton'; @@ -97,7 +97,7 @@ const EditEmailSection = () => { defaultValue="" control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, }} render={({ field, fieldState: { error } }) => { return ( @@ -117,10 +117,10 @@ const EditEmailSection = () => { defaultValue="" control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, pattern: { value: emailRegex, - message: '이메일 주소를 다시 확인해주세요.', + message: EMAIL_MSG.error.formatError, }, }} render={({ field, fieldState: { error, isDirty } }) => { @@ -144,7 +144,7 @@ const EditEmailSection = () => { defaultValue="" control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, }} render={({ field, fieldState: { error } }) => { return ( @@ -206,7 +206,7 @@ const EditPasswordSection = () => { defaultValue="" control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, }} render={({ field, fieldState: { error } }) => { return ( @@ -226,14 +226,14 @@ const EditPasswordSection = () => { defaultValue="" control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, minLength: { value: 8, - message: MIN_LENGTH_ERROR_MSG(8), + message: COMMON.error.underMinLen(8), }, pattern: { value: /^(?=.*[a-zA-Z])(?=.*[0-9]).{8,20}$/, - message: PASSWORD_ERROR_MSG, + message: PASSWORD_MSG.error.formatError, }, }} render={({ field, fieldState: { error } }) => { @@ -254,11 +254,11 @@ const EditPasswordSection = () => { defaultValue="" control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, validate: { confirmMatchPassward: (value) => { - if (getValues('newPassword') !== value) return '비밀번호가 일치하지 않습니다.'; - setPasswordConfirmSuccessMsg('비밀번호가 일치합니다.'); + if (getValues('newPassword') !== value) return PASSWORD_MSG.error.incorrect; + setPasswordConfirmSuccessMsg(PASSWORD_MSG.success.correct); return undefined; }, }, @@ -348,7 +348,7 @@ const EditAccountModal = ({ open, onClose }: EditAccountModalProps) => { defaultValue="" control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, }} render={({ field, fieldState: { error } }) => { return ( diff --git a/src/pages/Profile/Modal/EditProfileModal.tsx b/src/pages/Profile/Modal/EditProfileModal.tsx index d3690db04..6200f9b27 100644 --- a/src/pages/Profile/Modal/EditProfileModal.tsx +++ b/src/pages/Profile/Modal/EditProfileModal.tsx @@ -3,7 +3,7 @@ import { Controller, FieldValues, SubmitHandler, useForm } from 'react-hook-form import { Stack } from '@mui/material'; import { ProfileInfo } from '@api/dto'; import { useEditProfileMutation, useEditProfileThumbnailMutation } from '@api/memberApi'; -import { REQUIRE_ERROR_MSG } from '@constants/helperText'; +import { COMMON, NAME_MSG } from '@constants/helperText'; import StandardDatePicker from '@components/DatePicker/StandardDatePicker'; import StandardInput from '@components/Input/StandardInput'; import ActionModal from '@components/Modal/ActionModal'; @@ -65,14 +65,14 @@ const EditProfileModal = ({ profileInfo, open, onClose }: EditProfileModalProps) defaultValue={profileInfo.realName} control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, maxLength: { value: NAME_MAX_LENGTH, - message: `이름은 최대 ${NAME_MAX_LENGTH}글자 입력이 가능합니다.`, + message: COMMON.error.overMaxLen(NAME_MAX_LENGTH), }, pattern: { value: /^[가-힣a-zA-Z]{1,20}$/, - message: '1~20자 한글, 영어만 가능합니다.', + message: NAME_MSG.error.formatError, }, }} render={({ field, fieldState: { error } }) => { diff --git a/src/pages/Profile/Modal/SendPointModal.tsx b/src/pages/Profile/Modal/SendPointModal.tsx index fb74b821d..50cb3036d 100644 --- a/src/pages/Profile/Modal/SendPointModal.tsx +++ b/src/pages/Profile/Modal/SendPointModal.tsx @@ -4,7 +4,7 @@ import { InputLabel } from '@mui/material'; import { useRecoilValue } from 'recoil'; import { useGetProfileQuery } from '@api/memberApi'; import { useSendPointMutation } from '@api/pointApi'; -import { NUMBER_ERROR_MSG, REQUIRE_ERROR_MSG } from '@constants/helperText'; +import { COMMON, SEND_POINT_MSG } from '@constants/helperText'; import memberState from '@recoil/member.recoil'; import StandardInput from '@components/Input/StandardInput'; import ActionModal from '@components/Modal/ActionModal'; @@ -69,14 +69,14 @@ const SendPointModal = ({ open, onClose, sendTo }: SendPointModalProps) => { defaultValue={1} control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, max: { value: profileInfo.point, - message: '보유 포인트보다 많은 포인트를 보낼 수 없습니다.', + message: SEND_POINT_MSG.error.overMaxValue, }, pattern: { value: /^[0-9]+$/, - message: NUMBER_ERROR_MSG, + message: COMMON.error.onlyNumber, }, }} render={({ field, fieldState: { error } }) => ( @@ -97,10 +97,10 @@ const SendPointModal = ({ open, onClose, sendTo }: SendPointModalProps) => { defaultValue="" control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, maxLength: { value: SEND_POINT_MAX_LENGTH, - message: `최대 ${SEND_POINT_MAX_LENGTH}글자 입력이 가능합니다.`, + message: COMMON.error.overMaxLen(SEND_POINT_MAX_LENGTH), }, }} render={({ field, fieldState: { error } }) => ( diff --git a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx index ff4014a9d..62901d5e8 100644 --- a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx @@ -6,7 +6,7 @@ import { VscCheck } from 'react-icons/vsc'; import { useSetRecoilState } from 'recoil'; import { signUpKeys, useCheckLoginIdDuplicationQuery } from '@api/signUpApi'; -import { MIN_LENGTH_ERROR_MSG, PASSWORD_ERROR_MSG, REQUIRE_ERROR_MSG } from '@constants/helperText'; +import { COMMON, LOGIN_ID_MSG, PASSWORD_MSG } from '@constants/helperText'; import FilledButton from '@components/Button/FilledButton'; import OutlinedButton from '@components/Button/OutlinedButton'; import StandardInput from '@components/Input/StandardInput'; @@ -72,14 +72,14 @@ const SignUpFirstInputSection = ({ setCurrentStep }: SignUpFirstInputSectionProp defaultValue="" control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, minLength: { value: 4, - message: MIN_LENGTH_ERROR_MSG(4), + message: COMMON.error.underMinLen(4), }, pattern: { value: /^[a-zA-Z0-9_]{4,12}$/, - message: '4~12자 영어, 숫자, _ 만 가능합니다.', + message: LOGIN_ID_MSG.error.formatError, }, }} render={({ field, fieldState: { error, isDirty } }) => { @@ -108,14 +108,14 @@ const SignUpFirstInputSection = ({ setCurrentStep }: SignUpFirstInputSectionProp defaultValue="" control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, minLength: { value: 8, - message: MIN_LENGTH_ERROR_MSG(8), + message: COMMON.error.underMinLen(8), }, pattern: { value: /^(?=.*[a-zA-Z])(?=.*[0-9]).{8,20}$/, - message: PASSWORD_ERROR_MSG, + message: PASSWORD_MSG.error.formatError, }, }} render={({ field, fieldState: { error } }) => { @@ -136,11 +136,11 @@ const SignUpFirstInputSection = ({ setCurrentStep }: SignUpFirstInputSectionProp defaultValue="" control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, validate: { confirmMatchPassward: (value) => { - if (getValues('password') !== value) return '비밀번호가 일치하지 않습니다.'; - setPasswordConfirmSuccessMsg('비밀번호가 일치합니다.'); + if (getValues('password') !== value) return PASSWORD_MSG.error.incorrect; + setPasswordConfirmSuccessMsg(PASSWORD_MSG.success.correct); return undefined; }, }, diff --git a/src/pages/SignUp/Section/SignUpSecondInputSection.tsx b/src/pages/SignUp/Section/SignUpSecondInputSection.tsx index dcde5db6a..2a928b69a 100644 --- a/src/pages/SignUp/Section/SignUpSecondInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpSecondInputSection.tsx @@ -5,7 +5,7 @@ import { Stack } from '@mui/material'; import { VscCheck } from 'react-icons/vsc'; import { useSetRecoilState } from 'recoil'; import { signUpKeys, useCheckStudentIdDuplicationQuery } from '@api/signUpApi'; -import { NUMBER_ERROR_MSG, REQUIRE_ERROR_MSG } from '@constants/helperText'; +import { COMMON, NAME_MSG } from '@constants/helperText'; import FilledButton from '@components/Button/FilledButton'; import OutlinedButton from '@components/Button/OutlinedButton'; import StandardDatePicker from '@components/DatePicker/StandardDatePicker'; @@ -78,14 +78,14 @@ const SignUpSecondInputSection = ({ setCurrentStep }: SignUpFirstInputSectionPro defaultValue="" control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, maxLength: { value: NAME_MAX_LENGTH, - message: `이름은 최대 ${NAME_MAX_LENGTH}글자 입력이 가능합니다.`, + message: COMMON.error.overMaxLen(NAME_MAX_LENGTH), }, pattern: { value: /^[가-힣a-zA-Z]{1,20}$/, - message: '1~20자 한글, 영어만 가능합니다.', + message: NAME_MSG.error.formatError, }, }} render={({ field, fieldState: { error } }) => { @@ -99,10 +99,10 @@ const SignUpSecondInputSection = ({ setCurrentStep }: SignUpFirstInputSectionPro defaultValue="" control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, pattern: { value: /^[0-9]+$/, - message: NUMBER_ERROR_MSG, + message: COMMON.error.onlyNumber, }, }} render={({ field, fieldState: { error, isDirty } }) => { diff --git a/src/pages/SignUp/Section/SignUpThirdInputSection.tsx b/src/pages/SignUp/Section/SignUpThirdInputSection.tsx index dabf555ad..039b8d05b 100644 --- a/src/pages/SignUp/Section/SignUpThirdInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpThirdInputSection.tsx @@ -6,7 +6,7 @@ import { Stack, Typography } from '@mui/material'; import { DateTime } from 'luxon'; import { useRecoilValue } from 'recoil'; import { useCheckEmailDuplicationQuery, useEmailAuthMutation, useSignUpMutation } from '@api/signUpApi'; -import { REQUIRE_ERROR_MSG } from '@constants/helperText'; +import { COMMON, EMAIL_MSG } from '@constants/helperText'; import { emailRegex } from '@utils/validateEmail'; import OutlinedButton from '@components/Button/OutlinedButton'; import EmailAuthInput from '@components/Input/EmailAuthInput'; @@ -92,10 +92,10 @@ const SignUpThirdInputSection = () => { defaultValue="" control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, pattern: { value: emailRegex, - message: '이메일 주소를 다시 확인해주세요.', + message: EMAIL_MSG.error.formatError, }, }} render={({ field, fieldState: { error, isDirty } }) => { @@ -119,7 +119,7 @@ const SignUpThirdInputSection = () => { defaultValue="" control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, }} render={({ field, fieldState: { error } }) => { return ( diff --git a/src/pages/SignUp/SignUp.tsx b/src/pages/SignUp/SignUp.tsx index ad36540ec..1b38c97f5 100644 --- a/src/pages/SignUp/SignUp.tsx +++ b/src/pages/SignUp/SignUp.tsx @@ -7,15 +7,15 @@ import SignUpFirstInputSection from './Section/SignUpFirstInputSection'; import SignUpSecondInputSection from './Section/SignUpSecondInputSection'; import SignUpThirdInputSection from './Section/SignUpThirdInputSection'; -const SignUp = () => { - const TOTAL_STEPS = 3; +const TOTAL_STEPS = 3; +const stepInfoMsg = { + 1: '로그인에 사용할\n아이디와 비밀번호를 등록해 주세요.', + 2: '프로필 정보를 등록해 주세요.', + 3: '이메일 주소를 입력해주세요.\n입력한 이메일 주소로 인증 코드가 발송됩니다.', +}; +const SignUp = () => { const [currentStep, setCurrentStep] = useState<1 | 2 | 3>(1); - const stepInfoMsg = { - 1: '로그인에 사용할\n아이디와 비밀번호를 등록해 주세요.', - 2: '프로필 정보를 등록해 주세요.', - 3: '이메일 주소를 입력해주세요.\n입력한 이메일 주소로 인증 코드가 발송됩니다.', - }; const stepInputSection = { 1: , diff --git a/src/pages/Study/Modal/StudyModal.tsx b/src/pages/Study/Modal/StudyModal.tsx index 4d734ff7e..e487cbb5a 100644 --- a/src/pages/Study/Modal/StudyModal.tsx +++ b/src/pages/Study/Modal/StudyModal.tsx @@ -14,7 +14,7 @@ import { useEditStudyThumbnailMutation, useGetStudyQuery, } from '@api/studyApi'; -import { REQUIRE_ERROR_MSG } from '@constants/helperText'; +import { COMMON, STUDY_MSG } from '@constants/helperText'; import memberState from '@recoil/member.recoil'; import AutoComplete, { MultiAutoCompleteValue } from '@components/Input/AutoComplete'; import StandardInput from '@components/Input/StandardInput'; @@ -168,10 +168,10 @@ const StudyModal = ({ open, setOpen, selectedStudyInfo, setSelectedStudyInfo, cu defaultValue={selectedStudyInfo?.title ?? ''} control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, maxLength: { value: STUDY_TITLE_MAX_LENGTH, - message: `최대 ${STUDY_TITLE_MAX_LENGTH}글자 입력이 가능합니다.`, + message: COMMON.error.overMaxLen(STUDY_TITLE_MAX_LENGTH), }, }} render={({ field, fieldState: { error } }) => { @@ -194,10 +194,10 @@ const StudyModal = ({ open, setOpen, selectedStudyInfo, setSelectedStudyInfo, cu defaultValue={studyDetail?.information ?? ''} control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, maxLength: { value: STUDY_CONTENT_MAX_LENGTH, - message: `최대 ${STUDY_CONTENT_MAX_LENGTH}글자 입력이 가능합니다.`, + message: COMMON.error.overMaxLen(STUDY_CONTENT_MAX_LENGTH), }, }} render={({ field, fieldState: { error } }) => { @@ -265,7 +265,7 @@ const StudyModal = ({ open, setOpen, selectedStudyInfo, setSelectedStudyInfo, cu rules={{ pattern: { value: /^(https:\/\/github.com)/, - message: `깃헙 링크만 입력이 가능합니다.`, + message: STUDY_MSG.error.onlyGitLink, }, }} render={({ field, fieldState: { error } }) => { @@ -296,7 +296,7 @@ const StudyModal = ({ open, setOpen, selectedStudyInfo, setSelectedStudyInfo, cu rules={{ pattern: { value: /^(https:\/\/)/, - message: `https:// 로 시작해야 합니다.`, + message: COMMON.error.onlyHttps, }, }} render={({ field, fieldState: { error } }) => { @@ -347,7 +347,7 @@ const StudyModal = ({ open, setOpen, selectedStudyInfo, setSelectedStudyInfo, cu rules={{ pattern: { value: /^(https:\/\/)/, - message: `https:// 로 시작해야 합니다.`, + message: COMMON.error.onlyHttps, }, }} render={({ field, fieldState: { error } }) => { diff --git a/src/pages/admin/LibraryManage/Modal/UploadBookModal.tsx b/src/pages/admin/LibraryManage/Modal/UploadBookModal.tsx index 287860dd0..fa5f0d4ec 100644 --- a/src/pages/admin/LibraryManage/Modal/UploadBookModal.tsx +++ b/src/pages/admin/LibraryManage/Modal/UploadBookModal.tsx @@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react'; import { Typography, Tooltip } from '@mui/material'; import { ManageBookInfo } from '@api/dto'; import { useAddBookMutation, useEditBookInfoMutation, useEditBookThumbnailMutation } from '@api/libraryManageApi'; +import { COMMON } from '@constants/helperText'; import StandardInput from '@components/Input/StandardInput'; import ActionModal from '@components/Modal/ActionModal'; import ImageUploader from '@components/Uploader/ImageUploader'; @@ -40,19 +41,19 @@ const UploadBookModal = ({ open, onClose, bookDetail }: SelectorProps) => { const authorTrim = author.trim(); if (titleTrim === '') { - setTitleHelperText('도서명을 입력해주세요'); + setTitleHelperText(COMMON.error.required); setIsInvalidTitle(true); } if (authorTrim === '') { - setAuthorHelperText('저자명을 입력해주세요'); + setAuthorHelperText(COMMON.error.required); setIsInvalidAuthor(true); } if (titleTrim.length > 200) { - setTitleHelperText('도서명은 200자 이내여야 합니다.'); + setTitleHelperText(COMMON.error.overMaxLen(200)); setIsInvalidTitle(true); } if (authorTrim.length > 30) { - setAuthorHelperText('저자명은 30자 이내여야 합니다.'); + setAuthorHelperText(COMMON.error.overMaxLen(30)); setIsInvalidAuthor(true); } diff --git a/src/pages/board/BoardView/Modal/SecretPostModal.tsx b/src/pages/board/BoardView/Modal/SecretPostModal.tsx index 8fddfeeec..d5040b04f 100644 --- a/src/pages/board/BoardView/Modal/SecretPostModal.tsx +++ b/src/pages/board/BoardView/Modal/SecretPostModal.tsx @@ -2,7 +2,7 @@ import React, { Dispatch, SetStateAction } from 'react'; import { Controller, useForm } from 'react-hook-form'; import { useNavigate } from 'react-router-dom'; import { Typography } from '@mui/material'; -import { REQUIRE_ERROR_MSG } from '@constants/helperText'; +import { COMMON } from '@constants/helperText'; import { POST_PASSWORD_MAX_LENGTH } from '@pages/board/BoardWrite/Modal/SettingUploadModal'; import StandardInput from '@components/Input/StandardInput'; import ActionModal from '@components/Modal/ActionModal'; @@ -49,10 +49,10 @@ const SecretPostModal = ({ setPassword, setIsSecretPasswordSubmited, open, setOp defaultValue="" control={control} rules={{ - required: `작성자가 아닐 시 ${REQUIRE_ERROR_MSG}`, + required: COMMON.error.required, maxLength: { value: POST_PASSWORD_MAX_LENGTH, - message: `비밀번호는 최대 ${POST_PASSWORD_MAX_LENGTH}글자 입력이 가능합니다.`, + message: COMMON.error.overMaxLen(POST_PASSWORD_MAX_LENGTH), }, }} render={({ field, fieldState: { error } }) => { diff --git a/src/pages/board/BoardWrite/BoardWrite.tsx b/src/pages/board/BoardWrite/BoardWrite.tsx index 4c72ea2d5..3c4add3af 100644 --- a/src/pages/board/BoardWrite/BoardWrite.tsx +++ b/src/pages/board/BoardWrite/BoardWrite.tsx @@ -13,7 +13,7 @@ import { useEditPostThumbnailMutation, useUploadPostMutation, } from '@api/postApi'; -import { REQUIRE_ERROR_MSG } from '@constants/helperText'; +import { COMMON } from '@constants/helperText'; import memberState from '@recoil/member.recoil'; import { categoryNameToId } from '@utils/converter'; import OutlinedButton from '@components/Button/OutlinedButton'; @@ -74,7 +74,7 @@ const BoardWrite = () => { if (!content || content.length < 0) { setHasContent(false); - setContentErrMsg(REQUIRE_ERROR_MSG); + setContentErrMsg(COMMON.error.required); return; } setHasContent(true); @@ -172,10 +172,10 @@ const BoardWrite = () => { defaultValue={editMode ? editMode.post.title : ''} control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, maxLength: { value: POST_TITLE_MAX_LENGTH, - message: `제목은 최대 ${POST_TITLE_MAX_LENGTH}글자 입력이 가능합니다.`, + message: COMMON.error.overMaxLen(POST_TITLE_MAX_LENGTH), }, }} render={({ field, fieldState: { error } }) => { diff --git a/src/pages/board/BoardWrite/Modal/SettingUploadModal.tsx b/src/pages/board/BoardWrite/Modal/SettingUploadModal.tsx index 2146d252a..57b139e7f 100644 --- a/src/pages/board/BoardWrite/Modal/SettingUploadModal.tsx +++ b/src/pages/board/BoardWrite/Modal/SettingUploadModal.tsx @@ -2,7 +2,7 @@ import React, { useEffect } from 'react'; import { Controller, useForm } from 'react-hook-form'; import { Checkbox, FormControlLabel, FormGroup, Typography, useMediaQuery, useTheme } from '@mui/material'; import { UploadPostSettings, PostInfo } from '@api/dto'; -import { REQUIRE_ERROR_MSG } from '@constants/helperText'; +import { COMMON } from '@constants/helperText'; import StandardInput from '@components/Input/StandardInput'; import ActionModal from '@components/Modal/ActionModal'; import ImageUploader from '@components/Uploader/ImageUploader'; @@ -118,10 +118,10 @@ const SettingUploadModal = ({ defaultValue="" control={control} rules={{ - required: REQUIRE_ERROR_MSG, + required: COMMON.error.required, maxLength: { value: POST_PASSWORD_MAX_LENGTH, - message: `비밀번호는 최대 ${POST_PASSWORD_MAX_LENGTH}글자 입력이 가능합니다.`, + message: COMMON.error.overMaxLen(POST_PASSWORD_MAX_LENGTH), }, }} render={({ field, fieldState: { error } }) => { diff --git a/src/pages/login/Search/SearchPWFirstStep.tsx b/src/pages/login/Search/SearchPWFirstStep.tsx index fcfcd50fe..d495db9d5 100644 --- a/src/pages/login/Search/SearchPWFirstStep.tsx +++ b/src/pages/login/Search/SearchPWFirstStep.tsx @@ -2,7 +2,7 @@ import React, { useState } from 'react'; import { Divider, Typography, useMediaQuery, useTheme } from '@mui/material'; import { DateTime } from 'luxon'; import { useCheckAuthCodeMutation, useRequestAuthCodeMutation } from '@api/SearchAccountApi'; -import { REQUIRE_ERROR_MSG } from '@constants/helperText'; +import { COMMON, EMAIL_MSG } from '@constants/helperText'; import { validateEmail } from '@utils/validateEmail'; import OutlinedButton from '@components/Button/OutlinedButton'; import EmailAuthInput from '@components/Input/EmailAuthInput'; @@ -64,17 +64,17 @@ const SearchPWFirstStep = ({ setCurrentStep, form, setForm }: SearchPWFirstStepP const handleEmailBlur = () => { if (!validateEmail(form.email)) { - setEmailErrorMsg('이메일 형식을 확인해주세요.'); + setEmailErrorMsg(EMAIL_MSG.error.formatError); } }; const handleRequestVerificationCode = () => { if (!form.id) { - setIdErrorMsg(REQUIRE_ERROR_MSG); + setIdErrorMsg(COMMON.error.required); return; } if (!form.email) { - setEmailErrorMsg(REQUIRE_ERROR_MSG); + setEmailErrorMsg(COMMON.error.required); return; } diff --git a/src/pages/login/Search/SearchPWSecondStep.tsx b/src/pages/login/Search/SearchPWSecondStep.tsx index dda683893..4e73e8e65 100644 --- a/src/pages/login/Search/SearchPWSecondStep.tsx +++ b/src/pages/login/Search/SearchPWSecondStep.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; import { Divider } from '@mui/material'; import { useChangePasswordMutation } from '@api/SearchAccountApi'; -import { PASSWORD_ERROR_MSG } from '@constants/helperText'; +import { PASSWORD_MSG } from '@constants/helperText'; import OutlinedButton from '@components/Button/OutlinedButton'; import StandardInput from '@components/Input/StandardInput'; @@ -46,11 +46,11 @@ const SearchPWSecondStep = ({ setCurrentStep, firstForm }: SearchPWSecondStepPro const handleBlur = (e: React.FocusEvent) => { const { name, value } = e.currentTarget; if (name === 'newPassword') { - if (value && !passwordRegex.test(value)) setPasswordErrorMsg(PASSWORD_ERROR_MSG); + if (value && !passwordRegex.test(value)) setPasswordErrorMsg(PASSWORD_MSG.error.formatError); } if (name === 'confirmPassword') { if (!(value.length > 0 && isSame)) { - setConfirmPasswordErrorMsg('비밀번호가 일치하지 않습니다.'); + setConfirmPasswordErrorMsg(PASSWORD_MSG.error.incorrect); } } }; @@ -113,7 +113,7 @@ const SearchPWSecondStep = ({ setCurrentStep, firstForm }: SearchPWSecondStepPro onChange={handleChange} onBlur={handleBlur} error={Boolean(confirmPasswordErrorMsg)} - helperText={confirmPasswordErrorMsg || (isSame && '비밀번호가 일치합니다.')} + helperText={confirmPasswordErrorMsg || (isSame && PASSWORD_MSG.success.correct)} />
    From d3fcba8c8808d9eeefc9effa5895abfd4b8dc157 Mon Sep 17 00:00:00 2001 From: munkyeong Date: Mon, 11 Dec 2023 19:31:44 +0900 Subject: [PATCH 32/43] =?UTF-8?q?refactor=20:=20import=20=EC=9C=84?= =?UTF-8?q?=EC=B9=98=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20PR=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/memberApi.ts | 10 +++++----- src/api/postApi.ts | 2 +- src/api/seminarApi.ts | 2 +- .../{apiResponseMsg.ts => apiResponseMessage.ts} | 14 +++++++------- src/pages/Profile/Modal/EditAccountModal.tsx | 4 ++-- .../SignUp/Section/SignUpFirstInputSection.tsx | 4 ++-- .../SignUp/Section/SignUpSecondInputSection.tsx | 3 ++- .../SignUp/Section/SignUpThirdInputSection.tsx | 2 +- src/pages/senimarAttend/Card/MemberCardContent.tsx | 2 +- 9 files changed, 22 insertions(+), 21 deletions(-) rename src/constants/{apiResponseMsg.ts => apiResponseMessage.ts} (78%) diff --git a/src/api/memberApi.ts b/src/api/memberApi.ts index 1c73a8451..d9b15733c 100644 --- a/src/api/memberApi.ts +++ b/src/api/memberApi.ts @@ -1,10 +1,10 @@ import toast from 'react-hot-toast'; import { useQuery, useMutation, useQueryClient } from 'react-query'; import axios from 'axios'; +import { PASSWORD } from '@constants/apiResponseMessage'; import { useApiError } from '@hooks/useGetApiError'; import { formatGeneration } from '@utils/converter'; import { ProfileInfo, MemberDetailInfo } from './dto'; -import { PASSWORD } from '@constants/apiResponseMsg'; const memberKeys = { memberList: ['member', 'memberList'] as const, @@ -124,7 +124,7 @@ const useEditEmailMutation = () => { const { handleError } = useApiError({ 400: { default: () => { - toast.error(PASSWORD.error.passwordMismatch); + toast.error(PASSWORD.error.mismatchPassword); }, }, }); @@ -139,7 +139,7 @@ const useEditPasswordMutation = () => { const { handleError } = useApiError({ 400: { default: () => { - toast.error(PASSWORD.error.passwordMismatch); + toast.error(PASSWORD.error.mismatchPassword); }, }, }); @@ -148,7 +148,7 @@ const useEditPasswordMutation = () => { return useMutation(fetcher, { onSuccess: () => { - toast.success(PASSWORD.success.changedSuccess); + toast.success(PASSWORD.success.changed); }, onError: (err) => handleError(err, 400), }); @@ -158,7 +158,7 @@ const useWithdrawalMutation = () => { const { handleError } = useApiError({ 400: { default: () => { - toast.error(PASSWORD.error.passwordMismatch); + toast.error(PASSWORD.error.mismatchPassword); }, }, }); diff --git a/src/api/postApi.ts b/src/api/postApi.ts index c0840f665..caa50a9b7 100644 --- a/src/api/postApi.ts +++ b/src/api/postApi.ts @@ -2,6 +2,7 @@ import toast from 'react-hot-toast'; import { useMutation, useQuery, useQueryClient } from 'react-query'; import { useLocation, useNavigate } from 'react-router-dom'; import axios, { AxiosError } from 'axios'; +import { POST } from '@constants/apiResponseMessage'; import { useApiError } from '@hooks/useGetApiError'; import { BoardPosts, @@ -15,7 +16,6 @@ import { PageAndSize, MemberPost, } from './dto'; -import { POST } from '@constants/apiResponseMsg'; const postKeys = { memberPost: (param: PageAndSize & { memberId: number }) => ['memberPost', param] as const, diff --git a/src/api/seminarApi.ts b/src/api/seminarApi.ts index 715199805..5523d10d1 100644 --- a/src/api/seminarApi.ts +++ b/src/api/seminarApi.ts @@ -1,9 +1,9 @@ import { useQuery, useMutation, useQueryClient } from 'react-query'; import axios from 'axios'; import { DateTime } from 'luxon'; +import { SEMINAR } from '@constants/apiResponseMessage'; import { useApiError } from '@hooks/useGetApiError'; import { AttendSeminarListInfo, SeminarStatus, SeminarInfo, SeminarCardInfo } from './dto'; -import { SEMINAR } from '@constants/apiResponseMsg'; const seminarKeys = { getSeminarList: ['getSeminar', 'seminarList'] as const, diff --git a/src/constants/apiResponseMsg.ts b/src/constants/apiResponseMessage.ts similarity index 78% rename from src/constants/apiResponseMsg.ts rename to src/constants/apiResponseMessage.ts index a0a2ab4ca..36cbf4646 100644 --- a/src/constants/apiResponseMsg.ts +++ b/src/constants/apiResponseMessage.ts @@ -2,10 +2,10 @@ export const COMMON = {} as const; export const PASSWORD = { success: { - changedSuccess: '비밀번호가 변경되었습니다.', + changed: '비밀번호가 변경되었습니다.', }, error: { - passwordMismatch: '현재 비밀번호가 일치하지 않습니다.', + mismatchPassword: '현재 비밀번호가 일치하지 않습니다.', }, } as const; @@ -27,7 +27,7 @@ export const SEMINAR = { export const EMAIL = { success: { - changedSuccess: '이메일 변경 성공하였습니다.', + changed: '이메일 변경 성공하였습니다.', }, error: { existingEmail: '이미 존재하는 이메일입니다.', @@ -38,20 +38,20 @@ export const MEMBER_CARD = { success: {}, error: { noSubmissionsLeft: '남은 제출 횟수가 없습니다.', - invalidAttendanceWithCount: (min: number) => `출석코드가 틀렸습니다. (남은 제출횟수 ${min}회)` as const, + invalidAttendanceWithCount: (min: number) => `출석코드가 틀렸습니다. (남은 제출횟수 ${min}회)`, }, } as const; export const ID = { success: {}, - errror: { + error: { existingId: '이미 존재하는 아이디입니다.', }, }; -export const StudentID = { +export const STUDENT_ID = { success: {}, - errror: { + error: { existingStudentId: '이미 존재하는 학번입니다.', }, }; diff --git a/src/pages/Profile/Modal/EditAccountModal.tsx b/src/pages/Profile/Modal/EditAccountModal.tsx index 41cb5ff50..f0ea11913 100644 --- a/src/pages/Profile/Modal/EditAccountModal.tsx +++ b/src/pages/Profile/Modal/EditAccountModal.tsx @@ -14,6 +14,7 @@ import { useWithdrawalMutation, } from '@api/memberApi'; import { useCheckEmailDuplicationQuery } from '@api/signUpApi'; +import { EMAIL } from '@constants/apiResponseMessage'; import { REQUIRE_ERROR_MSG } from '@constants/errorMsg'; import memberState from '@recoil/member.recoil'; import { emailRegex } from '@utils/validateEmail'; @@ -23,7 +24,6 @@ import EmailAuthInput from '@components/Input/EmailAuthInput'; import StandardInput from '@components/Input/StandardInput'; import TimerInput from '@components/Input/TimerInput'; import ConfirmModal from '@components/Modal/ConfirmModal'; -import { EMAIL } from '@constants/apiResponseMsg'; const EditEmailSection = () => { const [expirationTime, setExpirationTime] = useState(null); @@ -58,7 +58,7 @@ const EditEmailSection = () => { { email, auth, password }, { onSuccess: () => { - toast.success(EMAIL.success.changedSuccess); + toast.success(EMAIL.success.changed); setIsEmailSent(false); reset(); }, diff --git a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx index 6399fb171..5a95344b6 100644 --- a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx @@ -6,11 +6,11 @@ import { VscCheck } from 'react-icons/vsc'; import { useSetRecoilState } from 'recoil'; import { signUpKeys, useCheckLoginIdDuplicationQuery } from '@api/signUpApi'; +import { ID } from '@constants/apiResponseMessage'; import FilledButton from '@components/Button/FilledButton'; import OutlinedButton from '@components/Button/OutlinedButton'; import StandardInput from '@components/Input/StandardInput'; import signUpPageState from '../SignUp.recoil'; -import { ID } from '@constants/apiResponseMsg'; interface SignUpFirstInputSectionProps { setCurrentStep: React.Dispatch>; @@ -51,7 +51,7 @@ const SignUpFirstInputSection = ({ setCurrentStep }: SignUpFirstInputSectionProp if (!isLoginIdDuplicate) return; if (isLoginIdDuplicate.duplicate === true) { - setError('loginId', { message: ID.errror.existingId }); + setError('loginId', { message: ID.error.existingId }); setCheckLoginIdDuplicateEnabled(false); } }, [isLoginIdDuplicate]); diff --git a/src/pages/SignUp/Section/SignUpSecondInputSection.tsx b/src/pages/SignUp/Section/SignUpSecondInputSection.tsx index 8e454ffc2..3a9f72fdd 100644 --- a/src/pages/SignUp/Section/SignUpSecondInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpSecondInputSection.tsx @@ -5,6 +5,7 @@ import { Stack } from '@mui/material'; import { VscCheck } from 'react-icons/vsc'; import { useSetRecoilState } from 'recoil'; import { signUpKeys, useCheckStudentIdDuplicationQuery } from '@api/signUpApi'; +import { STUDENT_ID } from '@constants/apiResponseMessage'; import { NUMBER_ERROR_MSG, REQUIRE_ERROR_MSG } from '@constants/errorMsg'; import FilledButton from '@components/Button/FilledButton'; import OutlinedButton from '@components/Button/OutlinedButton'; @@ -57,7 +58,7 @@ const SignUpSecondInputSection = ({ setCurrentStep }: SignUpFirstInputSectionPro if (!isStudentIdDuplicate) return; if (isStudentIdDuplicate.duplicate === true) { - setError('studentId', { message: '이미 존재하는 학번입니다.' }); + setError('studentId', { message: STUDENT_ID.error.existingStudentId }); setCheckStudentIdDuplicateEnabled(false); } }, [isStudentIdDuplicate]); diff --git a/src/pages/SignUp/Section/SignUpThirdInputSection.tsx b/src/pages/SignUp/Section/SignUpThirdInputSection.tsx index f09a399ac..d7844de1e 100644 --- a/src/pages/SignUp/Section/SignUpThirdInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpThirdInputSection.tsx @@ -6,6 +6,7 @@ import { Stack, Typography } from '@mui/material'; import { DateTime } from 'luxon'; import { useRecoilValue } from 'recoil'; import { useCheckEmailDuplicationQuery, useEmailAuthMutation, useSignUpMutation } from '@api/signUpApi'; +import { EMAIL } from '@constants/apiResponseMessage'; import { REQUIRE_ERROR_MSG } from '@constants/errorMsg'; import { emailRegex } from '@utils/validateEmail'; import OutlinedButton from '@components/Button/OutlinedButton'; @@ -13,7 +14,6 @@ import EmailAuthInput from '@components/Input/EmailAuthInput'; import TimerInput from '@components/Input/TimerInput'; import MailAuthenticationModal from '@components/Modal/MailAuthenticationModal'; import signUpPageState from '../SignUp.recoil'; -import { EMAIL } from '@constants/apiResponseMsg'; const SignUpThirdInputSection = () => { const [expirationTime, setExpirationTime] = useState(null); diff --git a/src/pages/senimarAttend/Card/MemberCardContent.tsx b/src/pages/senimarAttend/Card/MemberCardContent.tsx index 85b6a30bc..a9c01e6f4 100644 --- a/src/pages/senimarAttend/Card/MemberCardContent.tsx +++ b/src/pages/senimarAttend/Card/MemberCardContent.tsx @@ -5,13 +5,13 @@ import { DateTime } from 'luxon'; import { useRecoilState } from 'recoil'; import { SeminarStatus } from '@api/dto'; import { useAttendSeminarMutation, useGetAvailableSeminarInfoQuery, useGetSeminarInfoQuery } from '@api/seminarApi'; +import { MEMBER_CARD } from '@constants/apiResponseMessage'; import FilledButton from '@components/Button/FilledButton'; import ConfirmModal from '@components/Modal/ConfirmModal'; import Countdown from '../Countdown/Countdown'; import SeminarInput from '../Input/SeminarInput'; import SeminarAttendStatus from '../Status/SeminarAttendStatus'; import attendCountState from '../seminarAttend.recoil'; -import { MEMBER_CARD } from '@constants/apiResponseMsg'; interface ErrorResponse { message: string; From 9772c16f4382ffaceb37db13513b492729ca2d20 Mon Sep 17 00:00:00 2001 From: munkyeong Date: Mon, 11 Dec 2023 19:35:15 +0900 Subject: [PATCH 33/43] refactor : mismatchPassword to mismatch --- src/api/memberApi.ts | 6 +++--- src/constants/apiResponseMessage.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/memberApi.ts b/src/api/memberApi.ts index d9b15733c..ded70c331 100644 --- a/src/api/memberApi.ts +++ b/src/api/memberApi.ts @@ -124,7 +124,7 @@ const useEditEmailMutation = () => { const { handleError } = useApiError({ 400: { default: () => { - toast.error(PASSWORD.error.mismatchPassword); + toast.error(PASSWORD.error.mismatch); }, }, }); @@ -139,7 +139,7 @@ const useEditPasswordMutation = () => { const { handleError } = useApiError({ 400: { default: () => { - toast.error(PASSWORD.error.mismatchPassword); + toast.error(PASSWORD.error.mismatch); }, }, }); @@ -158,7 +158,7 @@ const useWithdrawalMutation = () => { const { handleError } = useApiError({ 400: { default: () => { - toast.error(PASSWORD.error.mismatchPassword); + toast.error(PASSWORD.error.mismatch); }, }, }); diff --git a/src/constants/apiResponseMessage.ts b/src/constants/apiResponseMessage.ts index 36cbf4646..efb65508f 100644 --- a/src/constants/apiResponseMessage.ts +++ b/src/constants/apiResponseMessage.ts @@ -5,7 +5,7 @@ export const PASSWORD = { changed: '비밀번호가 변경되었습니다.', }, error: { - mismatchPassword: '현재 비밀번호가 일치하지 않습니다.', + mismatch: '현재 비밀번호가 일치하지 않습니다.', }, } as const; From e373dbba4d918e2c2124646703de24f0cb2e14b4 Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Mon, 11 Dec 2023 19:35:30 +0900 Subject: [PATCH 34/43] =?UTF-8?q?refactor=20:=20minLength,=20maxLength?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #847 --- src/constants/helperText.ts | 4 ++-- src/pages/Profile/Modal/EditAccountModal.tsx | 2 +- src/pages/Profile/Modal/EditProfileModal.tsx | 2 +- src/pages/Profile/Modal/SendPointModal.tsx | 2 +- src/pages/SignUp/Section/SignUpFirstInputSection.tsx | 4 ++-- src/pages/SignUp/Section/SignUpSecondInputSection.tsx | 2 +- src/pages/Study/Modal/StudyModal.tsx | 4 ++-- src/pages/admin/LibraryManage/Modal/UploadBookModal.tsx | 4 ++-- src/pages/board/BoardView/Modal/SecretPostModal.tsx | 2 +- src/pages/board/BoardWrite/BoardWrite.tsx | 2 +- src/pages/board/BoardWrite/Modal/SettingUploadModal.tsx | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/constants/helperText.ts b/src/constants/helperText.ts index 45d23542e..1b6ee3b7b 100644 --- a/src/constants/helperText.ts +++ b/src/constants/helperText.ts @@ -4,8 +4,8 @@ export const COMMON = { required: '필수 정보입니다.', onlyNumber: '숫자만 입력 가능합니다.', onlyHttps: 'https:// 로 시작해야 합니다.', - underMinLen: (min: number) => `${min}글자 이상 입력해주세요.` as const, - overMaxLen: (max: number) => `최대 ${max}글자 입력해주세요.` as const, + minLength: (min: number) => `${min}글자 이상 입력해주세요.` as const, + maxLength: (max: number) => `최대 ${max}글자 입력해주세요.` as const, }, } as const; diff --git a/src/pages/Profile/Modal/EditAccountModal.tsx b/src/pages/Profile/Modal/EditAccountModal.tsx index 07014a09b..cc1c33385 100644 --- a/src/pages/Profile/Modal/EditAccountModal.tsx +++ b/src/pages/Profile/Modal/EditAccountModal.tsx @@ -229,7 +229,7 @@ const EditPasswordSection = () => { required: COMMON.error.required, minLength: { value: 8, - message: COMMON.error.underMinLen(8), + message: COMMON.error.minLength(8), }, pattern: { value: /^(?=.*[a-zA-Z])(?=.*[0-9]).{8,20}$/, diff --git a/src/pages/Profile/Modal/EditProfileModal.tsx b/src/pages/Profile/Modal/EditProfileModal.tsx index 6200f9b27..e42a95819 100644 --- a/src/pages/Profile/Modal/EditProfileModal.tsx +++ b/src/pages/Profile/Modal/EditProfileModal.tsx @@ -68,7 +68,7 @@ const EditProfileModal = ({ profileInfo, open, onClose }: EditProfileModalProps) required: COMMON.error.required, maxLength: { value: NAME_MAX_LENGTH, - message: COMMON.error.overMaxLen(NAME_MAX_LENGTH), + message: COMMON.error.maxLength(NAME_MAX_LENGTH), }, pattern: { value: /^[가-힣a-zA-Z]{1,20}$/, diff --git a/src/pages/Profile/Modal/SendPointModal.tsx b/src/pages/Profile/Modal/SendPointModal.tsx index 50cb3036d..50df5edef 100644 --- a/src/pages/Profile/Modal/SendPointModal.tsx +++ b/src/pages/Profile/Modal/SendPointModal.tsx @@ -100,7 +100,7 @@ const SendPointModal = ({ open, onClose, sendTo }: SendPointModalProps) => { required: COMMON.error.required, maxLength: { value: SEND_POINT_MAX_LENGTH, - message: COMMON.error.overMaxLen(SEND_POINT_MAX_LENGTH), + message: COMMON.error.maxLength(SEND_POINT_MAX_LENGTH), }, }} render={({ field, fieldState: { error } }) => ( diff --git a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx index 62901d5e8..bca6b107c 100644 --- a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx @@ -75,7 +75,7 @@ const SignUpFirstInputSection = ({ setCurrentStep }: SignUpFirstInputSectionProp required: COMMON.error.required, minLength: { value: 4, - message: COMMON.error.underMinLen(4), + message: COMMON.error.minLength(4), }, pattern: { value: /^[a-zA-Z0-9_]{4,12}$/, @@ -111,7 +111,7 @@ const SignUpFirstInputSection = ({ setCurrentStep }: SignUpFirstInputSectionProp required: COMMON.error.required, minLength: { value: 8, - message: COMMON.error.underMinLen(8), + message: COMMON.error.minLength(8), }, pattern: { value: /^(?=.*[a-zA-Z])(?=.*[0-9]).{8,20}$/, diff --git a/src/pages/SignUp/Section/SignUpSecondInputSection.tsx b/src/pages/SignUp/Section/SignUpSecondInputSection.tsx index 2a928b69a..cc337e444 100644 --- a/src/pages/SignUp/Section/SignUpSecondInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpSecondInputSection.tsx @@ -81,7 +81,7 @@ const SignUpSecondInputSection = ({ setCurrentStep }: SignUpFirstInputSectionPro required: COMMON.error.required, maxLength: { value: NAME_MAX_LENGTH, - message: COMMON.error.overMaxLen(NAME_MAX_LENGTH), + message: COMMON.error.maxLength(NAME_MAX_LENGTH), }, pattern: { value: /^[가-힣a-zA-Z]{1,20}$/, diff --git a/src/pages/Study/Modal/StudyModal.tsx b/src/pages/Study/Modal/StudyModal.tsx index e487cbb5a..299dd5afb 100644 --- a/src/pages/Study/Modal/StudyModal.tsx +++ b/src/pages/Study/Modal/StudyModal.tsx @@ -171,7 +171,7 @@ const StudyModal = ({ open, setOpen, selectedStudyInfo, setSelectedStudyInfo, cu required: COMMON.error.required, maxLength: { value: STUDY_TITLE_MAX_LENGTH, - message: COMMON.error.overMaxLen(STUDY_TITLE_MAX_LENGTH), + message: COMMON.error.maxLength(STUDY_TITLE_MAX_LENGTH), }, }} render={({ field, fieldState: { error } }) => { @@ -197,7 +197,7 @@ const StudyModal = ({ open, setOpen, selectedStudyInfo, setSelectedStudyInfo, cu required: COMMON.error.required, maxLength: { value: STUDY_CONTENT_MAX_LENGTH, - message: COMMON.error.overMaxLen(STUDY_CONTENT_MAX_LENGTH), + message: COMMON.error.maxLength(STUDY_CONTENT_MAX_LENGTH), }, }} render={({ field, fieldState: { error } }) => { diff --git a/src/pages/admin/LibraryManage/Modal/UploadBookModal.tsx b/src/pages/admin/LibraryManage/Modal/UploadBookModal.tsx index fa5f0d4ec..4dbd95232 100644 --- a/src/pages/admin/LibraryManage/Modal/UploadBookModal.tsx +++ b/src/pages/admin/LibraryManage/Modal/UploadBookModal.tsx @@ -49,11 +49,11 @@ const UploadBookModal = ({ open, onClose, bookDetail }: SelectorProps) => { setIsInvalidAuthor(true); } if (titleTrim.length > 200) { - setTitleHelperText(COMMON.error.overMaxLen(200)); + setTitleHelperText(COMMON.error.maxLength(200)); setIsInvalidTitle(true); } if (authorTrim.length > 30) { - setAuthorHelperText(COMMON.error.overMaxLen(30)); + setAuthorHelperText(COMMON.error.maxLength(30)); setIsInvalidAuthor(true); } diff --git a/src/pages/board/BoardView/Modal/SecretPostModal.tsx b/src/pages/board/BoardView/Modal/SecretPostModal.tsx index d5040b04f..d7a6334f3 100644 --- a/src/pages/board/BoardView/Modal/SecretPostModal.tsx +++ b/src/pages/board/BoardView/Modal/SecretPostModal.tsx @@ -52,7 +52,7 @@ const SecretPostModal = ({ setPassword, setIsSecretPasswordSubmited, open, setOp required: COMMON.error.required, maxLength: { value: POST_PASSWORD_MAX_LENGTH, - message: COMMON.error.overMaxLen(POST_PASSWORD_MAX_LENGTH), + message: COMMON.error.maxLength(POST_PASSWORD_MAX_LENGTH), }, }} render={({ field, fieldState: { error } }) => { diff --git a/src/pages/board/BoardWrite/BoardWrite.tsx b/src/pages/board/BoardWrite/BoardWrite.tsx index 3c4add3af..c03a112db 100644 --- a/src/pages/board/BoardWrite/BoardWrite.tsx +++ b/src/pages/board/BoardWrite/BoardWrite.tsx @@ -175,7 +175,7 @@ const BoardWrite = () => { required: COMMON.error.required, maxLength: { value: POST_TITLE_MAX_LENGTH, - message: COMMON.error.overMaxLen(POST_TITLE_MAX_LENGTH), + message: COMMON.error.maxLength(POST_TITLE_MAX_LENGTH), }, }} render={({ field, fieldState: { error } }) => { diff --git a/src/pages/board/BoardWrite/Modal/SettingUploadModal.tsx b/src/pages/board/BoardWrite/Modal/SettingUploadModal.tsx index 57b139e7f..14a8d3618 100644 --- a/src/pages/board/BoardWrite/Modal/SettingUploadModal.tsx +++ b/src/pages/board/BoardWrite/Modal/SettingUploadModal.tsx @@ -121,7 +121,7 @@ const SettingUploadModal = ({ required: COMMON.error.required, maxLength: { value: POST_PASSWORD_MAX_LENGTH, - message: COMMON.error.overMaxLen(POST_PASSWORD_MAX_LENGTH), + message: COMMON.error.maxLength(POST_PASSWORD_MAX_LENGTH), }, }} render={({ field, fieldState: { error } }) => { From 396f7b0daa30d2c3e2eecd61691ce6a6dcac4c31 Mon Sep 17 00:00:00 2001 From: munkyeong Date: Mon, 11 Dec 2023 19:40:21 +0900 Subject: [PATCH 35/43] =?UTF-8?q?refactor=20:=20=EB=B0=B1=ED=8B=B1?= =?UTF-8?q?=EC=9D=B4=20=EC=82=AC=EC=9A=A9=EB=90=98=EB=8A=94=20=EB=B6=80?= =?UTF-8?q?=EB=B6=84=20as=20const=20=EC=84=A0=EC=96=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/apiResponseMessage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants/apiResponseMessage.ts b/src/constants/apiResponseMessage.ts index efb65508f..25f46984b 100644 --- a/src/constants/apiResponseMessage.ts +++ b/src/constants/apiResponseMessage.ts @@ -38,7 +38,7 @@ export const MEMBER_CARD = { success: {}, error: { noSubmissionsLeft: '남은 제출 횟수가 없습니다.', - invalidAttendanceWithCount: (min: number) => `출석코드가 틀렸습니다. (남은 제출횟수 ${min}회)`, + invalidAttendanceWithCount: (min: number) => `출석코드가 틀렸습니다. (남은 제출횟수 ${min}회)` as const, }, } as const; From 3d35fd63a54b7e4d9018158896130c59e3b5e69f Mon Sep 17 00:00:00 2001 From: munkyeong Date: Mon, 11 Dec 2023 19:49:37 +0900 Subject: [PATCH 36/43] =?UTF-8?q?refactor=20:=20=EB=B3=80=EC=88=98?= =?UTF-8?q?=EB=AA=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/postApi.ts | 4 ++-- src/constants/apiResponseMessage.ts | 10 +++++----- src/pages/Profile/Modal/EditAccountModal.tsx | 2 +- src/pages/SignUp/Section/SignUpFirstInputSection.tsx | 2 +- src/pages/SignUp/Section/SignUpSecondInputSection.tsx | 2 +- src/pages/SignUp/Section/SignUpThirdInputSection.tsx | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/api/postApi.ts b/src/api/postApi.ts index caa50a9b7..6f1fac2f8 100644 --- a/src/api/postApi.ts +++ b/src/api/postApi.ts @@ -157,7 +157,7 @@ const useGetEachPostQuery = ( }, 403: { 40301: () => { - toast.error(POST.error.passwordMismatch); + toast.error(POST.error.mismatchPassword); }, 40302: () => { // 비밀글 여부 true로 변경 @@ -227,7 +227,7 @@ const useDownloadFileMutation = () => { }, onError: (error) => { if ((error as AxiosError)?.response?.status === 400) { - toast.error(POST.error.commentRequired); + toast.error(POST.error.requiredComment); } }, }); diff --git a/src/constants/apiResponseMessage.ts b/src/constants/apiResponseMessage.ts index 25f46984b..6eea1f5e6 100644 --- a/src/constants/apiResponseMessage.ts +++ b/src/constants/apiResponseMessage.ts @@ -13,8 +13,8 @@ export const POST = { success: {}, error: { readCondition: '게시글 열람 조건을 충족하지 않습니다.', - passwordMismatch: '게시글의 비밀번호가 일치하지 않습니다.', - commentRequired: '댓글 작성이 필요합니다.', + mismatchPassword: '게시글의 비밀번호가 일치하지 않습니다.', + requiredComment: '댓글 작성이 필요합니다.', }, } as const; @@ -30,7 +30,7 @@ export const EMAIL = { changed: '이메일 변경 성공하였습니다.', }, error: { - existingEmail: '이미 존재하는 이메일입니다.', + existing: '이미 존재하는 이메일입니다.', }, } as const; @@ -45,13 +45,13 @@ export const MEMBER_CARD = { export const ID = { success: {}, error: { - existingId: '이미 존재하는 아이디입니다.', + existing: '이미 존재하는 아이디입니다.', }, }; export const STUDENT_ID = { success: {}, error: { - existingStudentId: '이미 존재하는 학번입니다.', + existing: '이미 존재하는 학번입니다.', }, }; diff --git a/src/pages/Profile/Modal/EditAccountModal.tsx b/src/pages/Profile/Modal/EditAccountModal.tsx index f0ea11913..3163170c3 100644 --- a/src/pages/Profile/Modal/EditAccountModal.tsx +++ b/src/pages/Profile/Modal/EditAccountModal.tsx @@ -70,7 +70,7 @@ const EditEmailSection = () => { if (!checkEmailDuplicationSuccess) return; if (isEmailDuplicate.duplicate === true) { - setError('email', { message: EMAIL.error.existingEmail }); + setError('email', { message: EMAIL.error.existing }); setIsEmailSent(false); return; } diff --git a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx index 5a95344b6..389fc3916 100644 --- a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx @@ -51,7 +51,7 @@ const SignUpFirstInputSection = ({ setCurrentStep }: SignUpFirstInputSectionProp if (!isLoginIdDuplicate) return; if (isLoginIdDuplicate.duplicate === true) { - setError('loginId', { message: ID.error.existingId }); + setError('loginId', { message: ID.error.existing }); setCheckLoginIdDuplicateEnabled(false); } }, [isLoginIdDuplicate]); diff --git a/src/pages/SignUp/Section/SignUpSecondInputSection.tsx b/src/pages/SignUp/Section/SignUpSecondInputSection.tsx index 3a9f72fdd..d84f1644c 100644 --- a/src/pages/SignUp/Section/SignUpSecondInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpSecondInputSection.tsx @@ -58,7 +58,7 @@ const SignUpSecondInputSection = ({ setCurrentStep }: SignUpFirstInputSectionPro if (!isStudentIdDuplicate) return; if (isStudentIdDuplicate.duplicate === true) { - setError('studentId', { message: STUDENT_ID.error.existingStudentId }); + setError('studentId', { message: STUDENT_ID.error.existing }); setCheckStudentIdDuplicateEnabled(false); } }, [isStudentIdDuplicate]); diff --git a/src/pages/SignUp/Section/SignUpThirdInputSection.tsx b/src/pages/SignUp/Section/SignUpThirdInputSection.tsx index d7844de1e..2005bccb0 100644 --- a/src/pages/SignUp/Section/SignUpThirdInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpThirdInputSection.tsx @@ -74,7 +74,7 @@ const SignUpThirdInputSection = () => { if (!checkEmailDuplicationSuccess) return; if (isEmailDuplicate.duplicate === true) { - setError('email', { message: EMAIL.error.existingEmail }); + setError('email', { message: EMAIL.error.existing }); setIsEmailSent(false); return; } From b1dcd145b716c5982da00b1364dd800da2ee6eab Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Mon, 11 Dec 2023 20:07:49 +0900 Subject: [PATCH 37/43] =?UTF-8?q?refactor=20:=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 작성자가 이니면 비밀번호가 필요합니다 추가 - maxLength 최대 글자수 글자를 초과했습니다 로 변경 - stepInfoMsg -> STEP_INFO_MESSAGE 로 UPPER_SNAKE_CASE 적용 - #847 --- src/constants/helperText.ts | 9 ++++++++- src/pages/SignUp/SignUp.tsx | 4 ++-- src/pages/board/BoardView/Modal/SecretPostModal.tsx | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/constants/helperText.ts b/src/constants/helperText.ts index 1b6ee3b7b..ed219d199 100644 --- a/src/constants/helperText.ts +++ b/src/constants/helperText.ts @@ -5,7 +5,7 @@ export const COMMON = { onlyNumber: '숫자만 입력 가능합니다.', onlyHttps: 'https:// 로 시작해야 합니다.', minLength: (min: number) => `${min}글자 이상 입력해주세요.` as const, - maxLength: (max: number) => `최대 ${max}글자 입력해주세요.` as const, + maxLength: (max: number) => `최대 글자수 ${max}글자를 초과했습니다.` as const, }, } as const; @@ -53,3 +53,10 @@ export const STUDY_MSG = { onlyGitLink: '깃허브 링크만 입력이 가능합니다.', }, } as const; + +export const BOARD_MSG = { + success: {}, + error: { + requiredPassword: '작성자가 아니면 비밀번호가 필요합니다.', + }, +}; diff --git a/src/pages/SignUp/SignUp.tsx b/src/pages/SignUp/SignUp.tsx index 1b38c97f5..108688616 100644 --- a/src/pages/SignUp/SignUp.tsx +++ b/src/pages/SignUp/SignUp.tsx @@ -8,7 +8,7 @@ import SignUpSecondInputSection from './Section/SignUpSecondInputSection'; import SignUpThirdInputSection from './Section/SignUpThirdInputSection'; const TOTAL_STEPS = 3; -const stepInfoMsg = { +const STEP_INFO_MESSAGE = { 1: '로그인에 사용할\n아이디와 비밀번호를 등록해 주세요.', 2: '프로필 정보를 등록해 주세요.', 3: '이메일 주소를 입력해주세요.\n입력한 이메일 주소로 인증 코드가 발송됩니다.', @@ -29,7 +29,7 @@ const SignUp = () => { - {stepInfoMsg[currentStep]} + {STEP_INFO_MESSAGE[currentStep]} {stepInputSection[currentStep]} diff --git a/src/pages/board/BoardView/Modal/SecretPostModal.tsx b/src/pages/board/BoardView/Modal/SecretPostModal.tsx index d7a6334f3..320dd86e4 100644 --- a/src/pages/board/BoardView/Modal/SecretPostModal.tsx +++ b/src/pages/board/BoardView/Modal/SecretPostModal.tsx @@ -2,7 +2,7 @@ import React, { Dispatch, SetStateAction } from 'react'; import { Controller, useForm } from 'react-hook-form'; import { useNavigate } from 'react-router-dom'; import { Typography } from '@mui/material'; -import { COMMON } from '@constants/helperText'; +import { BOARD_MSG, COMMON } from '@constants/helperText'; import { POST_PASSWORD_MAX_LENGTH } from '@pages/board/BoardWrite/Modal/SettingUploadModal'; import StandardInput from '@components/Input/StandardInput'; import ActionModal from '@components/Modal/ActionModal'; @@ -49,7 +49,7 @@ const SecretPostModal = ({ setPassword, setIsSecretPasswordSubmited, open, setOp defaultValue="" control={control} rules={{ - required: COMMON.error.required, + required: BOARD_MSG.error.requiredPassword, maxLength: { value: POST_PASSWORD_MAX_LENGTH, message: COMMON.error.maxLength(POST_PASSWORD_MAX_LENGTH), From d61376bfa43211b2d10428a260792fcae5ea7fea Mon Sep 17 00:00:00 2001 From: pipisebastian Date: Mon, 11 Dec 2023 20:07:52 +0900 Subject: [PATCH 38/43] =?UTF-8?q?refactor=20:=20prefix=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=ED=95=98=EC=97=AC=20=EC=83=81=EC=88=98=20=EC=84=A0?= =?UTF-8?q?=EC=96=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #848 --- src/constants/member.ts | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/src/constants/member.ts b/src/constants/member.ts index b9a0549ab..7e42e4442 100644 --- a/src/constants/member.ts +++ b/src/constants/member.ts @@ -1,32 +1,17 @@ export const MEMBER_ROLE_PREFIX = 'ROLE_'; -// 1. export const MEMBER_ROLE = { - 회장: 'ROLE_회장', - 부회장: 'ROLE_부회장', - 서기: 'ROLE_서기', - 총무: 'ROLE_총무', - 사서: 'ROLE_사서', - 학술부장: 'ROLE_학술부장', - 대외부장: 'ROLE_대외부장', - 전산관리자: 'ROLE_전산관리자', - FRONT_전산관리자: 'ROLE_FRONT_전산관리자', - BACK_전산관리자: 'ROLE_BACK_전산관리자', - INFRA_전산관리자: 'ROLE_INFRA_전산관리자', - 회원: 'ROLE_회원', - 출제자: 'ROLE_출제자', -} as const; - -// 2. -export const MEMBER_ROLE2 = { 회장: `${MEMBER_ROLE_PREFIX}회장`, 부회장: `${MEMBER_ROLE_PREFIX}부회장`, -} as const; - -// 3. -const prefix = (detail: string) => `${MEMBER_ROLE_PREFIX}${detail}`; - -export const MEMBER_ROLE3 = { - 회장: prefix('회장'), - 부회장: prefix('부회장'), + 서기: `${MEMBER_ROLE_PREFIX}서기`, + 총무: `${MEMBER_ROLE_PREFIX}총무`, + 사서: `${MEMBER_ROLE_PREFIX}사서`, + 학술부장: `${MEMBER_ROLE_PREFIX}학술부장`, + 대외부장: `${MEMBER_ROLE_PREFIX}대외부장`, + 전산관리자: `${MEMBER_ROLE_PREFIX}전산관리자`, + FRONT_전산관리자: `${MEMBER_ROLE_PREFIX}FRONT_전산관리자`, + BACK_전산관리자: `${MEMBER_ROLE_PREFIX}BACK_전산관리자`, + INFRA_전산관리자: `${MEMBER_ROLE_PREFIX}INFRA_전산관리자`, + 회원: `${MEMBER_ROLE_PREFIX}회원`, + 출제자: `${MEMBER_ROLE_PREFIX}출제자`, } as const; From 3670a0540f0a54fe4134ee858f26c610f1b5feb3 Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Mon, 11 Dec 2023 20:11:04 +0900 Subject: [PATCH 39/43] =?UTF-8?q?refactor=20:=20correct,=20incorrect=20->?= =?UTF-8?q?=20match,=20mismatch=EB=A1=9C=20=EB=B3=80=EA=B2=BD,=20PASSWORD?= =?UTF-8?q?=20->=20CONFIRM=5FPASSWORD=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #847 --- src/constants/helperText.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/constants/helperText.ts b/src/constants/helperText.ts index ed219d199..21831a12e 100644 --- a/src/constants/helperText.ts +++ b/src/constants/helperText.ts @@ -16,12 +16,12 @@ export const EMAIL_MSG = { }, } as const; -export const PASSWORD_MSG = { +export const CONFIRM_PASSWORD_MSG = { success: { - correct: '비밀번호가 일치합니다.', + match: '비밀번호가 일치합니다.', }, error: { - incorrect: '비밀번호가 일치하지 않습니다.', + mismatch: '비밀번호가 일치하지 않습니다.', formatError: '8~20자 영문과 숫자를 사용하세요.', }, } as const; From fdc445ed1974bc9c563dd0ca806d5af4b72cd463 Mon Sep 17 00:00:00 2001 From: munkyeong Date: Mon, 11 Dec 2023 20:15:30 +0900 Subject: [PATCH 40/43] =?UTF-8?q?refactor=20:=20=EB=B3=80=EC=88=98?= =?UTF-8?q?=EB=AA=85=20=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20PR=20=EB=B0=98?= =?UTF-8?q?=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/postApi.ts | 8 ++++---- src/constants/apiResponseMessage.ts | 6 +++--- src/pages/SignUp/Section/SignUpFirstInputSection.tsx | 4 ++-- src/pages/senimarAttend/Card/MemberCardContent.tsx | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/api/postApi.ts b/src/api/postApi.ts index 6f1fac2f8..905c57370 100644 --- a/src/api/postApi.ts +++ b/src/api/postApi.ts @@ -2,7 +2,7 @@ import toast from 'react-hot-toast'; import { useMutation, useQuery, useQueryClient } from 'react-query'; import { useLocation, useNavigate } from 'react-router-dom'; import axios, { AxiosError } from 'axios'; -import { POST } from '@constants/apiResponseMessage'; +import { BOARD } from '@constants/apiResponseMessage'; import { useApiError } from '@hooks/useGetApiError'; import { BoardPosts, @@ -152,12 +152,12 @@ const useGetEachPostQuery = ( 400: { default: () => { // TODO 페이지 문구로 띄워주기 - toast.error(POST.error.readCondition); + toast.error(BOARD.error.readCondition); }, }, 403: { 40301: () => { - toast.error(POST.error.mismatchPassword); + toast.error(BOARD.error.mismatchPassword); }, 40302: () => { // 비밀글 여부 true로 변경 @@ -227,7 +227,7 @@ const useDownloadFileMutation = () => { }, onError: (error) => { if ((error as AxiosError)?.response?.status === 400) { - toast.error(POST.error.requiredComment); + toast.error(BOARD.error.requiredComment); } }, }); diff --git a/src/constants/apiResponseMessage.ts b/src/constants/apiResponseMessage.ts index 6eea1f5e6..9453302c4 100644 --- a/src/constants/apiResponseMessage.ts +++ b/src/constants/apiResponseMessage.ts @@ -9,7 +9,7 @@ export const PASSWORD = { }, } as const; -export const POST = { +export const BOARD = { success: {}, error: { readCondition: '게시글 열람 조건을 충족하지 않습니다.', @@ -38,11 +38,11 @@ export const MEMBER_CARD = { success: {}, error: { noSubmissionsLeft: '남은 제출 횟수가 없습니다.', - invalidAttendanceWithCount: (min: number) => `출석코드가 틀렸습니다. (남은 제출횟수 ${min}회)` as const, + mismatchWithCount: (min: number) => `출석코드가 틀렸습니다. (남은 제출횟수 ${min}회)` as const, }, } as const; -export const ID = { +export const LOGIN_ID = { success: {}, error: { existing: '이미 존재하는 아이디입니다.', diff --git a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx index 389fc3916..71ec8d2ac 100644 --- a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx @@ -6,7 +6,7 @@ import { VscCheck } from 'react-icons/vsc'; import { useSetRecoilState } from 'recoil'; import { signUpKeys, useCheckLoginIdDuplicationQuery } from '@api/signUpApi'; -import { ID } from '@constants/apiResponseMessage'; +import { LOGIN_ID } from '@constants/apiResponseMessage'; import FilledButton from '@components/Button/FilledButton'; import OutlinedButton from '@components/Button/OutlinedButton'; import StandardInput from '@components/Input/StandardInput'; @@ -51,7 +51,7 @@ const SignUpFirstInputSection = ({ setCurrentStep }: SignUpFirstInputSectionProp if (!isLoginIdDuplicate) return; if (isLoginIdDuplicate.duplicate === true) { - setError('loginId', { message: ID.error.existing }); + setError('loginId', { message: LOGIN_ID.error.existing }); setCheckLoginIdDuplicateEnabled(false); } }, [isLoginIdDuplicate]); diff --git a/src/pages/senimarAttend/Card/MemberCardContent.tsx b/src/pages/senimarAttend/Card/MemberCardContent.tsx index a9c01e6f4..0e3ed25c7 100644 --- a/src/pages/senimarAttend/Card/MemberCardContent.tsx +++ b/src/pages/senimarAttend/Card/MemberCardContent.tsx @@ -55,7 +55,7 @@ const MemberCardContent = ({ seminarId }: { seminarId: number }) => { setIncorrectCodeMsg(MEMBER_CARD.error.noSubmissionsLeft); return; } - setIncorrectCodeMsg(MEMBER_CARD.error.invalidAttendanceWithCount(remainAttendCount)); + setIncorrectCodeMsg(MEMBER_CARD.error.mismatchWithCount(remainAttendCount)); return; } const errorMessage = axiosError?.response?.data?.message; From 510d7d1285c55858d63e9d4481c8baf0ad5803ad Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Mon, 11 Dec 2023 20:26:16 +0900 Subject: [PATCH 41/43] =?UTF-8?q?refactor=20:=20CONFIRM=5FPASSWORD=5FMSG?= =?UTF-8?q?=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #847 --- src/pages/Profile/Modal/EditAccountModal.tsx | 8 ++++---- src/pages/SignUp/Section/SignUpFirstInputSection.tsx | 8 ++++---- src/pages/login/Search/SearchPWSecondStep.tsx | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/pages/Profile/Modal/EditAccountModal.tsx b/src/pages/Profile/Modal/EditAccountModal.tsx index cc1c33385..87af0bc4c 100644 --- a/src/pages/Profile/Modal/EditAccountModal.tsx +++ b/src/pages/Profile/Modal/EditAccountModal.tsx @@ -14,7 +14,7 @@ import { useWithdrawalMutation, } from '@api/memberApi'; import { useCheckEmailDuplicationQuery } from '@api/signUpApi'; -import { COMMON, EMAIL_MSG, PASSWORD_MSG } from '@constants/helperText'; +import { COMMON, EMAIL_MSG, CONFIRM_PASSWORD_MSG } from '@constants/helperText'; import memberState from '@recoil/member.recoil'; import { emailRegex } from '@utils/validateEmail'; import FilledButton from '@components/Button/FilledButton'; @@ -233,7 +233,7 @@ const EditPasswordSection = () => { }, pattern: { value: /^(?=.*[a-zA-Z])(?=.*[0-9]).{8,20}$/, - message: PASSWORD_MSG.error.formatError, + message: CONFIRM_PASSWORD_MSG.error.formatError, }, }} render={({ field, fieldState: { error } }) => { @@ -257,8 +257,8 @@ const EditPasswordSection = () => { required: COMMON.error.required, validate: { confirmMatchPassward: (value) => { - if (getValues('newPassword') !== value) return PASSWORD_MSG.error.incorrect; - setPasswordConfirmSuccessMsg(PASSWORD_MSG.success.correct); + if (getValues('newPassword') !== value) return CONFIRM_PASSWORD_MSG.error.mismatch; + setPasswordConfirmSuccessMsg(CONFIRM_PASSWORD_MSG.success.match); return undefined; }, }, diff --git a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx index bca6b107c..4b9811307 100644 --- a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx @@ -6,7 +6,7 @@ import { VscCheck } from 'react-icons/vsc'; import { useSetRecoilState } from 'recoil'; import { signUpKeys, useCheckLoginIdDuplicationQuery } from '@api/signUpApi'; -import { COMMON, LOGIN_ID_MSG, PASSWORD_MSG } from '@constants/helperText'; +import { COMMON, LOGIN_ID_MSG, CONFIRM_PASSWORD_MSG } from '@constants/helperText'; import FilledButton from '@components/Button/FilledButton'; import OutlinedButton from '@components/Button/OutlinedButton'; import StandardInput from '@components/Input/StandardInput'; @@ -115,7 +115,7 @@ const SignUpFirstInputSection = ({ setCurrentStep }: SignUpFirstInputSectionProp }, pattern: { value: /^(?=.*[a-zA-Z])(?=.*[0-9]).{8,20}$/, - message: PASSWORD_MSG.error.formatError, + message: CONFIRM_PASSWORD_MSG.error.formatError, }, }} render={({ field, fieldState: { error } }) => { @@ -139,8 +139,8 @@ const SignUpFirstInputSection = ({ setCurrentStep }: SignUpFirstInputSectionProp required: COMMON.error.required, validate: { confirmMatchPassward: (value) => { - if (getValues('password') !== value) return PASSWORD_MSG.error.incorrect; - setPasswordConfirmSuccessMsg(PASSWORD_MSG.success.correct); + if (getValues('password') !== value) return CONFIRM_PASSWORD_MSG.error.mismatch; + setPasswordConfirmSuccessMsg(CONFIRM_PASSWORD_MSG.success.match); return undefined; }, }, diff --git a/src/pages/login/Search/SearchPWSecondStep.tsx b/src/pages/login/Search/SearchPWSecondStep.tsx index 4e73e8e65..80b78ddf1 100644 --- a/src/pages/login/Search/SearchPWSecondStep.tsx +++ b/src/pages/login/Search/SearchPWSecondStep.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; import { Divider } from '@mui/material'; import { useChangePasswordMutation } from '@api/SearchAccountApi'; -import { PASSWORD_MSG } from '@constants/helperText'; +import { CONFIRM_PASSWORD_MSG } from '@constants/helperText'; import OutlinedButton from '@components/Button/OutlinedButton'; import StandardInput from '@components/Input/StandardInput'; @@ -46,11 +46,11 @@ const SearchPWSecondStep = ({ setCurrentStep, firstForm }: SearchPWSecondStepPro const handleBlur = (e: React.FocusEvent) => { const { name, value } = e.currentTarget; if (name === 'newPassword') { - if (value && !passwordRegex.test(value)) setPasswordErrorMsg(PASSWORD_MSG.error.formatError); + if (value && !passwordRegex.test(value)) setPasswordErrorMsg(CONFIRM_PASSWORD_MSG.error.formatError); } if (name === 'confirmPassword') { if (!(value.length > 0 && isSame)) { - setConfirmPasswordErrorMsg(PASSWORD_MSG.error.incorrect); + setConfirmPasswordErrorMsg(CONFIRM_PASSWORD_MSG.error.mismatch); } } }; @@ -113,7 +113,7 @@ const SearchPWSecondStep = ({ setCurrentStep, firstForm }: SearchPWSecondStepPro onChange={handleChange} onBlur={handleBlur} error={Boolean(confirmPasswordErrorMsg)} - helperText={confirmPasswordErrorMsg || (isSame && PASSWORD_MSG.success.correct)} + helperText={confirmPasswordErrorMsg || (isSame && CONFIRM_PASSWORD_MSG.success.match)} />
    From daab57ed878cdd37114c17e927f63c8c64e1b049 Mon Sep 17 00:00:00 2001 From: munkyeong Date: Mon, 11 Dec 2023 20:50:13 +0900 Subject: [PATCH 42/43] =?UTF-8?q?confilct=20:=20=EC=B6=A9=EB=8F=8C?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/SignUp/Section/SignUpFirstInputSection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx index 47693aae9..ec1aeb68c 100644 --- a/src/pages/SignUp/Section/SignUpFirstInputSection.tsx +++ b/src/pages/SignUp/Section/SignUpFirstInputSection.tsx @@ -6,8 +6,8 @@ import { VscCheck } from 'react-icons/vsc'; import { useSetRecoilState } from 'recoil'; import { signUpKeys, useCheckLoginIdDuplicationQuery } from '@api/signUpApi'; -import { COMMON, LOGIN_ID_MSG, CONFIRM_PASSWORD_MSG } from '@constants/helperText'; import { LOGIN_ID } from '@constants/apiResponseMessage'; +import { COMMON, LOGIN_ID_MSG, CONFIRM_PASSWORD_MSG } from '@constants/helperText'; import FilledButton from '@components/Button/FilledButton'; import OutlinedButton from '@components/Button/OutlinedButton'; import StandardInput from '@components/Input/StandardInput'; From 379cc93dc50837e2a885f41f0bc9d98db961cebf Mon Sep 17 00:00:00 2001 From: publdaze Date: Mon, 11 Dec 2023 21:09:15 +0900 Subject: [PATCH 43/43] =?UTF-8?q?fix=20:=20=EB=A1=9C=EA=B7=B8=EC=95=84?= =?UTF-8?q?=EC=9B=83=20401=20=EC=97=90=EB=9F=AC=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #859 --- src/api/authApi.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/api/authApi.ts b/src/api/authApi.ts index 6052462f0..570ccba05 100644 --- a/src/api/authApi.ts +++ b/src/api/authApi.ts @@ -1,19 +1,28 @@ import { useMutation } from 'react-query'; import { useNavigate } from 'react-router-dom'; -import axios from 'axios'; +import axios, { AxiosError } from 'axios'; import { useSetRecoilState } from 'recoil'; import memberState from '@recoil/member.recoil'; const useSignOutMutation = () => { - const fetcher = () => axios.post(`/sign-out`); - const navigate = useNavigate(); const setMemberState = useSetRecoilState(memberState); + const fetcher = () => axios.post(`/sign-out`); + const signOut = () => { + navigate('/'); + setMemberState(null); + }; + return useMutation(fetcher, { onSuccess: () => { - navigate('/'); - setMemberState(null); + signOut(); + }, + onError: (error) => { + const errorStatusCode = (error as AxiosError).response?.status; + if (errorStatusCode === 401) { + signOut(); + } }, }); };