Skip to content

Commit

Permalink
updating header and routes
Browse files Browse the repository at this point in the history
  • Loading branch information
kero1019 committed Jul 1, 2024
1 parent 988320d commit 1c80aa6
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 22 deletions.
29 changes: 9 additions & 20 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,20 @@ import Home from "./Components/Home";
import About from "./Components/About";
import Vans from "./Components/Vans";
import VanDetails from "./Components/VanDetails";
import "./Server"
import Layout from "./Components/Layout";
import "./Server";

function App() {
return (
<div className=" h-screen">
<div className="">
<BrowserRouter>
<header className="bg-main-background flex justify-between p-5 items-center h-[15%]">
<Link
// to="/Components/Home.jsx"
to="/VanLife/"
className=" font-extrabold text-[2rem]"
>
#VANLIFE
</Link>
<nav className="flex gap-5 text-gray-text font-semibold">
<Link to="/VanLife/about">About</Link>
<Link to="/VanLife/vans">Vans</Link>
</nav>
</header>
<Routes>
{/* <Route path="/Components/Home.jsx" element={<Home />} /> */}
<Route path="/VanLife/" element={<Home />} />
<Route path="/VanLife/about" element={<About />} />
<Route path="VanLife/vans" element={<Vans />} />
<Route path="VanLife/vanDetails/:id" element={<VanDetails />} />
<Route element={<Layout />}>
<Route path="/VanLife/" element={<Home />} />
<Route path="/VanLife/about" element={<About />} />
<Route path="VanLife/vans" element={<Vans />} />
<Route path="VanLife/vanDetails/:id" element={<VanDetails />} />
</Route>
</Routes>
</BrowserRouter>
</div>
Expand Down
15 changes: 15 additions & 0 deletions src/Components/Header.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";
import { Link } from "react-router-dom";
export default function Header() {
return (
<header className="bg-main-background flex justify-between p-5 items-center h-[15%]">
<Link to="/VanLife/" className=" font-extrabold text-[2rem]">
#VANLIFE
</Link>
<nav className="flex gap-5 text-gray-text font-semibold">
<Link to="/VanLife/about">About</Link>
<Link to="/VanLife/vans">Vans</Link>
</nav>
</header>
);
}
4 changes: 2 additions & 2 deletions src/Components/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Footer from "./Footer";
import OrangeButton from "./OrangeButton";
export default function Home() {
return (
<div className="home-content h-[85%] home">
<div className="image w-full h-[85%] text-white p-6 flex flex-col justify-around">
<div className="home-content h-[85%] home">
<div className="image h-[85%] text-white p-6 flex flex-col justify-around">
<p className="text-[3rem] font-bold ">You got the travel plans, we got the travel vans.</p>
<p className="">Add adventure to your life by joining the #vanlife movement. Rent the perfect van to make your perfect road trip.</p>
<OrangeButton>Find your Van</OrangeButton>
Expand Down
11 changes: 11 additions & 0 deletions src/Components/Layout.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";
import { Outlet } from "react-router-dom";
import Header from "./Header";
export default function Layout() {
return (
<div className="h-screen">
<Header />
<Outlet />
</div>
);
}

0 comments on commit 1c80aa6

Please sign in to comment.