-
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 dynamic routing for project page and refactor code courtesy of Izaak
Relates #11 Co-authored-by: Hannah Gooding <hannah.gooding@yahoo.com>
- Loading branch information
1 parent
e7b7ef9
commit c66d410
Showing
8 changed files
with
109 additions
and
121 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
|
||
import "./index.css"; | ||
import App from "./App"; | ||
|
||
|
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,23 +1,22 @@ | ||
import React from "react"; | ||
import { projectPage } from "../../utils/get-fetch"; | ||
// import { projectPage } from "../../utils/get-fetch"; | ||
|
||
const ProjectPage = () => { | ||
const [projectData, setProjectData] = React.useState([]); | ||
// const [projectData, setProjectData] = React.useState([]); | ||
|
||
React.useEffect(() => { | ||
projectPage().then(setProjectData); | ||
}, []); | ||
// React.useEffect(() => { | ||
// projectPage().then(setProjectData); | ||
// }, []); | ||
|
||
const { | ||
id, | ||
user_id, | ||
project_name, | ||
project_description, | ||
project_status, | ||
} = projectData; | ||
// SELECT (SELECT username FROM users WHERE projects.user_id=users.id), project_name, project_description, project_status, steps.step_name, steps.step_link, steps.date, feedback_text, feedback_tag, feedback.date | ||
// FROM projects JOIN users ON projects.user_id=users.id JOIN steps ON projects.id=steps.project_id JOIN feedback ON steps.id=feedback.step_id | ||
// WHERE projects.id = 1; | ||
// const { | ||
// id, | ||
// user_id, | ||
// project_name, | ||
// project_description, | ||
// project_status, | ||
// } = projectData; | ||
|
||
return <h1>Project Page</h1>; | ||
}; | ||
|
||
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