From 171a202859c96f5cfab10befe18a306b06fccf1a Mon Sep 17 00:00:00 2001 From: T'JAMPENS QUENTIN p2406187 Date: Wed, 11 Feb 2026 15:35:18 +0100 Subject: [PATCH] Use searchBarBtn component --- src/components/ToolBar/ToolBar.jsx | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/src/components/ToolBar/ToolBar.jsx b/src/components/ToolBar/ToolBar.jsx index 874fa70..a4590a3 100644 --- a/src/components/ToolBar/ToolBar.jsx +++ b/src/components/ToolBar/ToolBar.jsx @@ -1,50 +1,27 @@ import styles from "./ToolBar.module.css" import Filter from "../Filter/Filter.jsx"; import {useContext, useEffect, useState} from "react"; -import SearchBar from "../SearchBar/SearchBar.jsx"; +use import SearchBar from "../SearchBar/SearchBar.tsx"; import CreateEventBtn from "../createEventBtn/CreateEventBtn.jsx"; import Button from "../ui/button/button.tsx"; import {AuthContext} from "../../contexts/auth/AuthContext.js"; +import SearchBtn from "./components/searchBtn/SearchBtn.tsx"; function ToolBar({setFilters, filters, showCreate = true}) { const { user } = useContext(AuthContext); const [isFilterVisible, setIsFilterVisible] = useState(false); - const [isSearchVisible, setIsSearchVisible] = useState(false); const toggleFilters = () => { setIsFilterVisible(prev => !prev); }; - - useEffect(() => { - if (isSearchVisible) { - document.documentElement.style.overflow = 'hidden'; - } else { - document.documentElement.style.overflow = ''; - } - - return () => { - document.documentElement.style.overflow = ''; - }; - }, [isSearchVisible]); - - - return (
- {isSearchVisible ? ( -
-
setIsSearchVisible(false)}>
- -
- ) : null}
{showCreate && user.isAdmin ? ( ) : null} - +