Skip to content

Commit

Permalink
Chore: #115 일정 파일 accept 설정 상수로 추출
Browse files Browse the repository at this point in the history
  • Loading branch information
Seok93 committed Sep 27, 2024
1 parent 1744999 commit c96ec9e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/modal/task/ModalTaskForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export default function ModalTaskForm({ formId, project, taskId, onSubmit }: Mod
id="files"
label="첨부파일"
files={files}
accept=".jpg, .jpeg, .png, .svg, .webp, .pdf, .txt, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .hwp, .zip, .rar, .7z, .alz, .egg"
accept={TASK_SETTINGS.FILE_ACCEPT}
onFileChange={handleFileChange}
onFileDrop={handleFileDrop}
onFileDeleteClick={handleFileDeleteClick}
Expand Down
2 changes: 1 addition & 1 deletion src/components/modal/task/UpdateModalTask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export default function UpdateModalTask({ project, taskId, onClose: handleClose
id="files"
label="첨부파일"
files={taskFileList}
accept=".jpg, .jpeg, .png, .svg, .webp, .pdf, .txt, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .hwp, .zip, .rar, .7z, .alz, .egg"
accept={TASK_SETTINGS.FILE_ACCEPT}
onFileChange={handleFileChange}
onFileDrop={handleFileDrop}
onFileDeleteClick={handleFileDeleteClick}
Expand Down
2 changes: 2 additions & 0 deletions src/constants/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ export const USER_SETTINGS = Object.freeze({
MAX_EMAIL_LENGTH: 128,
});

// prettier-ignore
export const TASK_SETTINGS = Object.freeze({
MAX_FILE_SIZE: 2 * MB,
MAX_FILE_COUNT: 10,
FILE_ACCEPT: '.jpg, .jpeg, .png, .svg, .webp, .pdf, .txt, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .hwp, .zip, .rar, .7z, .alz, .egg',
FILE_TYPES: TASK_ACCEPT_FILE_TYPES,
});

0 comments on commit c96ec9e

Please sign in to comment.