mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-07-23 12:36:57 +00:00
scroll to top bug fix
This commit is contained in:
@@ -12,7 +12,6 @@ export default function TournamentTable({
|
||||
const [searchQuery, setSearchQuery] = useState(""); // text from search bar
|
||||
const [filteredTournamentData, setFilteredTournamentData] =
|
||||
useState(tournamentData);
|
||||
const [isLgScreen, setIsLgScreen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setFilteredTournamentData(
|
||||
@@ -20,18 +19,6 @@ export default function TournamentTable({
|
||||
);
|
||||
}, [searchQuery]);
|
||||
|
||||
useEffect(() => {
|
||||
const handleResize = () => {
|
||||
setIsLgScreen(window.innerWidth >= 1024);
|
||||
};
|
||||
handleResize();
|
||||
|
||||
window.addEventListener("resize", handleResize);
|
||||
return () => {
|
||||
window.removeEventListener("resize", handleResize);
|
||||
};
|
||||
}, []);
|
||||
|
||||
// TODO move this section into its own function
|
||||
if (filteredTournamentData.length === 0) {
|
||||
tableData = (
|
||||
@@ -83,7 +70,7 @@ export default function TournamentTable({
|
||||
setTournamentFilter={setSearchQuery}
|
||||
/>
|
||||
<div>
|
||||
<ScrollToTopButton isLgScreen={isLgScreen} />
|
||||
<ScrollToTopButton />
|
||||
</div>
|
||||
</div>
|
||||
<table
|
||||
|
||||
Reference in New Issue
Block a user