-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add project page, fix user page steps order
- Loading branch information
1 parent
27bfdbe
commit a8c2128
Showing
3 changed files
with
41 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,48 @@ | ||
import React from "react"; | ||
// import { projectPage } from "../../utils/get-fetch"; | ||
import { getProjectPage } from "../../utils/get-fetch"; | ||
|
||
const ProjectPage = () => { | ||
// const [projectData, setProjectData] = React.useState([]); | ||
const [projectData, setProjectData] = React.useState([]); | ||
const [stepId, setStepId] = React.useState(null); | ||
const [feedbackObject, setFeedbackObject] = React.useState([]); | ||
|
||
const projectId = 3; | ||
|
||
React.useEffect(() => { | ||
getProjectPage(projectId).then((projectData) => { | ||
setProjectData(projectData); | ||
console.log(projectData); | ||
setStepId(projectData.id); | ||
}); | ||
}, []); | ||
|
||
// React.useEffect(() => { | ||
// projectPage().then(setProjectData); | ||
// }, []); | ||
// getFeedback().then(setFeedbackObject) | ||
// }, [stepId]) | ||
|
||
// const { | ||
// id, | ||
// user_id, | ||
// project_name, | ||
// project_description, | ||
// project_status, | ||
// } = projectData; | ||
const { | ||
id, | ||
username, | ||
step_link, | ||
step_name, | ||
project_name, | ||
project_description, | ||
project_status, | ||
} = projectData; | ||
|
||
return <h1>Project Page</h1>; | ||
return ( | ||
<section> | ||
<h2>{project_name}</h2> | ||
<h3>By {username}</h3> | ||
<p>Project status: {project_status ? "Finished" : "In Progress"}</p> | ||
<p>{project_description}</p> | ||
<h2>Project Steps</h2> | ||
<article> | ||
<h3>{step_name}</h3> | ||
<img src={step_link} alt="" /> | ||
</article> | ||
</section> | ||
); | ||
}; | ||
|
||
export default ProjectPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters