diff --git a/src/components/ToolBar/ToolBar.jsx b/src/components/ToolBar/ToolBar.jsx new file mode 100644 index 0000000..7788f59 --- /dev/null +++ b/src/components/ToolBar/ToolBar.jsx @@ -0,0 +1,66 @@ +import styles from "./ToolBar.module.css" +import {Link} from "react-router"; +import Filter from "../Filter/Filter.jsx"; +import {useEffect, useState} from "react"; +import SearchBar from "../SearchBar/SearchBar.jsx"; + + +function ToolBar({setFilters, filters}) { + 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} +
+ + + + + + + +
+ +
+ +
+
+
+
+ ); +} + +export default ToolBar; \ No newline at end of file diff --git a/src/components/ToolBar/ToolBar.module.css b/src/components/ToolBar/ToolBar.module.css new file mode 100644 index 0000000..d67cd44 --- /dev/null +++ b/src/components/ToolBar/ToolBar.module.css @@ -0,0 +1,97 @@ +.eventsButtons { + overflow: visible; + position: fixed; + top: 10rem; + right: 2rem; + display: flex; + flex-direction: column; + align-items: flex-end; + width: fit-content; + height: fit-content; + gap: 1rem; +} + + +.filterContainer{ + padding: 0; + border-radius: 30px; + overflow: visible; +} + +.filterMenu{ + padding: 5px 5px 5px 5px; +} + +.createButton, .searchButton, .sortButton { + display: flex; + align-items: center; + justify-content: center; + border: none; + border-radius: 50%; + width: 55px; + height: 55px; + transition: all 0.5s ease; +} + +.createButton { + font-size: 2rem; + color: #019AFF; +} + +.createButton:hover, .searchButton:hover, .mobileFilter:hover { + transform: translateY(-5px); + cursor: pointer; +} + + +.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; +} + +.sortButton svg, .searchButton svg { + transform: scale(0.8); + fill: #019AFF; +} + + +.sortButton:focus, .searchButton:focus { + outline: none; +} + + + +@media screen and (max-width: 768px) { + .eventsButtons { + flex-direction: row; + position: relative; + top: 0; + right: 0; + align-items: flex-start; + width: 100%; + margin-top: 16px; + } + + .filterContainer{ + display: flex; + width: fit-content; + } + + .filterMenu{ + width: fit-content; + } + + .createButton:hover, .searchButton:hover, .mobileFilter:hover { + transform: none !important; + } +} \ No newline at end of file diff --git a/src/pages/Events/EventsPage.jsx b/src/pages/Events/EventsPage.jsx index 3728572..84797be 100644 --- a/src/pages/Events/EventsPage.jsx +++ b/src/pages/Events/EventsPage.jsx @@ -1,39 +1,15 @@ -import {useState, useEffect} from "react"; +import {useState} from "react"; import Event from "../../components/Event/Event.jsx"; -import {Link} from "react-router"; import styles from "./EventsPage.module.css"; -import Filter from "../../components/Filter/Filter.jsx"; -import SearchBar from "../../components/SearchBar/SearchBar.jsx"; +import ToolBar from "../../components/ToolBar/ToolBar.jsx"; function EventsPage(){ - const [isFilterVisible, setIsFilterVisible] = useState(false); - const [isSearchVisible, setIsSearchVisible] = useState(false); - - const toggleFilters = () => { - setIsFilterVisible(prev => !prev); - }; - const [filters, setFilters] = useState({ alphabetical: "asc", yearOrder: "asc", }); - useEffect(() => { - if (isSearchVisible) { - document.documentElement.style.overflow = 'hidden'; - } else { - document.documentElement.style.overflow = ''; - } - - return () => { - document.documentElement.style.overflow = ''; - }; - }, [isSearchVisible]); - - - - const [events] = useState([ { id: 1, @@ -235,48 +211,14 @@ function EventsPage(){ }); - - return (
- - {isSearchVisible ? ( -
-
setIsSearchVisible(false)}>
- -
- ) : null} - -
- - + - - - - -
- -
- -
-
-
+
{sortedEvents.map((event, index) => ( ))}
-
) } diff --git a/src/pages/Events/EventsPage.module.css b/src/pages/Events/EventsPage.module.css index 321145b..7666a73 100644 --- a/src/pages/Events/EventsPage.module.css +++ b/src/pages/Events/EventsPage.module.css @@ -8,102 +8,4 @@ display: flex; align-items: center; flex-direction: column; -} - -.eventsButtons { - overflow: visible; - position: fixed; - top: 10rem; - right: 2rem; - display: flex; - flex-direction: column; - align-items: flex-end; - width: fit-content; - height: fit-content; - gap: 1rem; -} - - -.filterContainer{ - padding: 0; - border-radius: 30px; - overflow: visible; -} - -.filterMenu{ - 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; - align-items: center; - justify-content: center; - border: none; - border-radius: 50%; - width: 55px; - height: 55px; - transition: all 0.5s ease; -} - -.createButton { - font-size: 2rem; - color: #019AFF; -} - -.sortButton svg, .searchButton svg { - transform: scale(0.8); - fill: #019AFF; -} - -.createButton:hover, .searchButton:hover, .mobileFilter:hover { - transform: translateY(-5px); - cursor: pointer; -} - - -.sortButton:focus, .searchButton:focus { - outline: none; -} - - -@media screen and (max-width: 768px) { - .eventsButtons { - flex-direction: row; - position: relative; - top: 0; - right: 0; - align-items: flex-start; - width: 100%; - margin-top: 16px; - } - - .filterContainer{ - display: flex; - width: fit-content; - } - - .filterMenu{ - width: fit-content; - } - - .createButton:hover, .searchButton:hover, .mobileFilter:hover { - transform: none !important; - } -} - +} \ No newline at end of file