diff --git a/src/components/SearchBar/SearchBar.jsx b/src/components/SearchBar/SearchBar.jsx index b984cb9..fb7da99 100644 --- a/src/components/SearchBar/SearchBar.jsx +++ b/src/components/SearchBar/SearchBar.jsx @@ -1,21 +1,17 @@ import styles from "./SearchBar.module.css" -function SearchBar({isSearchVisible, setIsSearchVisible}) { +function SearchBar() { return ( -
-
-
- - - - -
- - -
+
+
+ + + + +
); } diff --git a/src/components/SearchBar/SearchBar.module.css b/src/components/SearchBar/SearchBar.module.css index e69de29..5779207 100644 --- a/src/components/SearchBar/SearchBar.module.css +++ b/src/components/SearchBar/SearchBar.module.css @@ -0,0 +1,21 @@ +.searchBarContainer{ + position: fixed; + top: 10rem; + z-index: 100; + width: 60%; + background: #fff; +} + +.searchBarForm{ + display: flex; +} + +.searchBarForm input{ + background: none; + box-shadow: none; + height: 2em; +} + +.searchBarForm input:focus{ + outline: none; +} diff --git a/src/pages/Events/EventsPage.jsx b/src/pages/Events/EventsPage.jsx index 2d8e636..83f1e32 100644 --- a/src/pages/Events/EventsPage.jsx +++ b/src/pages/Events/EventsPage.jsx @@ -1,4 +1,4 @@ -import {useState} from "react"; +import {useState, useEffect} from "react"; import Event from "../../components/Event/Event.jsx"; import {Link} from "react-router"; import styles from "./EventsPage.module.css"; @@ -18,6 +18,18 @@ function EventsPage(){ yearOrder: "asc", }); + useEffect(() => { + if (isSearchVisible) { + document.getElementById("root").style.overflow = 'hidden'; + } else { + document.getElementById("root").style.overflow = ''; + } + + return () => { + document.getElementById("root").style.overflow = ''; + }; + }, [isSearchVisible]); + const [events] = useState([ { id: 1, @@ -225,7 +237,10 @@ function EventsPage(){
{isSearchVisible ? ( - +
+
setIsSearchVisible(false)}>
+ +
) : null}
diff --git a/src/pages/Events/EventsPage.module.css b/src/pages/Events/EventsPage.module.css index 059e604..bc8aa08 100644 --- a/src/pages/Events/EventsPage.module.css +++ b/src/pages/Events/EventsPage.module.css @@ -34,6 +34,22 @@ padding: 5px 5px 5px 5px; } +.searchBarOverlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 100; + background-color: rgba(0, 0, 0, 0.3); + backdrop-filter: blur(4px); +} + + +.searchBarContainer{ + display: flex; + justify-content: center; +} .createButton, .searchButton, .sortButton { display: flex; @@ -67,15 +83,6 @@ } - -.searchBar { - position: absolute; - top: 0; - right: 0; - left: 0; -} - - @media screen and (max-width: 768px) { .eventsButtons { flex-direction: row;