Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
fix: written explanation for later usage
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaVandewalle committed Mar 11, 2024
1 parent cbcad98 commit d49a3ac
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions frontend/src/pages/student/ProjectCardStudent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import {JSX} from "react";


export default function ProjectCardStudent(): JSX.Element {
// as for now I'm not sure how the info will come in, so using
// static values for now (change to true and true/false to see how they'll look like):
const has_submission: boolean = false;
// TODO: {{
// hasSubmission: check if there is a submission found in the database, if not it must return '-' on the screen
// isSuccess: when there is a submission, it must return either 'success' or 'failed'
// => if hasSubmission is false, isSuccess won't be checked (so ignoring all value changes)
// => when this isn't prefetched, useState will be needed for hasSubmission to rerender status correctly
// }}
const hasSubmission: boolean = false;
const isSuccess: boolean = true;

return (
Expand All @@ -17,10 +21,10 @@ export default function ProjectCardStudent(): JSX.Element {
</div>
<div className={"is-flex is-flex-direction-row is-align-items-center py-5"}>
<p className={"pr-2"}>status: </p>
{!has_submission && <p className={"px-2 py-1"}></p>}
{has_submission && isSuccess &&
{!hasSubmission && <p className={"px-2 py-1"}></p>}
{hasSubmission && isSuccess &&
<div className={"card"}><p className={"p-positive px-2 py-1"}>Success</p></div>}
{has_submission && !isSuccess &&
{hasSubmission && !isSuccess &&
<div className={"card"}><p className={"p-negative px-2 py-1"}>Failed</p></div>}
</div>
</div>
Expand Down

0 comments on commit d49a3ac

Please sign in to comment.