Username
diff --git a/frontend/src/pages/student/HomeStudent.tsx b/frontend/src/pages/student/HomeStudent.tsx
index 47d6c2a0..e4ab35e5 100644
--- a/frontend/src/pages/student/HomeStudent.tsx
+++ b/frontend/src/pages/student/HomeStudent.tsx
@@ -1,6 +1,8 @@
import {JSX} from "react";
import {Header} from "../../components/Header.tsx";
import {Sidebar} from "../../components/Sidebar.tsx";
+import ProjectCardStudent from "./ProjectCardStudent.tsx";
+import '../../assets/styles/students_components.css'
export default function HomeStudent(): JSX.Element {
return (
@@ -12,8 +14,18 @@ export default function HomeStudent(): JSX.Element {
-
- <>Homescreen for a student>
+
>
diff --git a/frontend/src/pages/student/ProjectCardStudent.tsx b/frontend/src/pages/student/ProjectCardStudent.tsx
new file mode 100644
index 00000000..b960a38b
--- /dev/null
+++ b/frontend/src/pages/student/ProjectCardStudent.tsx
@@ -0,0 +1,29 @@
+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):
+ let has_submission: boolean = false;
+ let isSuccess: boolean = false;
+
+ return (
+
+
Markov Decision Diagram
+
+
vak:
+
Computationele Biologie
+
+
+
status:
+ {!has_submission &&
—
}
+ {has_submission && isSuccess &&
Success
}
+ {has_submission && !isSuccess &&
Failed
}
+
+
+ )
+}
+
+
+
From 8d9a714c7737df0d39456cae0fb1b254767dbe59 Mon Sep 17 00:00:00 2001
From: EmmaVandewalle
Date: Sat, 9 Mar 2024 16:37:31 +0100
Subject: [PATCH 2/4] fix: layout cards and important force removed
---
frontend/src/assets/styles/students_components.css | 4 ++--
frontend/src/pages/student/ProjectCardStudent.tsx | 10 ++++++----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/frontend/src/assets/styles/students_components.css b/frontend/src/assets/styles/students_components.css
index 4f05acd9..4872219b 100644
--- a/frontend/src/assets/styles/students_components.css
+++ b/frontend/src/assets/styles/students_components.css
@@ -11,9 +11,9 @@
}
.p-negative {
- color: red !important;
+ color: red;
}
.p-positive {
- color: green !important;
+ color: green;
}
\ No newline at end of file
diff --git a/frontend/src/pages/student/ProjectCardStudent.tsx b/frontend/src/pages/student/ProjectCardStudent.tsx
index b960a38b..a1b3e033 100644
--- a/frontend/src/pages/student/ProjectCardStudent.tsx
+++ b/frontend/src/pages/student/ProjectCardStudent.tsx
@@ -4,8 +4,8 @@ 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):
- let has_submission: boolean = false;
- let isSuccess: boolean = false;
+ let has_submission: boolean = true;
+ let isSuccess: boolean = true;
return (
status:
{!has_submission &&
—
}
- {has_submission && isSuccess &&
Success
}
- {has_submission && !isSuccess &&
Failed
}
+ {has_submission && isSuccess &&
+
}
+ {has_submission && !isSuccess &&
+
}
)
From 126ec83465260cf53a395f6344feec28962d4590 Mon Sep 17 00:00:00 2001
From: EmmaVandewalle
Date: Sat, 9 Mar 2024 16:51:31 +0100
Subject: [PATCH 3/4] fix: linting for static value (temp value)
---
frontend/src/pages/student/ProjectCardStudent.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/frontend/src/pages/student/ProjectCardStudent.tsx b/frontend/src/pages/student/ProjectCardStudent.tsx
index a1b3e033..8d0ad6b4 100644
--- a/frontend/src/pages/student/ProjectCardStudent.tsx
+++ b/frontend/src/pages/student/ProjectCardStudent.tsx
@@ -4,8 +4,8 @@ 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):
- let has_submission: boolean = true;
- let isSuccess: boolean = true;
+ const has_submission: boolean = false;
+ const isSuccess: boolean = true;
return (
Date: Mon, 11 Mar 2024 10:41:54 +0100
Subject: [PATCH 4/4] fix: written explanation for later usage
---
.../src/pages/student/ProjectCardStudent.tsx | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/frontend/src/pages/student/ProjectCardStudent.tsx b/frontend/src/pages/student/ProjectCardStudent.tsx
index 8d0ad6b4..b38aad19 100644
--- a/frontend/src/pages/student/ProjectCardStudent.tsx
+++ b/frontend/src/pages/student/ProjectCardStudent.tsx
@@ -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 (
@@ -17,10 +21,10 @@ export default function ProjectCardStudent(): JSX.Element {
status:
- {!has_submission &&
—
}
- {has_submission && isSuccess &&
+ {!hasSubmission &&
—
}
+ {hasSubmission && isSuccess &&
}
- {has_submission && !isSuccess &&
+ {hasSubmission && !isSuccess &&
}