initialize searchBar component
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#000000"><path d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 376 B |
@@ -0,0 +1,23 @@
|
|||||||
|
import styles from "./SearchBar.module.css"
|
||||||
|
|
||||||
|
function SearchBar({isSearchVisible, setIsSearchVisible}) {
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<form action="" method="POST">
|
||||||
|
<div>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="24px" viewBox="0 -960 960 960" fill="#currentColor">
|
||||||
|
<path
|
||||||
|
d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/>
|
||||||
|
</svg>
|
||||||
|
<input type="text"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button onClick={() => setIsSearchVisible(false)}>ok</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SearchBar;
|
||||||
@@ -3,11 +3,12 @@ import Event from "../../components/Event/Event.jsx";
|
|||||||
import {Link} from "react-router";
|
import {Link} from "react-router";
|
||||||
import styles from "./EventsPage.module.css";
|
import styles from "./EventsPage.module.css";
|
||||||
import Filter from "../../components/Filter/Filter.jsx";
|
import Filter from "../../components/Filter/Filter.jsx";
|
||||||
|
import SearchBar from "../../components/SearchBar/SearchBar.jsx";
|
||||||
|
|
||||||
|
|
||||||
function EventsPage(){
|
function EventsPage(){
|
||||||
const [isFilterVisible, setIsFilterVisible] = useState(false);
|
const [isFilterVisible, setIsFilterVisible] = useState(false);
|
||||||
|
const [isSearchVisible, setIsSearchVisible] = useState(false);
|
||||||
const toggleFilters = () => {
|
const toggleFilters = () => {
|
||||||
setIsFilterVisible(prev => !prev);
|
setIsFilterVisible(prev => !prev);
|
||||||
};
|
};
|
||||||
@@ -222,12 +223,24 @@ function EventsPage(){
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.eventsContainer}>
|
<div className={styles.eventsContainer}>
|
||||||
|
|
||||||
|
{isSearchVisible ? (
|
||||||
|
<SearchBar className={styles.searchBar} setIsSearchVisible={setIsSearchVisible} isSearchVisible={isSearchVisible} />
|
||||||
|
) : null}
|
||||||
|
|
||||||
<div className={styles.eventsButtons}>
|
<div className={styles.eventsButtons}>
|
||||||
<Link
|
<Link
|
||||||
to="/event/create"
|
to="/event/create"
|
||||||
className={`${styles.createButton} glassCard`}>
|
className={`${styles.createButton} glassCard`}>
|
||||||
+
|
+
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
|
<button className={`${styles.searchButton} glassCard`} onClick={() => setIsSearchVisible(true)}>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="#currentColor">
|
||||||
|
<path d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
|
||||||
<div className={`${styles.filterContainer} ${isFilterVisible ? "glassCard" : ""}`}>
|
<div className={`${styles.filterContainer} ${isFilterVisible ? "glassCard" : ""}`}>
|
||||||
<button className={`${isFilterVisible ? "" : styles.mobileFilter} ${styles.sortButton} glassCard`} onClick={toggleFilters}>
|
<button className={`${isFilterVisible ? "" : styles.mobileFilter} ${styles.sortButton} glassCard`} onClick={toggleFilters}>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor">
|
||||||
@@ -244,6 +257,7 @@ function EventsPage(){
|
|||||||
<Event key={index} event={event} />
|
<Event key={index} event={event} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
.eventsContainer {
|
.eventsContainer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -34,7 +35,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.createButton, .sortButton {
|
.createButton, .searchButton, .sortButton {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -50,25 +51,28 @@
|
|||||||
color: #019AFF;
|
color: #019AFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sortButton svg {
|
.sortButton svg, .searchButton svg {
|
||||||
transform: scale(0.8);
|
transform: scale(0.8);
|
||||||
fill: #019AFF;
|
fill: #019AFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sortButton:hover {
|
.createButton:hover, .searchButton:hover, .mobileFilter:hover {
|
||||||
|
transform: translateY(-5px);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.createButton:hover, .mobileFilter:hover {
|
|
||||||
transform: translateY(-5px);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
.sortButton:focus, .searchButton:focus {
|
||||||
.sortButton:focus {
|
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
.sortButton:focus-visible {
|
|
||||||
outline: 2px solid black;
|
|
||||||
|
|
||||||
|
.searchBar {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -92,7 +96,7 @@
|
|||||||
width: fit-content;
|
width: fit-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
.createButton:hover, .mobileFilter:hover {
|
.createButton:hover, .searchButton:hover, .mobileFilter:hover {
|
||||||
transform: none !important;
|
transform: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user