diff --git a/client/src/components/ui/taskDisplay.tsx b/client/src/components/ui/taskDisplay.tsx
deleted file mode 100644
index 4ccc74e..0000000
--- a/client/src/components/ui/taskDisplay.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import React from "react";
-
-export default function TaskDisplay(task_name: string) {
- return (
-
-
Current Focus
-
- {task_name}
-
-
- );
-}
diff --git a/client/src/components/ui/timeDisplay.tsx b/client/src/components/ui/timeDisplay.tsx
deleted file mode 100644
index 9b5e3b7..0000000
--- a/client/src/components/ui/timeDisplay.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-import React, { useEffect, useState } from "react";
-
-import Timer from "./timer";
-
-interface TimeDisplayProps {
- statusSignal: (data: string) => void;
- time: string;
- current: boolean;
-}
-
-export default function TimeDisplay({
- statusSignal,
- time,
- current
-}: TimeDisplayProps) {
- const [timeRemaining, setTimeRemaining] = useState(0);
-
- useEffect(() => {
- const getTimeRemaining = setInterval(() => {
- const [Hours, Mins, Sec] = time.split(":").map(Number);
-
- const d = new Date();
- const time_serial = Hours * 60 * 60 + Mins * 60 + Sec;
- const cur_time =
- d.getHours() * 60 * 60 + d.getMinutes() * 60 + d.getSeconds();
-
- let remaining_time = 0;
-
- remaining_time = time_serial - cur_time;
- if (remaining_time <= 1) {
- clearInterval(getTimeRemaining);
- }
-
- setTimeRemaining(remaining_time);
- }, 1000);
-
- return () => clearInterval(getTimeRemaining);
- }, [time, timeRemaining]);
-
- useEffect(() => {
- if (timeRemaining <= 1) {
- statusSignal("finished");
- }
- }, [timeRemaining, statusSignal]);
-
- return (
-
- {current ? (
- <>
-
Timer
- >
- ) : (
- <>
-
Next Task
- >
- )}
-
{Timer(timeRemaining)}
-
-
- );
-}
diff --git a/client/src/components/ui/timer.tsx b/client/src/components/ui/timer.tsx
deleted file mode 100644
index 353ac7a..0000000
--- a/client/src/components/ui/timer.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-const Timer = (timeRemaining: number) => {
- const formatTime = (time: number) => {
- const seconds = Math.floor(time % 60);
- const minutes = Math.floor((time / 60) % 60);
- const hours = Math.floor((time / (60 * 60)) % 24);
-
- return (
-
-
- {hours > 0 ? (
- <>
- {hours.toString()}
- :
- >
- ) : (
- <>>
- )}
- {minutes.toString().padStart(2, "0")}
- :
- {seconds.toString().padStart(2, "0")}
-
-
- );
- };
-
- return (
-
- {formatTime(timeRemaining)}
-
- );
-};
-
-export default Timer;
diff --git a/client/src/pages/focus.tsx b/client/src/pages/focus.tsx
index 9d755cd..f0276f8 100644
--- a/client/src/pages/focus.tsx
+++ b/client/src/pages/focus.tsx
@@ -152,9 +152,9 @@ const CountdownTimer = () => {
}
return (
-
-
-
focus
+
+
+
Focus
@@ -189,7 +189,7 @@ const CountdownTimer = () => {
- {tasks.length > 0 ? (
+ {times.length > 0 ? (
tasks
diff --git a/client/src/pages/schedule.tsx b/client/src/pages/schedule.tsx
index b9b5df9..aa4b6b1 100644
--- a/client/src/pages/schedule.tsx
+++ b/client/src/pages/schedule.tsx
@@ -1,3 +1,4 @@
+import { useRouter } from "next/router";
import { useEffect, useState } from "react";
import Timetable, {
@@ -5,7 +6,6 @@ import Timetable, {
resizeAndPositionTimetableElements,
} from "@/components/timetable";
import { TimetableTaskProps } from "@/components/timetable_task";
-import { useRouter } from "next/router";
/*
Database representation of Time.
@@ -46,7 +46,7 @@ interface Task {
Used to convert database representation of a day to string used by front end.
*/
enum Day {
- Monday = 0,
+ Monday = 1,
Tuesday,
Wednesday,
Thursday,
@@ -60,7 +60,6 @@ Page containing a Timetable to visually represent the times that tasks have been
assigned.
*/
function Schedule() {
-
const router = useRouter();
const [timetableTasksProps, setTimetableTasksProps] = useState<
TimetableTaskProps[]
@@ -85,7 +84,6 @@ function Schedule() {
to be displayed. Sets the timetableTasksProps State variable once finished.
*/
async function fetchTasks() {
-
try {
const token = localStorage.getItem("access");
if (!token) {
@@ -299,7 +297,7 @@ function Schedule() {
to run in an infinite loop. */
return (
-
+
diff --git a/client/src/pages/tasks.tsx b/client/src/pages/tasks.tsx
index f89c9f8..dd30660 100644
--- a/client/src/pages/tasks.tsx
+++ b/client/src/pages/tasks.tsx
@@ -91,9 +91,9 @@ export default function TasksPage() {
.catch((err) => console.error("Failed to load topics", err));
}, []);
- if (loading) {
- return
Loading tasks...
;
- }
+ //if (loading) {
+ // return
Loading tasks...
;
+ //}
const handleTaskCreated = (task: Item) => {
setItems((prev) => [...prev, task]);
@@ -163,14 +163,12 @@ export default function TasksPage() {
}
return (
-
+
-
-
- My Tasks
+
+ Tasks
-
Add Task
@@ -207,7 +205,7 @@ export default function TasksPage() {