Commit 89500f3d authored by ras19's avatar ras19
Browse files

Neated Home.js with shorter variables and removing unnecessary ones [RS, EW]

parent 56c82b25
Pipeline #202939 passed with stage
in 47 seconds
......@@ -6,18 +6,17 @@ import { useState } from "react";
const Home = () => {
const {data: projects, errorProjects, isPendingProjects} = useFetch("/projects");
const {data: todos, errorTodos, isPendingTodos} = useFetch("/todos");
const {setToken, token} = useToken();
const {data: relevantProjects, errorRProjects, isPendingRProjects} = useFetch("/user_project/username/" + token);
const {data: projects, errorRProjects, isPendingRProjects} = useFetch("/user_project/username/" + token);
return (
<div className="home">
<h1>Dashboard</h1>
<div className="home-projects" style={{float: "left", width: "600px"}}>
{ isPendingProjects && <h2>Loading...</h2> }
{ projects && <ProjectList projects={relevantProjects} title="My Projects"/> }
{ isPendingRProjects && <h2>Loading...</h2> }
{ projects && <ProjectList projects={projects} title="My Projects"/> }
</div>
<div className="homeTodos">
{ isPendingTodos && <h2>Loading...</h2> }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment