UPDATE: keep the navbar in all the web site
This commit is contained in:
parent
ef227551c7
commit
ca8e643503
@ -1,14 +1,10 @@
|
||||
import { Navbar } from ".././component/Navbar.jsx";
|
||||
import { App } from "../component/App.jsx";
|
||||
import { Body } from "../component/Body.jsx";
|
||||
import { Footer } from "../component/Footer.jsx";
|
||||
import { Header } from "../component/Head.jsx";
|
||||
|
||||
export function Accueil() {
|
||||
return (
|
||||
<>
|
||||
<Navbar />
|
||||
<Header />
|
||||
<App />
|
||||
<Body />
|
||||
<Footer />
|
||||
|
15
src/files/Root.jsx
Normal file
15
src/files/Root.jsx
Normal file
@ -0,0 +1,15 @@
|
||||
import { Outlet, useLocation } from "react-router-dom";
|
||||
import { Header } from "../component/Head";
|
||||
import { Navbar } from "../component/Navbar";
|
||||
|
||||
export function Root() {
|
||||
const location = useLocation();
|
||||
console.log(location);
|
||||
return (
|
||||
<>
|
||||
{location.pathname == "/accueil" && <Navbar />}
|
||||
<Header />;
|
||||
<Outlet />
|
||||
</>
|
||||
);
|
||||
}
|
@ -3,6 +3,7 @@ import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import { RouterProvider } from "react-router-dom";
|
||||
import back_img from "./assets/img_site.jpg";
|
||||
import { Header } from "./component/Head.jsx";
|
||||
import { router } from "./services/Router.jsx";
|
||||
|
||||
/* function button_caller(argv) {
|
||||
|
@ -5,40 +5,47 @@ import { Blog } from "../files/Blog";
|
||||
import { Help } from "../files/Help";
|
||||
import { Product } from "../files/Product";
|
||||
import { Register } from "../files/Register";
|
||||
import { Root } from "../files/Root";
|
||||
import { Serveurs } from "../files/Serveurs";
|
||||
import { SignIn } from "../files/Sign_in";
|
||||
|
||||
export const router = createBrowserRouter([
|
||||
{
|
||||
path: "/",
|
||||
element: <Accueil />,
|
||||
},
|
||||
{
|
||||
path: "/sign-in",
|
||||
element: <SignIn />,
|
||||
},
|
||||
{
|
||||
path: "/register",
|
||||
element: <Register />,
|
||||
},
|
||||
{
|
||||
path: "/about",
|
||||
element: <About />,
|
||||
},
|
||||
{
|
||||
path: "/blog",
|
||||
element: <Blog />,
|
||||
},
|
||||
{
|
||||
path: "/help",
|
||||
element: <Help />,
|
||||
},
|
||||
{
|
||||
path: "/product",
|
||||
element: <Product />,
|
||||
},
|
||||
{
|
||||
path: "/serveurs",
|
||||
element: <Serveurs />,
|
||||
element: <Root />,
|
||||
children: [
|
||||
{
|
||||
path: "/accueil",
|
||||
element: <Accueil />,
|
||||
},
|
||||
{
|
||||
path: "/sign-in",
|
||||
element: <SignIn />,
|
||||
},
|
||||
{
|
||||
path: "/register",
|
||||
element: <Register />,
|
||||
},
|
||||
{
|
||||
path: "/about",
|
||||
element: <About />,
|
||||
},
|
||||
{
|
||||
path: "/blog",
|
||||
element: <Blog />,
|
||||
},
|
||||
{
|
||||
path: "/help",
|
||||
element: <Help />,
|
||||
},
|
||||
{
|
||||
path: "/product",
|
||||
element: <Product />,
|
||||
},
|
||||
{
|
||||
path: "/serveurs",
|
||||
element: <Serveurs />,
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
Loading…
Reference in New Issue
Block a user