-
Notifications
You must be signed in to change notification settings - Fork 2
[FE] SISC1-210 [FIX] : 게시글 작성 모달, 보드액션 부분 오류 수정 #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
14abcf4
54896b5
3d48607
0dcaafd
53621ab
c5d35a2
2a45912
353c07e
0ea0ba5
a85e6a8
914c1aa
b15ec99
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,30 @@ import FolderIcon from '../../assets/boardFolder.svg'; | |
| import CloseIcon from '../../assets/boardCloseIcon.svg'; | ||
| import DropdownArrowIcon from '../../assets/boardSelectArrow.svg'; | ||
|
|
||
| const Modal = ({ title, setTitle, content, setContent, onSave, onClose }) => { | ||
| const Modal = ({ | ||
| title, | ||
| setTitle, | ||
| content, | ||
| setContent, | ||
| selectedFiles, | ||
| onFileChange, | ||
| onRemoveFile, | ||
| onSave, | ||
| onClose, | ||
| }) => { | ||
| const handleDragOver = (e) => { | ||
| e.preventDefault(); | ||
| e.stopPropagation(); | ||
| }; | ||
|
|
||
| const handleDrop = (e) => { | ||
| e.preventDefault(); | ||
| e.stopPropagation(); | ||
|
|
||
| const droppedFiles = Array.from(e.dataTransfer.files); | ||
| onFileChange({ target: { files: droppedFiles } }); | ||
| }; | ||
|
Comment on lines
+22
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 드래그 앤 드롭 핸들러에서 가짜 이벤트 객체 생성
// Board.jsx - handleFileChange 끝부분
if (e.target.value !== undefined) {
e.target.value = '';
}🤖 Prompt for AI Agents |
||
|
|
||
| return ( | ||
| <div className={styles.overlay} onClick={onClose}> | ||
| <div className={styles.modal} onClick={(e) => e.stopPropagation()}> | ||
|
|
@@ -32,14 +55,18 @@ const Modal = ({ title, setTitle, content, setContent, onSave, onClose }) => { | |
| <div | ||
| className={styles.fileSection} | ||
| onClick={() => document.getElementById('fileUpload').click()} | ||
| onDragOver={handleDragOver} | ||
| onDrop={handleDrop} | ||
| > | ||
| <img src={FolderIcon} alt="폴더" /> | ||
| <span className={styles.fileText}>파일추가</span> | ||
| <span className={styles.fileText}>파일 추가</span> | ||
| <input | ||
| type="file" | ||
| id="fileUpload" | ||
| className={styles.fileInput} | ||
| style={{ display: 'none' }} | ||
| multiple | ||
| onChange={onFileChange} | ||
| /> | ||
| </div> | ||
| <div className={styles.divider}></div> | ||
|
|
@@ -52,6 +79,28 @@ const Modal = ({ title, setTitle, content, setContent, onSave, onClose }) => { | |
| </div> | ||
| </div> | ||
|
|
||
| {selectedFiles && selectedFiles.length > 0 && ( | ||
| <div className={styles.fileList}> | ||
| <label className={styles.label}> | ||
| 첨부 파일 ({selectedFiles.length}) | ||
| </label> | ||
| {selectedFiles.map((file, index) => ( | ||
| <div key={index} className={styles.fileItem}> | ||
| <span className={styles.fileName}> | ||
| {file.name} ({(file.size / 1024).toFixed(1)} KB) | ||
| </span> | ||
| <button | ||
| type="button" | ||
| className={styles.removeFileButton} | ||
| onClick={() => onRemoveFile(index)} | ||
| > | ||
| ✕ | ||
| </button> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| )} | ||
|
|
||
| <div className={styles.accessField}> | ||
| <label className={styles.accessLabel}>접근 권한</label> | ||
| <div className={styles.selectWrapper}> | ||
|
|
@@ -66,7 +115,7 @@ const Modal = ({ title, setTitle, content, setContent, onSave, onClose }) => { | |
| </div> | ||
|
|
||
| <button className={styles.saveButton} onClick={onSave}> | ||
| 저장 | ||
| 게시글 작성 | ||
| </button> | ||
| </div> | ||
| </div> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
props로 onFileChange를 받았는데 사용은 Modal 컴포넌트 바깥에서 하니까 정의되어 있지 않다고 나옵니다. 위치 옮겨주세요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 수정했습니다.