-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathProjectPage.jsx
More file actions
34 lines (27 loc) · 959 Bytes
/
ProjectPage.jsx
File metadata and controls
34 lines (27 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React from "react";
import { useParams } from "react-router-dom";
import ProjectInfo from "src/components/organisms/ProjectInfo";
import Error from "src/components/atoms/Error";
import Loader from "src/components/atoms/Loader";
import { useProject } from "../lib/hooks/project";
import DefaultTemplate from "../components/templates/DefaultTemplate";
const ProjectPage = () => {
const { id } = useParams()
const { project, loading, error } = useProject({projectId: id})
console.log(project)
return(
<DefaultTemplate>
<h2> Project info</h2>
{error && !loading &&
<div>
<Error errorText={error}/>
</div>}
{loading &&
<center>
<Loader/>
</center>}
{project && !loading && <ProjectInfo project={project} />}
</DefaultTemplate>
);
};
export default ProjectPage;