From 9139868678446d0586b823e75f4684ebaaa9b915 Mon Sep 17 00:00:00 2001 From: "pro.boooooo" Date: Fri, 5 Apr 2024 22:01:23 +0200 Subject: [PATCH] $ --- src/components/NavBar/NavBar.jsx | 28 +++-------------------- src/layout/Layout.scss | 2 +- src/pages/home/home.scss | 6 ++--- src/pages/profile/Profile.jsx | 4 ++-- src/pages/profile/Profile.scss | 2 +- src/pages/room/Room.jsx | 4 ++-- src/pages/rooms/Rooms.jsx | 38 +++++++++++++++++++++++++++----- src/pages/rooms/Rooms.scss | 12 ++++++++++ src/router.jsx | 1 + 9 files changed, 58 insertions(+), 39 deletions(-) diff --git a/src/components/NavBar/NavBar.jsx b/src/components/NavBar/NavBar.jsx index b9514b1..c2bc464 100644 --- a/src/components/NavBar/NavBar.jsx +++ b/src/components/NavBar/NavBar.jsx @@ -2,14 +2,10 @@ import { useAuth } from "../../hooks"; import "./NavBar.scss"; import { logout } from "../../api"; import { Link } from "react-router-dom/"; -import { getRoomsLength } from "../../api"; -import { useEffect } from "react"; -import { useState } from "react"; import refresh from "../../services/pageManagement"; export default function NavBar() { const { user } = useAuth(); - const [roomsLength, setRoomsLength] = useState(null); const onLogout = () => { logout().then((res) => { @@ -19,43 +15,25 @@ export default function NavBar() { }); }; - const refreshAllDatas = async () => { - const roomsLen = await getRoomsLength(); - if (!roomsLen) { - return; - } - setRoomsLength(roomsLen); - }; - - useEffect(() => { - refreshAllDatas(); - }, []); - return (