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]);