mirror of
https://github.com/0xShay/ticketchain.git
synced 2026-01-11 21:23:24 +00:00
Update homepage and link input to search
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import React, { useEffect, useState, useRef } from 'react';
|
||||
import Header from '../../components/custom/header';
|
||||
import Footer from '../../components/custom/footer';
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
|
||||
// Define the Event interface including new fields
|
||||
interface Event {
|
||||
@@ -70,6 +71,8 @@ const EventsPage: React.FC = () => {
|
||||
const [showSortMenu, setShowSortMenu] = useState<boolean>(false);
|
||||
const [showFilterMenu, setShowFilterMenu] = useState<boolean>(false);
|
||||
|
||||
const searchParams = useSearchParams();
|
||||
|
||||
const sortRef = useRef<HTMLDivElement>(null);
|
||||
const filterRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
@@ -140,6 +143,9 @@ const EventsPage: React.FC = () => {
|
||||
|
||||
useEffect(() => {
|
||||
document.addEventListener('mousedown', handleClickOutside);
|
||||
if (searchParams.get("q")) {
|
||||
setSearchQuery(searchParams.get("q")!);
|
||||
};
|
||||
return () => {
|
||||
document.removeEventListener('mousedown', handleClickOutside);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user