+
diff --git a/frontend/src/components/Home.jsx b/frontend/src/components/Home.jsx
index 3089df5..7fa7680 100644
--- a/frontend/src/components/Home.jsx
+++ b/frontend/src/components/Home.jsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import React from "react";
function HomePage() {
return (
diff --git a/frontend/src/components/ProfileUpdatePage.jsx b/frontend/src/components/ProfileUpdatePage.jsx
index 06a0213..6985851 100644
--- a/frontend/src/components/ProfileUpdatePage.jsx
+++ b/frontend/src/components/ProfileUpdatePage.jsx
@@ -1,12 +1,12 @@
-import React, { useState, useRef } from 'react';
-import { ApiUpdateUserProfile } from '../api/UserProfileApi';
+import React, { useState, useRef } from "react";
+import { ApiUpdateUserProfile } from "../api/UserProfileApi";
function ProfileUpdate() {
const [file, setFile] = useState(null);
- const [username, setUsername] = useState('');
- const [fullName, setFullName] = useState('');
- const [about, setAbout] = useState('');
- const defaultImage = 'https://i1.sndcdn.com/artworks-cTz48e4f1lxn5Ozp-L3hopw-t500x500.jpg';
+ const [username, setUsername] = useState("");
+ const [fullName, setFullName] = useState("");
+ const [about, setAbout] = useState("");
+ const defaultImage = "https://i1.sndcdn.com/artworks-cTz48e4f1lxn5Ozp-L3hopw-t500x500.jpg";
const fileInputRef = useRef(null);
const handleImageUpload = () => {
@@ -15,7 +15,7 @@ function ProfileUpdate() {
}
};
- const handleFileChange = (e) => {
+ const handleFileChange = e => {
const selectedFile = e.target.files[0];
if (selectedFile) {
setFile(selectedFile);
@@ -24,9 +24,9 @@ function ProfileUpdate() {
const handleSave = () => {
const formData = new FormData();
- formData.append('profile_pic', file);
- formData.append('first_name', username);
- formData.append('about', about);
+ formData.append("profile_pic", file);
+ formData.append("first_name", username);
+ formData.append("about", about);
ApiUpdateUserProfile(formData);
};
@@ -45,10 +45,7 @@ function ProfileUpdate() {
ref={fileInputRef}
/>
-
+
{file ? (
})
) : (
@@ -69,7 +66,7 @@ function ProfileUpdate() {
placeholder="Enter your username"
className="input w-full"
value={username}
- onChange={(e) => setUsername(e.target.value)}
+ onChange={e => setUsername(e.target.value)}
/>
@@ -81,7 +78,7 @@ function ProfileUpdate() {
placeholder="Enter your full name"
className="input w-full"
value={fullName}
- onChange={(e) => setFullName(e.target.value)}
+ onChange={e => setFullName(e.target.value)}
/>
@@ -92,7 +89,7 @@ function ProfileUpdate() {
placeholder="Tell us about yourself"
className="textarea w-full h-32"
value={about}
- onChange={(e) => setAbout(e.target.value)}
+ onChange={e => setAbout(e.target.value)}
/>
diff --git a/frontend/src/components/authentication/SignUpPage.jsx b/frontend/src/components/authentication/SignUpPage.jsx
index 2712f97..28eb1c2 100644
--- a/frontend/src/components/authentication/SignUpPage.jsx
+++ b/frontend/src/components/authentication/SignUpPage.jsx
@@ -1,31 +1,30 @@
-import React, { useState } from 'react';
-import { useNavigate } from 'react-router-dom';
-import axiosapi from '../../api/AuthenticationApi';
-
-import Avatar from '@mui/material/Avatar';
-import Button from '@mui/material/Button';
-import CssBaseline from '@mui/material/CssBaseline';
-import TextField from '@mui/material/TextField';
-import FormControlLabel from '@mui/material/FormControlLabel';
-import Checkbox from '@mui/material/Checkbox';
-import Link from '@mui/material/Link';
-import Grid from '@mui/material/Grid';
-import Box from '@mui/material/Box';
-import LockOutlinedIcon from '@mui/icons-material/LockOutlined';
-import Typography from '@mui/material/Typography';
-import Container from '@mui/material/Container';
-import { createTheme, ThemeProvider } from '@mui/material/styles';
+import React, { useState } from "react";
+import { useNavigate } from "react-router-dom";
+import axiosapi from "../../api/AuthenticationApi";
+import Avatar from "@mui/material/Avatar";
+import Button from "@mui/material/Button";
+import CssBaseline from "@mui/material/CssBaseline";
+import TextField from "@mui/material/TextField";
+import FormControlLabel from "@mui/material/FormControlLabel";
+import Checkbox from "@mui/material/Checkbox";
+import Link from "@mui/material/Link";
+import Grid from "@mui/material/Grid";
+import Box from "@mui/material/Box";
+import LockOutlinedIcon from "@mui/icons-material/LockOutlined";
+import Typography from "@mui/material/Typography";
+import Container from "@mui/material/Container";
+import { createTheme, ThemeProvider } from "@mui/material/styles";
function Copyright(props) {
return (
- {'Copyright © '}
+ {"Copyright © "}
TurTask
- {' '}
+ {" "}
{new Date().getFullYear()}
- {'.'}
+ {"."}
);
}
@@ -33,37 +32,36 @@ function Copyright(props) {
const defaultTheme = createTheme();
export default function SignUp() {
+ const Navigate = useNavigate();
- const Navigate = useNavigate();
+ const [formData, setFormData] = useState({
+ email: "",
+ username: "",
+ password: "",
+ });
+ const [error, setError] = useState(null);
+ const [isSubmitting, setIsSubmitting] = useState(false);
- const [formData, setFormData] = useState({
- email: '',
- username: '',
- password: '',
- });
- const [error, setError] = useState(null);
- const [isSubmitting, setIsSubmitting] = useState(false);
-
- const handleSubmit = async (e) => {
- e.preventDefault();
- setIsSubmitting(true);
- setError(null);
-
- try {
- axiosapi.createUser(formData);
- } catch (error) {
- console.error('Error creating user:', error);
- setError('Registration failed. Please try again.');
- } finally {
- setIsSubmitting(false);
- }
- Navigate('/login');
- };
-
- const handleChange = (e) => {
- const { name, value } = e.target;
- setFormData({ ...formData, [name]: value });
- };
+ const handleSubmit = async e => {
+ e.preventDefault();
+ setIsSubmitting(true);
+ setError(null);
+
+ try {
+ axiosapi.createUser(formData);
+ } catch (error) {
+ console.error("Error creating user:", error);
+ setError("Registration failed. Please try again.");
+ } finally {
+ setIsSubmitting(false);
+ }
+ Navigate("/login");
+ };
+
+ const handleChange = e => {
+ const { name, value } = e.target;
+ setFormData({ ...formData, [name]: value });
+ };
return (
@@ -71,13 +69,12 @@ export default function SignUp() {
-
+ marginTop: 8,
+ display: "flex",
+ flexDirection: "column",
+ alignItems: "center",
+ }}>
+
@@ -85,17 +82,17 @@ export default function SignUp() {
-
-
-
+
+
+
-
);
-}
\ No newline at end of file
+}
diff --git a/frontend/src/components/authentication/refreshAcessToken.jsx b/frontend/src/components/authentication/refreshAcessToken.jsx
index 89204d5..11a74fa 100644
--- a/frontend/src/components/authentication/refreshAcessToken.jsx
+++ b/frontend/src/components/authentication/refreshAcessToken.jsx
@@ -1,8 +1,8 @@
-import axios from 'axios';
+import axios from "axios";
async function refreshAccessToken() {
- const refresh_token = localStorage.getItem('refresh_token');
- const access_token = localStorage.getItem('access_token');
+ const refresh_token = localStorage.getItem("refresh_token");
+ const access_token = localStorage.getItem("access_token");
if (access_token) {
return true;
@@ -12,7 +12,7 @@ async function refreshAccessToken() {
return false;
}
- const refreshUrl = 'http://127.0.0.1:8000/api/token/refresh/';
+ const refreshUrl = "http://127.0.0.1:8000/api/token/refresh/";
try {
const response = await axios.post(refreshUrl, { refresh: refresh_token });
@@ -22,8 +22,8 @@ async function refreshAccessToken() {
const newAccessToken = response.data.access;
const newRefreshToken = response.data.refresh;
- localStorage.setItem('access_token', newAccessToken);
- localStorage.setItem('refresh_token', newRefreshToken);
+ localStorage.setItem("access_token", newAccessToken);
+ localStorage.setItem("refresh_token", newRefreshToken);
return true;
} else {
diff --git a/frontend/src/components/calendar/TaskDataHandler.jsx b/frontend/src/components/calendar/TaskDataHandler.jsx
index 3c123e9..933cb42 100644
--- a/frontend/src/components/calendar/TaskDataHandler.jsx
+++ b/frontend/src/components/calendar/TaskDataHandler.jsx
@@ -1,6 +1,6 @@
-import { fetchTodoTasks } from '../../api/TaskApi';
+import { fetchTodoTasks } from "../../api/TaskApi";
-let eventGuid = 0
+let eventGuid = 0;
// function getDateAndTime(dateString) {
// const dateObject = new Date(dateString);
@@ -18,25 +18,25 @@ let eventGuid = 0
// return dateFormatted + timeFormatted;
// }
-const mapResponseToEvents = (response) => {
- return response.map(item => ({
- id: createEventId(),
- title: item.title,
- start: item.start_event,
- end: item.end_event,
- }));
-}
+const mapResponseToEvents = response => {
+ return response.map(item => ({
+ id: createEventId(),
+ title: item.title,
+ start: item.start_event,
+ end: item.end_event,
+ }));
+};
export async function getEvents() {
- try {
- const response = await fetchTodoTasks();
- return mapResponseToEvents(response);
- } catch (error) {
- console.error(error);
- return [];
- }
+ try {
+ const response = await fetchTodoTasks();
+ return mapResponseToEvents(response);
+ } catch (error) {
+ console.error(error);
+ return [];
+ }
}
export function createEventId() {
- return String(eventGuid++);
-}
\ No newline at end of file
+ return String(eventGuid++);
+}
diff --git a/frontend/src/components/calendar/calendar.jsx b/frontend/src/components/calendar/calendar.jsx
index 6258da9..f1f63e5 100644
--- a/frontend/src/components/calendar/calendar.jsx
+++ b/frontend/src/components/calendar/calendar.jsx
@@ -1,4 +1,4 @@
-import React, { useState } from 'react';
+import React, { useState } from "react";
import { formatDate } from "@fullcalendar/core";
import FullCalendar from "@fullcalendar/react";
import dayGridPlugin from "@fullcalendar/daygrid";
@@ -79,7 +79,7 @@ export default class Calendar extends React.Component {
});
};
- handleDateSelect = (selectInfo) => {
+ handleDateSelect = selectInfo => {
let title = prompt("Please enter a new title for your event");
let calendarApi = selectInfo.view.calendar;
@@ -96,13 +96,13 @@ export default class Calendar extends React.Component {
}
};
- handleEventClick = (clickInfo) => {
+ handleEventClick = clickInfo => {
if (confirm(`Are you sure you want to delete the event '${clickInfo.event.title}'`)) {
clickInfo.event.remove();
}
};
- handleEvents = (events) => {
+ handleEvents = events => {
this.setState({
currentEvents: events,
});
diff --git a/frontend/src/components/icons/plusIcon.jsx b/frontend/src/components/icons/plusIcon.jsx
index 080d990..7363a7b 100644
--- a/frontend/src/components/icons/plusIcon.jsx
+++ b/frontend/src/components/icons/plusIcon.jsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import React from "react";
function PlusIcon() {
return (
@@ -8,13 +8,8 @@ function PlusIcon() {
viewBox="0 0 24 24"
strokeWidth={1.5}
stroke="currentColor"
- className="w-6 h-6"
- >
-
+ className="w-6 h-6">
+
);
}
diff --git a/frontend/src/components/icons/trashIcon.jsx b/frontend/src/components/icons/trashIcon.jsx
index f0be9fc..c7721fd 100644
--- a/frontend/src/components/icons/trashIcon.jsx
+++ b/frontend/src/components/icons/trashIcon.jsx
@@ -1,22 +1,20 @@
-import React from 'react';
+import React from "react";
function TrashIcon() {
- return (
- React.createElement(
- "svg",
- {
- xmlns: "http://www.w3.org/2000/svg",
- fill: "none",
- viewBox: "0 0 24 24",
- strokeWidth: 1.5,
- className: "w-6 h-6"
- },
- React.createElement("path", {
- strokeLinecap: "round",
- strokeLinejoin: "round",
- d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"
- })
- )
+ return React.createElement(
+ "svg",
+ {
+ xmlns: "http://www.w3.org/2000/svg",
+ fill: "none",
+ viewBox: "0 0 24 24",
+ strokeWidth: 1.5,
+ className: "w-6 h-6",
+ },
+ React.createElement("path", {
+ strokeLinecap: "round",
+ strokeLinejoin: "round",
+ d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0",
+ })
);
}
diff --git a/frontend/src/components/kanbanBoard/columnContainer.jsx b/frontend/src/components/kanbanBoard/columnContainer.jsx
index 5ff2333..102e424 100644
--- a/frontend/src/components/kanbanBoard/columnContainer.jsx
+++ b/frontend/src/components/kanbanBoard/columnContainer.jsx
@@ -5,29 +5,14 @@ import { useMemo, useState } from "react";
import PlusIcon from "../icons/plusIcon";
import TaskCard from "./taskCard";
-function ColumnContainer({
- column,
- deleteColumn,
- updateColumn,
- createTask,
- tasks,
- deleteTask,
- updateTask,
-}) {
+function ColumnContainer({ column, deleteColumn, updateColumn, createTask, tasks, deleteTask, updateTask }) {
const [editMode, setEditMode] = useState(false);
const tasksIds = useMemo(() => {
- return tasks.map((task) => task.id);
+ return tasks.map(task => task.id);
}, [tasks]);
- const {
- setNodeRef,
- attributes,
- listeners,
- transform,
- transition,
- isDragging,
- } = useSortable({
+ const { setNodeRef, attributes, listeners, transform, transition, isDragging } = useSortable({
id: column.id,
data: {
type: "Column",
@@ -57,8 +42,7 @@ function ColumnContainer({
rounded-md
flex
flex-col
- "
- >