correct navbar

This commit is contained in:
Simon CATANESE 2024-05-07 13:15:21 +02:00
parent 135ab48886
commit 83291c246b
11 changed files with 334 additions and 67 deletions

Binary file not shown.

View File

@ -1,7 +1,64 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\",
"Documents": [],
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\nav\\Navbar.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\components\\nav\\Navbar.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\app-layout.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\components\\app-layout.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\contexts\\auth-context.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\contexts\\auth-context.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\authenticated.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\components\\authenticated.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\authentication.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\api\\authentication.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\App.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\App.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\pages\\test.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\pages\\test.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\room.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\api\\room.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\.vs\\2024-DEV-BUT3\\config\\applicationhost.config||{FA3CD31E-987B-443A-9B81-186104E8DAC1}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:.vs\\2024-DEV-BUT3\\config\\applicationhost.config||{FA3CD31E-987B-443A-9B81-186104E8DAC1}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\item\\ItemPage.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\components\\item\\ItemPage.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\package.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:package.json||{90A6B3A7-C1A3-4009-A288-E2FF89E96FA0}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\vitest.config.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:vitest.config.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\vite.config.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:vite.config.js||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
},
{
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\Admin\\Source\\Repos\\2024-DEV-BUT3\\src\\hooks\\page-title-context.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}",
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:src\\hooks\\page-title-context.jsx||{14D17961-FE51-464D-9111-C4AF11D7D99A}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
@ -9,11 +66,188 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": -1,
"SelectedChildIndex": 3,
"Children": [
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "auth-context.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\contexts\\auth-context.jsx",
"RelativeDocumentMoniker": "src\\contexts\\auth-context.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\contexts\\auth-context.jsx",
"RelativeToolTip": "src\\contexts\\auth-context.jsx",
"ViewState": "AQIAACoAAAAAAAAAAAAAADwAAAAEAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-07T09:38:35.04Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "authenticated.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\authenticated.jsx",
"RelativeDocumentMoniker": "src\\components\\authenticated.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\authenticated.jsx",
"RelativeToolTip": "src\\components\\authenticated.jsx",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-07T09:38:15.52Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "authentication.js",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\authentication.js",
"RelativeDocumentMoniker": "src\\api\\authentication.js",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\authentication.js",
"RelativeToolTip": "src\\api\\authentication.js",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAB0AAAACAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001646|",
"WhenOpened": "2024-05-07T09:34:33.928Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Navbar.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\nav\\Navbar.jsx",
"RelativeDocumentMoniker": "src\\components\\nav\\Navbar.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\nav\\Navbar.jsx",
"RelativeToolTip": "src\\components\\nav\\Navbar.jsx",
"ViewState": "AQIAAAsAAAAAAAAAAAAQwBIAAAAgAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-06T21:42:24.983Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "app-layout.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\app-layout.jsx",
"RelativeDocumentMoniker": "src\\components\\app-layout.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\app-layout.jsx",
"RelativeToolTip": "src\\components\\app-layout.jsx",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABAAAAAUAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-07T08:58:37.766Z",
"EditorCaption": ""
},
{
"$type": "Bookmark",
"Name": "ST:1:0:{d212f56b-c48a-434c-a121-1c5d80b59b9f}"
},
{
"$type": "Document",
"DocumentIndex": 8,
"Title": "applicationhost.config",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\.vs\\2024-DEV-BUT3\\config\\applicationhost.config",
"RelativeDocumentMoniker": ".vs\\2024-DEV-BUT3\\config\\applicationhost.config",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\.vs\\2024-DEV-BUT3\\config\\applicationhost.config",
"RelativeToolTip": ".vs\\2024-DEV-BUT3\\config\\applicationhost.config",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000601|",
"WhenOpened": "2024-05-06T23:30:27.125Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 11,
"Title": "vitest.config.js",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\vitest.config.js",
"RelativeDocumentMoniker": "vitest.config.js",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\vitest.config.js",
"RelativeToolTip": "vitest.config.js",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001646|",
"WhenOpened": "2024-05-06T23:20:08.112Z"
},
{
"$type": "Document",
"DocumentIndex": 12,
"Title": "vite.config.js",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\vite.config.js",
"RelativeDocumentMoniker": "vite.config.js",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\vite.config.js",
"RelativeToolTip": "vite.config.js",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001646|",
"WhenOpened": "2024-05-06T23:20:02.873Z"
},
{
"$type": "Document",
"DocumentIndex": 7,
"Title": "room.js",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\room.js",
"RelativeDocumentMoniker": "src\\api\\room.js",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\api\\room.js",
"RelativeToolTip": "src\\api\\room.js",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAA4AAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001646|",
"WhenOpened": "2024-05-06T22:06:47.739Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 6,
"Title": "test.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\pages\\test.jsx",
"RelativeDocumentMoniker": "src\\pages\\test.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\pages\\test.jsx",
"RelativeToolTip": "src\\pages\\test.jsx",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABMAAAACAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-06T18:36:04.359Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 5,
"Title": "App.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\App.jsx",
"RelativeDocumentMoniker": "src\\App.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\App.jsx",
"RelativeToolTip": "src\\App.jsx",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABEAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-06T16:40:31.952Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 10,
"Title": "package.json",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\package.json",
"RelativeDocumentMoniker": "package.json",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\package.json",
"RelativeToolTip": "package.json",
"ViewState": "AQIAAAYAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001642|",
"WhenOpened": "2024-05-06T23:20:16.656Z"
},
{
"$type": "Document",
"DocumentIndex": 13,
"Title": "page-title-context.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\hooks\\page-title-context.jsx",
"RelativeDocumentMoniker": "src\\hooks\\page-title-context.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\hooks\\page-title-context.jsx",
"RelativeToolTip": "src\\hooks\\page-title-context.jsx",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAgAAAAMAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-06T19:10:02.382Z"
},
{
"$type": "Document",
"DocumentIndex": 9,
"Title": "ItemPage.jsx",
"DocumentMoniker": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\item\\ItemPage.jsx",
"RelativeDocumentMoniker": "src\\components\\item\\ItemPage.jsx",
"ToolTip": "C:\\Users\\Admin\\source\\repos\\2024-DEV-BUT3\\src\\components\\item\\ItemPage.jsx",
"RelativeToolTip": "src\\components\\item\\ItemPage.jsx",
"ViewState": "AQIAAAAAAAAAAAAAAAAAACQAAAApAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003663|",
"WhenOpened": "2024-05-06T18:36:16.712Z"
}
]
}

View File

@ -1,7 +1,8 @@
{
"ExpandedNodes": [
""
"",
"\\src\\assets\\styles"
],
"SelectedNode": "\\C:\\Users\\Admin\\Source\\Repos\\2024-DEV-BUT3",
"SelectedNode": "\\package.json",
"PreviewInSolutionExplorer": false
}

Binary file not shown.

View File

@ -7,15 +7,20 @@ import Navbar from "./components/nav/Navbar";
import AppLayout from "./components/app-layout";
import { PageTitleProvider } from "./hooks/page-title-context";
const App = () => (
<Authenticated>
<PageTitleProvider>
<AppLayout>
</AppLayout>
</PageTitleProvider>
</Authenticated>
);
<Authenticated>
<PageTitleProvider>
<AppLayout>
</AppLayout>
</PageTitleProvider>
</Authenticated>
);
export default App;

View File

@ -1,27 +1,25 @@
import React, { useState } from 'react';
import { Layout, Menu, theme, Button } from 'antd';
import { Layout, theme, Button } from 'antd';
import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons';
import { Router } from '../router';
import { usePageTitle } from '../hooks/page-title-context';
import Navbar from './nav/Navbar';
const { Header, Content, Footer, Sider } = Layout;
const AppLayout = ({ navbar, footer }) => {
const AppLayout = ({ footer }) => {
const [collapsed, setCollapsed] = useState(false);
const { pageTitle } = usePageTitle();
const {
token: { colorBgContainer, borderRadiusLG },
} = theme.useToken();
return (
<Layout >
<Layout style={{ height:'100vh' }}>
<Sider breakpoint="lg" collapsible collapsed={collapsed}>
<div className="demo-logo-vertical" />
<Navbar/>
@ -32,9 +30,9 @@ const AppLayout = ({ navbar, footer }) => {
{pageTitle}
</Header>
<Content style={{margin: '24px 16px 0'}}>
<div style={{padding: 24, minHeight: 360, background: colorBgContainer, borderRadius: borderRadiusLG}}>
<Router />
<Content style={{ margin: '24px 16px 0'}}>
<div style={{ padding: 24, minHeight: 360, background: colorBgContainer, borderRadius: borderRadiusLG }}>
<Router />
</div>
</Content>
<Footer style={{ textAlign: 'center' }}>

View File

@ -4,4 +4,4 @@ import { AuthenticationProvider } from "../contexts";
export const Authenticated = ({ children }) => {
return <AuthenticationProvider>{children}</AuthenticationProvider>;
};
};

View File

@ -1,55 +1,85 @@
import React, { useState, useEffect } from "react";
import { HomeOutlined } from '@ant-design/icons-svg';
import { Menu } from "antd";
import { HomeOutlined } from "@ant-design/icons"
import { Home } from "../../pages";
import { getRoom } from "../../api/room";
function getItem(label, key, type, icon, children) {
return {
key: String(key),
icon,
children,
label,
type,
};
import { isLoggedIn } from "../../api/authentication"
import { Test } from "../../pages/test";
import { Link } from "react-router-dom";
function getItem(key, label) {
//return {
// key: String(key),
// icon,
// children,
// label,
// link,
//};
var item = <Menu.Item key={key}>
<Link to="/test">{label}</Link>
</Menu.Item >
return item
}
const { SubMenu } = Menu;
// Component
const Navbar = () => {
//Hook calls
const [rooms, setRooms] = useState([]);
useEffect(() => {
if (true) {
getRoom().then((result) => {
setRooms(result);
});
}
}, []);
useEffect(() => {
console.log("NAVBAR EFFECT")
isLoggedIn().then((user) => {
if (user !== "Unauthorized") {
getRoom().then((result) => {
setRooms(result);
})
}
})
}, []);
const roomItems = rooms.map((room, index) => (
getItem(room.name, `sub${index}`, <Home />)
console.log(index),
getItem(`sub${index}`, room.name)
));
const items = [
getItem("Menu principal", "1", <Home />),
getItem("Vue d'ensemble", "2", <Home />),
{
key: "3",
label: "Chambres",
icon: "",
children: roomItems, // Utilisation des éléments de menu des chambres
},
<Menu.Item key="0">
<Link to="/">Menu Principal</Link>
</Menu.Item>,
<Menu.Item key="1" >
<Link to="/home">Home</Link>
</Menu.Item>,
<Menu.Item key="2" >
<Link to="/test">Test</Link>
</Menu.Item>,
<SubMenu key="3" title="Chambres">
{roomItems}
</SubMenu>
];
// Rendu du composant Navbar
return (
<Menu
defaultSelectedKeys={["1"]}
defaultOpenKeys={["sub1"]}
theme="dark"
mode="inline"
items={items}
/>
);
try {
return (
<Menu
defaultSelectedKeys={["1"]}
defaultOpenKeys={["sub1"]}
theme="dark"
mode="inline"
>
{items}
</Menu>
);
} catch (error) {
console.log(error.stack)
}
};
export default Navbar;

View File

@ -6,6 +6,6 @@ export function useAuth() {
return React.useContext(AuthenticationContext);
}
//export function getAuth() {
// return React.useContext(AuthenticationContext).user;
//}
export function useGetAuth() {
return React.useContext(AuthenticationContext).user;
}

View File

@ -9,13 +9,13 @@ import { Layout } from "antd";
setupAxios();
ReactDOM.createRoot(document.getElementById("root")).render(
<React.StrictMode>
<BrowserRouter>
<CookiesProvider>
<Layout>
<App />
</Layout>
<App/>
</CookiesProvider>
</BrowserRouter>
</React.StrictMode>,

View File

@ -1,7 +1,6 @@
import React from "react";
import { useAuth } from "../hooks";
import { DatePicker } from "antd";
import { FormCreateItem } from "../components/form/formCreateItem";
import { FormCreateRoom } from "../components/form/formCreateRoom";
import { RoomItemsList } from "../components/item/RoomItemsList";