From aacc862573247d0c34cb29fccc40deff20d1ae0b Mon Sep 17 00:00:00 2001 From: LeeSoonGu Date: Fri, 14 Jun 2024 12:28:51 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=ED=8C=8C=EC=9D=BC=EA=B5=AC?= =?UTF-8?q?=EC=A1=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{components => Notification}/Notification.module.scss | 0 .../Notification.tsx => Notification/index.tsx} | 4 ++-- components/NotificationModal/index.tsx | 6 +++--- .../types/{types.ts => NotificationModal.types.ts} | 0 components/Signup/SignupForm/index.tsx | 8 ++++++-- .../hooks/useUserQuery.ts => hooks/useNotiUserQuery.ts | 2 +- .../hooks/userRequest.ts => hooks/userNotiRequest.ts | 0 .../utils => utils}/extractNotificationInfo.ts | 2 +- .../NotificationModal/utils => utils}/formatTimeRange.ts | 0 .../NotificationModal/utils => utils}/getElapsedTime.ts | 0 10 files changed, 13 insertions(+), 9 deletions(-) rename components/NotificationModal/{components => Notification}/Notification.module.scss (100%) rename components/NotificationModal/{components/Notification.tsx => Notification/index.tsx} (89%) rename components/NotificationModal/types/{types.ts => NotificationModal.types.ts} (100%) rename components/NotificationModal/hooks/useUserQuery.ts => hooks/useNotiUserQuery.ts (77%) rename components/NotificationModal/hooks/userRequest.ts => hooks/userNotiRequest.ts (100%) rename {components/NotificationModal/utils => utils}/extractNotificationInfo.ts (86%) rename {components/NotificationModal/utils => utils}/formatTimeRange.ts (100%) rename {components/NotificationModal/utils => utils}/getElapsedTime.ts (100%) diff --git a/components/NotificationModal/components/Notification.module.scss b/components/NotificationModal/Notification/Notification.module.scss similarity index 100% rename from components/NotificationModal/components/Notification.module.scss rename to components/NotificationModal/Notification/Notification.module.scss diff --git a/components/NotificationModal/components/Notification.tsx b/components/NotificationModal/Notification/index.tsx similarity index 89% rename from components/NotificationModal/components/Notification.tsx rename to components/NotificationModal/Notification/index.tsx index 76483f4..6b89777 100644 --- a/components/NotificationModal/components/Notification.tsx +++ b/components/NotificationModal/Notification/index.tsx @@ -1,8 +1,8 @@ import React from "react"; import styles from "./Notification.module.scss"; -import type { Notification } from "../types/types"; +import type { Notification } from "../types/NotificationModal.types"; import useCookie from "@/hooks/useCookies"; -import { useClearNotification } from "../hooks/useUserQuery"; +import { useClearNotification } from "../../../hooks/useNotiUserQuery"; export default function Notification({ alertId, diff --git a/components/NotificationModal/index.tsx b/components/NotificationModal/index.tsx index 204a8d0..b10e3ab 100644 --- a/components/NotificationModal/index.tsx +++ b/components/NotificationModal/index.tsx @@ -1,9 +1,9 @@ import React from "react"; import styles from "./NotificationModal.module.scss"; import Image from "next/image"; -import Notification from "./components/Notification"; -import extractNotificationInfo from "./utils/extractNotificationInfo"; -import { NotificationItem } from "./types/types"; +import Notification from "./Notification"; +import extractNotificationInfo from "../../utils/extractNotificationInfo"; +import { NotificationItem } from "./types/NotificationModal.types"; import closeIcon from "@/public/image/close_icon.svg"; interface NotificationModalProps { diff --git a/components/NotificationModal/types/types.ts b/components/NotificationModal/types/NotificationModal.types.ts similarity index 100% rename from components/NotificationModal/types/types.ts rename to components/NotificationModal/types/NotificationModal.types.ts diff --git a/components/Signup/SignupForm/index.tsx b/components/Signup/SignupForm/index.tsx index 5ff1f10..c743992 100644 --- a/components/Signup/SignupForm/index.tsx +++ b/components/Signup/SignupForm/index.tsx @@ -9,7 +9,10 @@ import Button from "@/components/Button"; import Input from "@/components/Input"; import UserTypeSelect from "../UserTypeSelect"; import styles from "./SignupForm.module.scss"; -import { INVALID_EMAIL, INVALID_PASSWORD } from "../../Signin/ErrorMessage/errorMessage"; +import { + INVALID_EMAIL, + INVALID_PASSWORD, +} from "../../Signin/ErrorMessage/errorMessage"; import { useRouter } from "next/router"; import { emailRegex, passwordRegex } from "@/utils/signupRegex"; import { BASE_URL } from "@/constants/constants"; @@ -85,7 +88,8 @@ export default function SignupForm() { type="password" register={register("passwordCheck", { required: "비밀번호를 다시 입력하세요.", - validate: (value) => value === getValues("password") || "비밀번호가 일치하지 않습니다.", + validate: (value) => + value === getValues("password") || "비밀번호가 일치하지 않습니다.", })} /> diff --git a/components/NotificationModal/hooks/useUserQuery.ts b/hooks/useNotiUserQuery.ts similarity index 77% rename from components/NotificationModal/hooks/useUserQuery.ts rename to hooks/useNotiUserQuery.ts index 22500ab..7d11fc6 100644 --- a/components/NotificationModal/hooks/useUserQuery.ts +++ b/hooks/useNotiUserQuery.ts @@ -1,5 +1,5 @@ import { useMutation } from "react-query"; -import { ClearNotification } from "./userRequest"; +import { ClearNotification } from "./userNotiRequest"; export function useClearNotification(id: string, alertId: string, jwt: string) { return useMutation(() => ClearNotification(id, alertId, jwt)); diff --git a/components/NotificationModal/hooks/userRequest.ts b/hooks/userNotiRequest.ts similarity index 100% rename from components/NotificationModal/hooks/userRequest.ts rename to hooks/userNotiRequest.ts diff --git a/components/NotificationModal/utils/extractNotificationInfo.ts b/utils/extractNotificationInfo.ts similarity index 86% rename from components/NotificationModal/utils/extractNotificationInfo.ts rename to utils/extractNotificationInfo.ts index 9e51e13..d5c3f63 100644 --- a/components/NotificationModal/utils/extractNotificationInfo.ts +++ b/utils/extractNotificationInfo.ts @@ -1,5 +1,5 @@ import getElapsedTime from "./getElapsedTime"; -import { NotificationItem } from "../types/types"; +import { NotificationItem } from "../components/NotificationModal/types/NotificationModal.types"; import formatTimeRange from "./formatTimeRange"; export default function extractNotificationInfo( diff --git a/components/NotificationModal/utils/formatTimeRange.ts b/utils/formatTimeRange.ts similarity index 100% rename from components/NotificationModal/utils/formatTimeRange.ts rename to utils/formatTimeRange.ts diff --git a/components/NotificationModal/utils/getElapsedTime.ts b/utils/getElapsedTime.ts similarity index 100% rename from components/NotificationModal/utils/getElapsedTime.ts rename to utils/getElapsedTime.ts