Skip to content

Commit

Permalink
fix(Dashboard > homeworks): file pop-up was always empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Truiteseche committed Oct 16, 2024
1 parent a893f53 commit 219bfb4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
16 changes: 14 additions & 2 deletions src/components/app/Dashboard/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import UpcomingAssignments from "../Homeworks/UpcomingAssignments";
import PopUp from "../../generic/PopUps/PopUp";

import "./Dashboard.css";
import { formatDateRelative } from "../../../utils/date";
import FileComponent from "../../generic/FileComponent";

export default function Dashboard({ fetchUserGrades, grades, fetchHomeworks, activeAccount, isLoggedIn, useUserData, sortGrades, isTabletLayout }) {
const navigate = useNavigate();
Expand Down Expand Up @@ -120,8 +122,18 @@ export default function Dashboard({ fetchUserGrades, grades, fetchHomeworks, act
<EncodedHTMLDiv>{selectedTask.sessionContent}</EncodedHTMLDiv>
</BottomSheet>}
{(hashParameters.length > 2 && hashParameters[2] === "f" && selectedTask) && <PopUp className="task-file-pop-up" onClose={() => { navigate(`${hashParameters[0]};${hashParameters[1]}`, { replace: true }) }}>
<h2>Fichiers</h2>
<div>{selectedTask.file}</div>
<div className="header-container">
<h2 className="file-title">Fichiers joints</h2>
<p className="file-subject">{selectedTask.subject}{formatDateRelative(new Date(selectedTask.addDate))}</p>
</div>
<div className="file-scroller">
<div className="file-wrapper">
<p className="file-subject">Note : maintenir pour télécharger</p>
{selectedTask.type === "task"
? selectedTask.files.map((file) => <FileComponent key={file.id} file={file} />)
: selectedTask.sessionContentFiles.map((file) => <FileComponent key={file.id} file={file} />)}
</div>
</div>
</PopUp>}
</div>
)
Expand Down
1 change: 0 additions & 1 deletion src/components/app/Messaging/Inbox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export default function Inbox({ selectedMessage, setSelectedMessage, selectedFol
if (query === "") {
return true;
}
console.log("filterResearch ~ query:", query)
try {
// regexp = new RegExp(removeAccents(search.toLowerCase()));
} catch { return -1 }
Expand Down

0 comments on commit 219bfb4

Please sign in to comment.