*/}
+
+ {/* info showed fine; dynamic parameters needed to work with the data stored in json */}
+
+
+
+
+
+ }/>
+ }/>
+ }/>
+
+
+
);
}
diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx
index 09e2806..8e092b8 100644
--- a/src/components/Navbar.jsx
+++ b/src/components/Navbar.jsx
@@ -1,5 +1,17 @@
+import { Link } from "react-router-dom";
+
function Navbar() {
- return ;
+ return (
+
+
+ )
}
export default Navbar;
diff --git a/src/main.jsx b/src/main.jsx
index 54b39dd..536ff4f 100644
--- a/src/main.jsx
+++ b/src/main.jsx
@@ -2,9 +2,11 @@ import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.jsx'
import './index.css'
+import { BrowserRouter } from 'react-router-dom'
ReactDOM.createRoot(document.getElementById('root')).render(
-
+
+
- ,
+
)
diff --git a/src/pages/CompanyPage.jsx b/src/pages/CompanyPage.jsx
index cc5903c..1ca9218 100644
--- a/src/pages/CompanyPage.jsx
+++ b/src/pages/CompanyPage.jsx
@@ -1,7 +1,38 @@
-function CompanyPage() {
+import { useParams, Link } from "react-router-dom";
+
+function CompanyPage({ companies }) {
+ // following feedback steps below
+ // access url params to get the company slug
+ const { companySlug } = useParams();
+
+ // uses find method to get matching company slug
+ const companyToDisplay = companies.find(
+ (company) => company.slug === companySlug
+ );
+
+ // guard clause in case the company doesn't appear
+ if (!companyToDisplay) {
+ return
company not found
;
+ }
+
return (
-
-
CompanyPage
+
+
+
{companyToDisplay.name}
+
{companyToDisplay.description}
+
+
+ {companyToDisplay.techStack.map((tech) => (
+
+ {/* adding ?company=${companySlug} so the company slug is passed as a query param
+ when visiting the tech page and we can use back-btn to come back to the company page */}
+
+
+ {tech.name}
+
+