-
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.
added routing
- Loading branch information
Jose Camilo
committed
Aug 3, 2024
1 parent
595070b
commit 7ec1f31
Showing
6 changed files
with
101 additions
and
17 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"[typescript]": { | ||
"editor.defaultFormatter": "vscode.typescript-language-features" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,24 +1,24 @@ | ||
import Navbar from "./components/Navbar"; | ||
import Hero from "./components/Hero"; | ||
import HomeCards from "./components/HomeCards"; | ||
import JobListings from "./components/JobListings"; | ||
import ViewAllJobs from "./components/ViewAllJobs"; | ||
import { Route, createBrowserRouter, createRoutesFromElements, RouterProvider } from "react-router-dom"; | ||
import HomePage from "./pages/HomePage"; | ||
import MainLayout from "./layouts/MainLayout" | ||
|
||
const router = createBrowserRouter( | ||
createRoutesFromElements( | ||
<Route path="/" element={<MainLayout />}> | ||
<Route index element={<HomePage />} /> | ||
</Route> | ||
)); | ||
|
||
const App = () => { | ||
return ( | ||
<> | ||
<Navbar /> | ||
<Hero title='Become a React Dev' subtitle='Find the React job that fits your skills and needs!'/> | ||
<HomeCards /> | ||
<JobListings /> | ||
<ViewAllJobs /> | ||
</> | ||
) | ||
return <RouterProvider router={router} /> | ||
}; | ||
|
||
export default App; | ||
|
||
|
||
|
||
// Next Lesson Use State | ||
// https://www.youtube.com/watch?v=LDB4uaJ87e0&t=1644s | ||
// https://www.youtube.com/watch?v=LDB4uaJ87e0&t=1644s | ||
|
||
// React Router | ||
// https://youtu.be/LDB4uaJ87e0?t=4757 |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Outlet } from "react-router-dom" | ||
import Navbar from "../components/Navbar" | ||
|
||
const MainLayout = () => { | ||
return ( | ||
<> | ||
<Navbar /> | ||
<Outlet/> | ||
</> | ||
) | ||
} | ||
|
||
export default MainLayout |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Hero from "../components/Hero"; | ||
import HomeCards from "../components/HomeCards"; | ||
import JobListings from "../components/JobListings"; | ||
import ViewAllJobs from "../components/ViewAllJobs"; | ||
|
||
const HomePage = () => { | ||
return ( | ||
<> | ||
<Hero title='Become a React Dev' subtitle='Find the React job that fits your skills and needs!' /> | ||
<HomeCards /> | ||
<JobListings /> | ||
<ViewAllJobs/> | ||
</> | ||
) | ||
} | ||
|
||
export default HomePage | ||
|