From c24bb4d1dd00fbefedc7b6d38e714aa350946e56 Mon Sep 17 00:00:00 2001 From: oxomi Date: Mon, 11 Mar 2024 20:28:20 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=95=88=ED=96=88=EC=9D=84=20=EB=96=84=20=ED=86=A0=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EB=A9=94=EC=8B=9C=EC=A7=80=20=EB=9D=84=EC=9B=8C?= =?UTF-8?q?=EC=A3=BC=EB=8F=84=EB=A1=9D=20#879?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/helperText.ts | 1 + src/pages/Study/Modal/StudyModal.tsx | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/constants/helperText.ts b/src/constants/helperText.ts index 21831a12..1d666ca9 100644 --- a/src/constants/helperText.ts +++ b/src/constants/helperText.ts @@ -2,6 +2,7 @@ export const COMMON = { success: {}, error: { required: '필수 정보입니다.', + requiredLogin: '로그인이 필요합니다.', onlyNumber: '숫자만 입력 가능합니다.', onlyHttps: 'https:// 로 시작해야 합니다.', minLength: (min: number) => `${min}글자 이상 입력해주세요.` as const, diff --git a/src/pages/Study/Modal/StudyModal.tsx b/src/pages/Study/Modal/StudyModal.tsx index 299dd5af..d15f1224 100644 --- a/src/pages/Study/Modal/StudyModal.tsx +++ b/src/pages/Study/Modal/StudyModal.tsx @@ -1,5 +1,6 @@ import React, { useEffect, useState } from 'react'; import { Controller, useForm } from 'react-hook-form'; +import toast from 'react-hot-toast'; import { useQueryClient } from 'react-query'; import { InputLabel, Stack, Typography, useMediaQuery, useTheme } from '@mui/material'; import { SiNotion } from 'react-icons/si'; @@ -146,6 +147,9 @@ const StudyModal = ({ open, setOpen, selectedStudyInfo, setSelectedStudyInfo, cu group: member.generation, })) || []), ]); + } else if (open && !headMemberInfo) { + toast.error(COMMON.error.requiredLogin); + setOpen(false); } }, [open, headMemberInfo]);