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 { App } from "../component/App.jsx";
|
||||||
import { Body } from "../component/Body.jsx";
|
import { Body } from "../component/Body.jsx";
|
||||||
import { Footer } from "../component/Footer.jsx";
|
import { Footer } from "../component/Footer.jsx";
|
||||||
import { Header } from "../component/Head.jsx";
|
|
||||||
|
|
||||||
export function Accueil() {
|
export function Accueil() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Navbar />
|
|
||||||
<Header />
|
|
||||||
<App />
|
<App />
|
||||||
<Body />
|
<Body />
|
||||||
<Footer />
|
<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 ReactDOM from "react-dom/client";
|
||||||
import { RouterProvider } from "react-router-dom";
|
import { RouterProvider } from "react-router-dom";
|
||||||
import back_img from "./assets/img_site.jpg";
|
import back_img from "./assets/img_site.jpg";
|
||||||
|
import { Header } from "./component/Head.jsx";
|
||||||
import { router } from "./services/Router.jsx";
|
import { router } from "./services/Router.jsx";
|
||||||
|
|
||||||
/* function button_caller(argv) {
|
/* function button_caller(argv) {
|
||||||
|
@ -5,40 +5,47 @@ import { Blog } from "../files/Blog";
|
|||||||
import { Help } from "../files/Help";
|
import { Help } from "../files/Help";
|
||||||
import { Product } from "../files/Product";
|
import { Product } from "../files/Product";
|
||||||
import { Register } from "../files/Register";
|
import { Register } from "../files/Register";
|
||||||
|
import { Root } from "../files/Root";
|
||||||
import { Serveurs } from "../files/Serveurs";
|
import { Serveurs } from "../files/Serveurs";
|
||||||
import { SignIn } from "../files/Sign_in";
|
import { SignIn } from "../files/Sign_in";
|
||||||
|
|
||||||
export const router = createBrowserRouter([
|
export const router = createBrowserRouter([
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
element: <Accueil />,
|
element: <Root />,
|
||||||
},
|
children: [
|
||||||
{
|
{
|
||||||
path: "/sign-in",
|
path: "/accueil",
|
||||||
element: <SignIn />,
|
element: <Accueil />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/register",
|
path: "/sign-in",
|
||||||
element: <Register />,
|
element: <SignIn />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/about",
|
path: "/register",
|
||||||
element: <About />,
|
element: <Register />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/blog",
|
path: "/about",
|
||||||
element: <Blog />,
|
element: <About />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/help",
|
path: "/blog",
|
||||||
element: <Help />,
|
element: <Blog />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/product",
|
path: "/help",
|
||||||
element: <Product />,
|
element: <Help />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/serveurs",
|
path: "/product",
|
||||||
element: <Serveurs />,
|
element: <Product />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/serveurs",
|
||||||
|
element: <Serveurs />,
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
Loading…
Reference in New Issue
Block a user