Skip to content

Commit c1e9af4

Browse files
committed
Feat: 폴더 이름 길이 제한
1 parent 41fe522 commit c1e9af4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

components/modal/AddFolderModal.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ const AddFolderModal = ({ folderName }: { folderName: string }) => {
1313
const { closeModal } = useModalStore();
1414

1515
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
16-
setValue(e.target.value);
16+
const newValue = e.target.value;
17+
if (newValue.length > 5) {
18+
toast.error(toastMessages.error.limitFolderNameLength);
19+
} else {
20+
setValue(newValue);
21+
}
1722
};
1823
const handleSubmit = async () => {
1924
const body = {

lib/toastMessage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const toastMessages = {
2525
SNSshare: "공유에 실패했습니다",
2626
inputLink: "링크를 입력해주세요",
2727
inputFolderName: "폴더 이름을 입력해주세요",
28+
limitFolderNameLength: "6자 이하로 입력해주세요",
2829
selectFolder: "폴더를 선택해주세요",
2930
sameLink: "이미 저장된 링크 주소입니다",
3031
sameFolderName: "같은 이름으로는 수정할 수 없습니다",

0 commit comments

Comments
 (0)